Posts

Showing posts from April, 2024

Uninstall MySQL server and client from Ubuntu

Image
 Uninstall MySQL server and client from Ubuntu   sudo service mysql stop sudo apt-get remove --purge mysql-server mysql-client mysql-common sudo apt-get autoremove sudo apt-get autoclean sudo rm -rf /var/lib/mysql/ sudo rm -rf /etc/mysql/ RE-INSTALL  sudo apt-get install mysql-server mysql-client If in case you got this error in trying to login:  sudo systemctl stop mysql.service sudo mkdir -p /var/run/mysqld sudo chown mysql:mysql /var/run/mysqld sudo mysqld_safe --skip-grant-tables --skip-networking & sudo mysql -u root  CHANGE THE ROOT PASSWORD: FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; exit; sudo pkill mysqld_safe mysql -u root -p "provide your password and login"            

My Linux Software i use

 My Linux Software i use   Normal use Software: sudo snap install vlc sudo snap install code --classic sudo apt install git    

How to Upload file in React and convert to json and upload to local MongoDB

 How to Upload file in React and convert to json and upload to local MongoDB App.js // App.js import React, { useState } from 'react'; function App() {   const [message, setMessage] = useState('');   const [file, setFile] = useState(null);   const handleFileChange = (event) => {     setFile(event.target.files[0]);   };   const handleUpload = () => {   if (!file) {     console.error('No file selected.');     return;   }   const formData = new FormData();   formData.append('file', file);   formData.append('filename', file.name); // Append filename to FormData   fetch('http://localhost:5000/upload', {     method: 'POST',     body: formData,   })     .then(response => response.text())     .then(data => {       setMessage(data);       setFile(null); // Reset file ...

How to Write a Hello Node App with ReactJS

Image
 How to Write a Hello Node App with ReactJS                             1. Create a ReactJS App. npx create-react-app hello-app cd hello-app npm start 2. Create a Backend NodeJS file structure.     Inside your `hello-react` project create a folder backend/server.js   server.js const express = require('express'); const cors = require('cors'); const app = express(); app.use(cors()); app.get('/hello', (req, res) => {   res.setHeader('Content-Type', 'text/plain');   res.send('Hello, world!\n'); }); const PORT = process.env.PORT || 5000; app.listen(PORT, () => console.log(`Server running on port ${PORT}`));     App.js import React, { useState } from 'react'; function App() {   const [message, setMessage] = useState('');   const handleClick = () => {     var url = 'http://localhost:5000...

Java Releases - Summary

Image
 Java Releases - Summary   Here's a summary of the Java version releases with their respective Class File Format Version, Release dates, and End of Support dates: JDK 1.0 (Java 1.0): Class File Format Version: 45 Release Date: 23rd January 1996 End of Public Updates: May 1996 JDK 1.1 (Java 1.1): Class File Format Version: 45 Release Date: 18th February 1997 End of Public Updates: October 2002 J2SE 1.2: Class File Format Version: 46 Release Date: 4th December 1998 End of Public Updates: November 2003 J2SE 1.3: Class File Format Version: 47 Release Date: 8th May 2000 End of Public Updates: March 2006 J2SE 1.4: Class File Format Version: 48 Release Date: 13th February 2002 End of Public Updates: October 2008 J2SE 5.0 (Java 5): Class File Format Version: 49 Release Date: 30th September 2004 End of Public Updates: October 2009 Java SE 6: Class File Format Version: 50 Release Date: 11th December 2006 End of Public Updates: April 2013 Java SE 7: Class File Format Version: 51...