Skip to content

Instantly share code, notes, and snippets.

@oychao
Last active July 18, 2019 10:04
Show Gist options
  • Save oychao/f02579680471d7f03cd504b24012acca to your computer and use it in GitHub Desktop.
Save oychao/f02579680471d7f03cd504b24012acca to your computer and use it in GitHub Desktop.
some ubuntu commands and normal configurations after system installed

Ubuntu/Mac shells and normal configurations

# edit ~/.bashrc
PS1="$PS1\n"
alias gitlg1="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
alias gitlg2="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
alias gitlg="gitlg1"
!/usr/bin/expect -f
# debug
#exp_internal 1
set timeout -1
set server serverip
set pem ~/chao.pem
set username chao
set password password1
spawn ssh -o "StrictHostKeyChecking no" -i $pem $username@$server
expect "*pem':*"
send -- "$password\r"
#expect "*password:*"
#send -- "$password\r"
expect "*ID>:*"
send -- "8\r"
expect "*~]\$*"
send -- "ssh dev@server2\r"
expect "*password:*"
send -- "password2\r"
#expect eof
interact
exit
#!/bin/bash
# install kubuntu
# https://www.fossmint.com/install-kde-plasma-on-ubuntu/
#sudo apt install kubuntu-desktop
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y net-tools curl vim expect tree
#!/bin/bash
# this file is derived from:
# https://linuxhint.com/install_zsh_shell_ubuntu_1804/
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y zsh
sudo usermod -s /usr/bin/zsh $(whoami)
sudo apt install -y powerline fonts-powerline zsh-theme-powerlevel9k zsh-syntax-highlighting git
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
echo "source /usr/share/powerlevel9k/powerlevel9k.zsh-theme" >> ~/.zshrc
echo "source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc
echo "Please reboot to enable ZSH"
#!/bin/bash
# sudo: add-apt-repository: command not found
sudo apt-get install software-properties-common python-software-properties
# install oracle jdk
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
# defaults write -g InitialKeyRepeat -int 11 # 按键重复启动速度
# defaults write -g KeyRepeat -int 2 # 按键重复速度
" ~/.vimrc
filetype plugin on " turn syntax highlight on
syntax on
set backspace=2 " make backspace reasonable
set whichwrap+=<,>,[,] " make arrow keys reasonable
set number " show line numbers
" emmet settings
" see https://github.com/mattn/emmet-vim/
let g:user_emmet_settings = {
\ 'indentation': ' '
\} " set all indentations with 2 spaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment