Setup Developing Environment on Ubuntu 18.04
Desktop Environment
Xfce: lightweight & user-friendly
Terminal Emulater
- Guake: dropdown windows terminal(like iTerm2’s hotkey window)
- Terminator: split panels
Shell
- oh-my-zsh
- make zsh your default shell:
chsh -s $(which zsh)
and then log out and log back in
Byobu
Byobu is a GPLv3 open source text-based window manager and terminal multiplexer.
sudo apt-get intall byobu
Git
install
sudo apt-get install git
initial setup
git config --global user.name cheng10
git config --global user.email cheng10@ualberta.ca
git config --global core.editor vim
check your settings
git config -l
generate a new SSH key(optional)
# This creates a new ssh key, using the provided email as a label.
ssh-keygen -t rsa -C "your_email@example.com"
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
Python
basical setup
sudo apt-get update
sudo apt-get -y upgrade
python3 --version
sudo apt-get install -y python3-pip python3-venv build-essential libssl-dev libffi-dev python-dev default-libmysqlclient-dev
virtualenv
mkdir ~/.venv
python3 -m venv ~/.venv/p3
source ~/.venv/p3/bin/activate
virtualenv wrapper
install
sudo pip3 install virtualenvwrapper
update your shell config file(.bashrc, .profile, .zshrc, etc.)
export WORKON_HOME=$HOME/.venvs
export PROJECT_HOME=$HOME/Projects
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh
to use
mkvirtualenv p3
workon p3
https://virtualenvwrapper.readthedocs.io/en/latest/install.html
China Optimization
- python pip mirror
git
proxy your ssh git clone: just setup ssh proxyjump
# ~/.ssh/config
Host github.com
User git
ProxyJump gce-jp
setup ss-local
systemd
# /lib/systemd/system/ss-local.service
[Unit]
Description=ss-local
After=network.target
[Service]
Type=simple
EnvironmentFile=/etc/default/ss-local
User=nobody
Group=nogroup
LimitNOFILE=32768
ExecStart=/usr/bin/ss-local -c $CONFFILE $DAEMON_ARGS
[Install]
WantedBy=multi-user.target
environment file
# /etc/default/ss-local
# Enable during startup?
START=yes
# Configuration file
CONFFILE="/etc/shadowsocks-libev/local-config.json"
# Extra command line arguments
DAEMON_ARGS="-u -v --acl /etc/shadowsocks-libev/chn.acl"
# chn.acl: bypass china ip, file can be found on ss-libenv github repo
# User and group to run the server as
USER=nobody
GROUP=nogroup
config.json
# /etc/shadowsocks-libev/local-config.json
{
"server":"YOUR SERVER IP",
"server_port":8388,
"password":"yourpassword",
"timeout":30,
"method":"aes-256-gcm",
"fast_open": true,
"local_address":"0.0.0.0",
"local_port":1080,
}