Skip to content

Instantly share code, notes, and snippets.

@cuongnguyen32199
Last active September 27, 2022 03:04
Show Gist options
  • Select an option

  • Save cuongnguyen32199/67a36033e706c54153dc1999ab04ffbb to your computer and use it in GitHub Desktop.

Select an option

Save cuongnguyen32199/67a36033e706c54153dc1999ab04ffbb to your computer and use it in GitHub Desktop.
Setting Ubuntu 18.04 LTS (Environment and Software)

Setup environment and software

Install vim

sudo apt-get update
sudo apt-get install vim

Install cURL:

sudo apt-get install curl

Install Git

sudo apt-get update
sudo apt-get install git

Git configuration

git config --global user.name "Nguyễn Mạnh Cường";
git config --global user.email "nguyenmanhcuong03@vccorp.vn";
git config --global alias.st status;
git config --global alias.co checkout;
git config --global alias.br branch;
git config --global alias.cmf "commit --amend --no-edit";
git config --global alias.lol "log --oneline";

Appearance

Install ZSH and Oh My ZSH

sudo apt-get install zsh
sudo apt-get install powerline fonts-powerline

Clone Oh My ZSH to home

git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

Copy Oh My ZSH template to ~/.zshrc

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

Open file ~/.zshrc and change theme to agnoster (recommend)

ZSH_THEME="agnoster"

Change default terminal to ZSH

chsh -s /bin/zsh

Logout to apply change

Install ZSH plugins

Highlight syntax

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1
echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"

Auto suggestion

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Update file ~/.zshrc

plugins=(... zsh-autosuggestions)
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=035'

Customize theme like MacOS

How To Make Ubuntu Look Like Mac (In 5 Steps) - OMG! Ubuntu!
Install gnome-shell extensions:

sudo apt-get install chrome-gnome-shell

Bonus extensions

User Themes - GNOME Shell Extensions
Dynamic Panel Transparency - GNOME Shell Extensions
Recommend install Plank Dock after install Dask to Dock
Install Plank Preferences from Ubuntu Software

Environments

Install nginx

Detail here: How To Install Nginx on Ubuntu 18.04 | DigitalOcean

sudo apt-get update
sudo apt-get install nginx
sudo ufw app list
sudo ufw allow 'Nginx HTTP'
sudo ufw status
systemctl status nginx

Install PHP

How to Install PHP (7, 7.2 or 7.3) on Ubuntu – ThisHosting.Rocks
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 18.04 · GitHub

sudo apt-get update
sudo apt-get install php7.2 php7.2-cli php7.2-fpm php7.2-curl php7.2-zip php7.2-gd php7.2-mysql php7.2-mbstring php7.2-xml php7.2-redis php7.2-dev php7.2-pear

Install pecl: sudo apt install php7.2-dev php7.2-pear
Install mongodb php extension:
sudo pecl install mongodb

Install Nodejs v10.17.0

https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions

Choose Node.js v10.x instructions section

Install Composer

Composer Download

If composer isn't global then run

sudo mv composer.phar /usr/local/bin/composer

Install Yarn, Bower

Yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn

If yarn isn't global. Update file ~/.zshrc

export PATH="$(yarn global bin):$PATH"

Bower

sudo npm i -g bower

Software

Install IBus Teni

GitHub - teni-ime/ibus-teni: Bộ gõ tiếng Việt cho Linux chạy trên IBus

sudo add-apt-repository ppa:teni-ime/ibus-teni
sudo apt-get update
sudo apt-get install ibus-teni
ibus restart

Read mouse events, need for ibus-teni work well (options)

sudo usermod -a -G input $USER

Install Telegram Desktop

Recommend install Telegram Desktop via apt-get to using its with Unikey.

sudo add-apt-repository ppa:atareao/telegram

sudo apt-get update

sudo apt-get install telegram

After that, reboot to using Unikey in Telegram Desktop

Install Smartgit

SmartGit Downloads
Download and extract tar file. Navigate to folder bin. run file smartgit.sh and add-menuitem.sh

. ./smartgit.sh
. ./add-menuitem.sh

Re purchase Smartgit (eg: Smartgit v19.1 and v20.1)

cd ~/.config/smartgit/20.1 && rm preferences.yml license
cd ~/Library/Preferences/SmartGit/21.2 && rm preferences.yml license

Install PHPStorm

Download PhpStorm: Lightning-Smart PHP IDE
Extract and navigate to folder bin. Then run file phpstorm.sh

. ./phpstorm.sh

Install SublimeText

Linux Package Manager Repositories – Sublime Text 3 Documentation

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text

Install Packages Control then install Splunk Conf File Syntax Highlighting and nginx packages to highlight syntax

Install OpenVPN

sudo apt-get install openvpn network-manager-openvpn network-manager-openvpn-gnome

Install PHP Xdebug

sudo apt-get update && sudo apt-get install php-xdebug
sudo subl /etc/php/7.2/mods-available/xdebug.ini

Update xdebug.ini with following information

xdebug.remote_enable=true
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1

Install Flameshot (screenshot)

GitHub - lupoDharkael/flameshot: Powerful yet simple to use screenshot software

sudo apt update && sudo apt install flameshot

Set shortcut for Flamshot
Open Settings/Devices/Keyboard then add shortcut

Name: Flameshot shortcut
Command: flameshot gui
Shortcut: Windows + Print Screen

Other software

Skype for Linux
DBeaver for SQL
Redis Desktop Manager
VSCode
Koala

Bonus information

Change workspace's owner to www-data

sudo chown -R www-data:www-data /var/www/

Add current user to www-data group

sudo adduser $USER www-data

Allow www-data group's members can modify workspace

sudo chmod -R g+rwx /var/www

Logout to apply new membership

Laravel installer

If laravel installer isn't global. Update .zshrc file

export PATH=~/.composer/vendor/bin:$PATH

Fix wrong auto scale resolution Redis Desktop Manager

Known Issues - Redis Desktop Manager
Find redis-desktop-manager_rdm.desktop using

locate redis-desktop-manager_rdm.desktop

or

sudo find / -iname "*redis-desktop*"

or default location

/var/lib/snapd/desktop/applications/redis-desktop-manager_rdm.desktop

Open file and add QT_AUTO_SCREEN_SCALE_FACTOR=0 to Exec line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment