- Install Git:
sudo apt install git - Add global configuration for Git user:
git config --global user.email "[email protected]" git config --global user.name "Your Name" - Add SSH. Details can be found in this gist
-
-
Save W3SS/bebddec9d0f2f2091502161c0be8b98a to your computer and use it in GitHub Desktop.
- Install Zsh:
sudo apt install zsh - Install git:
sudo apt install git - Install oh-my-zsh:
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" - Make
zshas default shell:chsh -s `which zsh` - Re-login to desktop to reflect changes.
MySql Client:
The mysql-client package allows you to connect to a MySQL server. It will give you the mysql command-line program.
MySql Server:
The mysql-server package allows to run a MySQL server which can host multiple databases and process queries on those databases.
-
Update Ubuntu
sudo apt update -
Upgrade Ubuntu
sudo apt upgrade -
Install MySQL Server
sudo apt install mysql-serverEnter root user password if asked.
-
Install MySQL Client
sudo apt install mysql-client -
Configure MySQL
sudo mysql_secure_installation [sudo] password for USER_NAME_OF_MACHINE: Would you like to setup VALIDATE PASSWORD plugin? Press y|Y for Yes, any other key for No: Please set the password for root here. New password: Re-enter new password: Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : ... skipping. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : ... skipping. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done! -
Test MySQL service
systemctl status mysql.service -
Test connecting to database
sudo mysqladmin -p -u root version -
Open Mysql Console
sudo mysql -p -u root -
In case the MySQL is not running, start it with
sudo systemctl start mysql -
In case you need to restart MySQL, restart it with
sudo systemctl restart mysql -
Create database in MySQL console
create database cp_intrafish; -
Install
mysql-configsudo apt-get install libmysqlclient-dev -
Load Database dump to the newly created database. Here
cp_intrafishis the database name andmyifm_dump.sqlis the SQL dump file.mysql -p -u root cp_intrafish<myifm_dump.sql -
Pretty output in MySQL console. Add
\Gat the end of your command. This will change the output just for that command, without changing the default output.SELECT * FROM product_price\G;
sudo apt-get -y install apache2
sudo apt-get -y install php libapache2-mod-php
sudo apt-get -y install php-mbstring php-mbstring php-gettext
systemctl restart apache2
php --version
sudo apt-get -y install phpmyadmin
sudo systemctl restart mysql.service
sudo nano /etc/apache2/apache2.conf
- Add the following line at the end:
Include /etc/phpmyadmin/apache.conf - Restart Apache server
sudo systemctl restart apache2 - To access phpMyAdmin go to
http://localhost/phpmyadmin/
MySQL 5.7 changed the secure model: now MySQL root login requires a sudo.
I.e., phpMyAdmin will be not able to use root credentials.
The simplest, safest and permanent solution will be create a new user and grant required privileges.
- Connect to MySQL
sudo mysql --user=root mysql - Create an user for phpMyAdmin
Replace
some_passby the desired password:
If you getCREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';ERROR 1396 (HY000): Operation CREATE USER failed for 'phpmyadmin'@'localhost', check if you have already an user calledphpmyadminusing:
Then give all privileges to the user:select user,host from user;GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES;
If your phpMyAdmin is connecting to localhost, this should be enough.
- Add File read/write permission for current user in
/var/wwwdirectory:➜ ~ whoami arsho ➜ ~ sudo adduser arsho www-data [sudo] password for arsho: Adding user `arsho' to group `www-data' ... Adding user arsho to group www-data Done. ➜ ~ sudo chown -R www-data:www-data /var/www ➜ ~ sudo chmod -R g+rwX /var/www - Logout and Login again.
- Ubuntu 18.04 comes with Python 3.6.7:
python3 --version Python 3.6.7 - It does not have
idleorvenvin it. - Install
idle:sudo apt install idle - Install
venv:sudo apt-get install python3-venv
- Create new virtual environment and activate it
python3 -m venv venv source venv/bin/activate - Install
flask:pip install flask - Application
app.py:from flask import Flask app = Flask(__name__) @app.route('/') def index(): return "Hello from Flask" - Environment file
.flaskenv:FLASK_APP=app.py FLASK_ENV=development - Run the application:
flask run
Steps to install Ubuntu 18.04 alongside pre installed Windows 10 as dual boot in NVMe SSD.
- Dell G5 5587
- Core i7 8750H
- RAM 16 GB
- NVMe SSD (Toshiba) 256 GB
- HDD 1 TB
- NVIDIA® GeForce® GTX 1060 6GB GDDR5 with Max-Q Design
- Download Ubuntu iso file from Ubuntu website.
- Download Rufus from Rufus website.
- Press Win + R.
- Type
msinfo32and press Enter. - Look for the BIOS Mode entry.
- If the value listed is Legacy, then the Boot Environment is BIOS, otherwise the respective Boot Environment will be listed.
- Insert a USB pendrive.
- Backup the pendrive data if necessary.
- Open Rufus.
- Select Partition Scheme
MBR. - Keep the other settings to default. E.g.: FAT.
- Select the ISO and burn it to the connected pendrive.
- Open disk management in Windows.
- Shrink the volume where Windows is installed(NVMe SSD). The size depends on yourself. I have created 100 GB of unallocated space.
- Dual boot does not work when Fast startup option is enabled in Windows 10.
- Right-click the
Startbutton. - Click
Search. - Type
Control Paneland hit Enter on your keyboard. - Click
Power Options. - Click
Choose what the power buttons do. - Click
Change settings that are currently unavailable. - Uncheck
Turn on fast startup (recommended). - Click
Save changes.
- Tap F2 key at the Dell logo screen to enter System Setup or BIOS.
- On the left pane, click
Boot Sequence. - Check that Secure Boot is set to Disabled. Within the BIOS go to
Secure Boot>Secure Boot Enable, and set the checkbox toDisabled. - Change the
Secure Boot Modetoaudit mode. - Save settings and the machine will be restarted.
- With a preinstalled Windows SATA mode set to IDE or RAID in BIOS.
- To install dual boot we need to change SATA mode to AHCI from BIOS.
- Create the Windows 10 local account:
- Go to Settings > Accounts.
- Select
Family & other users. - Tap
Add someone else to this PC. - Select
I don't have this person's sign-in information. - Select
Add a user without a Microsoft account. - Enter a username, type the account's password twice, enter a clue and select Next.
- Change the
Account typeof this newly created account toAdministrator. - Login using this new user account.
- Right-click the Windows Start Menu. Choose Command Prompt (Admin).
- Type this command and press ENTER:
bcdedit /set {current} safeboot minimal - Restart the computer and enter BIOS Setup. On Dell Inspiron it is F2.
- Change the
SATA Operation modetoAHCIfrom eitherIDEorRAID. - Save changes and exit Setup and Windows will automatically boot to Safe Mode.
- Right-click the Windows Start Menu once more. Choose Command Prompt (Admin).
- Type this command and press ENTER:
bcdedit /deletevalue {current} safeboot - Reboot once more and Windows will automatically start with AHCI drivers enabled.
- After the OS burn, insert the pendrive and restart the machine.
- Press F12 or F10 depending your machine.
- Select USB/Removable media.
- Select install Ubuntu.
- Select Language and other options.
- When it comes to partition option, select
something else. - In the unallocated space:
- Give 2 GB Logical space to swap memory. The swap size depends on your RAM size.
- Give remaining Primary space to
/partition
- Select
Windows Boot ManagerasDevice for boot loader installation. - Continue with the remaining process.
- After successful installation of Ubuntu, update the system softwares.
- To update the drivers:
sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade ubuntu-drivers devices sudo ubuntu-drivers autoinstall - You may now access both Windows and Ubuntu in a dual boot manner.