Skip to content

Instantly share code, notes, and snippets.

@chenhengqi
Last active March 31, 2025 05:36
Show Gist options
  • Save chenhengqi/780c4ba0acafb71a9f16ea6bf35b3df5 to your computer and use it in GitHub Desktop.
Save chenhengqi/780c4ba0acafb71a9f16ea6bf35b3df5 to your computer and use it in GitHub Desktop.
Ubuntu Setup

Initialization

$ sudo apt update
$ sudo apt upgrade
$ sudo passwd

Shell

Install zsh and Oh My Zsh

$ sudo apt install zsh
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Setup font

$ sudo apt install python3-pip
$ sudo pip3 install powerline-status
$ git clone https://github.com/powerline/fonts.git && cd fonts && ./install.sh

Enable theme

Edit ~/.zshrc, change ZSH_THEME from robbyrussell to agnoster

ZSH_THEME="agnoster"

Syntax Highlighting

# located at /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
$ sudo apt install zsh-syntax-highlighting
# source at the end of ~/.zshrc
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Auto Completions

$ git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
# edit ~/.zshrc
plugins=(… zsh-completions)
autoload -U compinit && compinit
$ git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# edit ~/.zshrc
plugins=(... zsh-autosuggestions)
$  git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
# edit ~/.zshrc
plugins=(... history-substring-search)

References

Vim

Vundle

$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Edit ~/.vimrc as described in the README

YouCompleteMe

$ sudo apt install build-essential cmake vim-nox python3-dev
$ sudo apt install golang npm default-jdk nodejs mono-complete
$ cd ~/.vim/bundle/YouCompleteMe
$ git submodule update --init --recursive
$ python3 install.py --all

Color Scheme

$ git clone https://github.com/altercation/vim-colors-solarized.git
$ cd vim-colors-solarized/colors
$ mv solarized.vim ~/.vim/colors/

References

Docker

Follow https://docs.docker.com/engine/install/ubuntu/

SUDO

Update PATH by editing secure_path in /etc/sudoers

Packages

@chenhengqi
Copy link
Author

.vimrc

syntax enable
set background=dark
let g:solarized_termtrans = 1
colorscheme solarized
set tabstop=4
set expandtab
set nu

set nocompatible
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'
Plugin 'ycm-core/YouCompleteMe'

call vundle#end()
filetype plugin indent on

@chenhengqi
Copy link
Author

For kernel build:

$ sudo apt install flex bison libelf-dev libcap-dev

@chenhengqi
Copy link
Author

For kernel build, we need llvm and dwarves.

@chenhengqi
Copy link
Author

sudo apt-get install libssl-dev

@chenhengqi
Copy link
Author

sudo apt install libncurses-dev

@chenhengqi
Copy link
Author

$ scripts/config --disable SYSTEM_TRUSTED_KEYS
$ scripts/config --disable SYSTEM_REVOCATION_KEYS

@chenhengqi
Copy link
Author

$ sudo apt install libpolly-16-dev

@chenhengqi
Copy link
Author

$ sudo apt install libdw-dev

@chenhengqi
Copy link
Author

$ sudo apt install binutils-dev

@chenhengqi
Copy link
Author

$ sudo apt install libclang-16-dev

@chenhengqi
Copy link
Author

Thunderbird

Settings > Composition > Sending Format > Only Plain Text
Settings > General > Config Editor
	mailnews.wraplength: 0
	mailnews.send_plaintext_flowed: false
	mail.identity.default.compose_html: false
View > Message Body As > Plain Text

@chenhengqi
Copy link
Author

@chenhengqi
Copy link
Author

@chenhengqi
Copy link
Author

fallocate -l 2G la-1g.img
mkfs.ext4 la-1g.img
mount -o loop la-1g.img /mnt/loopback
tar -xf archlinux-bootstrap-loong64.tar.gz -C /mnt/loopback
umount /mnt/loopback
tar cfJ la-1g.img.tar.xz la-1g.img

@chenhengqi
Copy link
Author

Useful packages:

  • tldr
  • cmatrix
  • hollywood

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

@chenhengqi
Copy link
Author

sudo pipx install powerline-status

@chenhengqi
Copy link
Author

rustup component add rust-src

@chenhengqi
Copy link
Author

chenhengqi commented Mar 18, 2025

sudo apt install -y zsh python3-pip zsh-syntax-highlighting flex bison	\
	libelf-dev libcap-dev libssl-dev libncurses-dev cmake		\
	libdw-dev binutils-dev git-email pipx
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sudo pipx install powerline-status
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions

@chenhengqi
Copy link
Author

sudo apt -y install python3-docutils
sudo ln -s /usr/bin/llvm-strip-19 /usr/bin/llvm-strip
sudo ln -s /usr/bin/clang-19 /usr/bin/clang

@chenhengqi
Copy link
Author

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