Skip to content

Instantly share code, notes, and snippets.

@RyanJeong
Last active July 5, 2024 18:57
Show Gist options
  • Save RyanJeong/226d2c1565e28de6039d47ebae8d8dd5 to your computer and use it in GitHub Desktop.
Save RyanJeong/226d2c1565e28de6039d47ebae8d8dd5 to your computer and use it in GitHub Desktop.
Ubuntu(18.04) Default Setting

Initial setting before:

  1. Open a terminal(Ctrl + Alt + T)
  2. (Opt.) Replace {kr|us}.archive.ubuntu.com with mirror.kakao.com
$ sudo vi /etc/apt/sources.list
:%s/{kr|us|.archive.ubuntu.com/mirror.kakao.com/
  1. Type sudo apt update && sudo apt upgrade -y

Mount external HDD

  1. Connect the external HDD that you want to use
  2. Open a terminal(Ctrl + Alt + T) and type sudo fdisk -l to check the HDD is connected successfully
  3. Type sudo blkid to get UUID of the HDD
  4. Type sudo mkdir /<DIR_NAME> to make the directory to be linked with the HDD
  5. Type sudo vim /etc/fstab, type UUID=<HDD_UUID> /<DIR_NAME> ext4 defaults 0 0, and type :wq to save it
  6. Type sudo mount -a to mount the HDD and type df -h to check it is work

Install VMWare Workstation Player

  1. Visit VMWare Workstation Player official website and download the latest .bundle file of VMWare Workstation Player
  2. Open a terminal(Ctrl + Alt + T), change a path to download folder, and type sudo sh <VMWARE_WORKSTATION_PLAYER_BUNDLE_NAME>.bundle

Terminal font setting

  1. Open a terminal(Ctrl + Alt + T)
  2. Type sudo apt install fonts-nanum-coding -y
  3. Select installed font at terminal's preferences

Key binding

  1. Open a terminal(Ctrl + Alt + T)
  2. Type sudo apt install gnome-tweak-tool -y
  3. Press super, type Tweaks, and select Tweaks to run
  4. Select a menu Keyboard & Mouse and push a button Additional Layout Options
  5. Select a menu Ctrl position and check an option Swap Left Alt with Left Ctrl

IBus setting

  1. Press super, type Region & Language, and select Region & Language to run
  2. Push a button Manage installed Languages
  3. Push a button Install / Remove Languages... add Korean, and reboot
  4. Press super, type Region & Language, and select Region & Language
  5. Push a button + and add Korean(Hangul)
  6. Change Keyboard input method system to IBus
  7. Open a terminal(Ctrl + Alt + T) and type ibus-setup
  8. Select a tab Input Method and click a button Add
  9. Type Korean to search Korean-Hangul and select Korean-Hangul to run
  10. On terminal, type ibus-setup-hangul
  11. Push a button Add at Hangul Toggle Key section
  12. Press LCTL + SPACE and push a button OK

Vim setting

  1. Open a terminal(Ctrl + Alt + T) and type sudo apt update && sudo apt install vim-gtk -y
  2. Type vim ~/.vimrc and set vimrc like below:
set number
syntax on
set softtabstop=2
set tabstop=2
set shiftwidth=2
set expandtab
colorscheme desert

filetype indent on
filetype plugin indent on

if system('uname -s') == "Darwin\n"
  set clipboard=unnamed "OSX
else
  set clipboard=unnamedplus "Linux
endif

Install Clang and gdb

  1. Open a terminal(Ctrl + Alt + T)
  2. Type sudo apt update && sudo apt install clang gdb -y

Install CMake

  1. Open a terminal(Ctrl + Alt + T) and type sudo apt install libssl-dev wget make -y
  2. Visit CMake official website and copy the download link of the latest version of CMake
  3. On terminal, type wget COPY_LINK (e.g. wget https://github.com/Kitware/CMake/releases/download/v3.22.0/cmake-3.22.0.tar.gz)
  4. Type tar -xvf cmake*.tar.gz, type rm cmake*.tar.gz, and type cd cmake*
  5. Type ./bootstrap, type make -j$((`nproc`+1)), and type sudo make install

Install cpplint

  1. Open a terminal(Ctrl + Alt + T) and type sudo apt update && sudo apt install python3-pip -y
  2. Type pip3 install --user cpplint
  3. Get cpplint's path (e.g. pwd on terminal) and make a symbolic link to /usr/bin(e.g. sudo ln -s /home/USER_NAME/.local/bin/cpplint /usr/bin)

Install nodejs

curl -sL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo apt-get install -y nodejs
node -v
npm -v

Install clang-format-19

wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 17
sudo apt install clang-format-17 -y

Install java-17

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install -y openjdk-17-jdk
java -version

Install GoogleTest

  1. Open a terminal(Ctrl + Alt + T) and type sudo apt update && sudo apt-get install libgtest-dev -y
  2. Install CMake
  3. Type cd /usr/src/gtest, type sudo cmake CMakeLists.txt, and type sudo make
  4. Type sudo cp *.a /usr/lib

Install Git

  1. Open a terminal(Ctrl + Alt + T)
  2. Type sudo apt-get update && sudo apt install git -y
  3. Type git config --global user.name "<USER_NAME>"
  4. Type git config --global user.email <USER_ID@example.com>
  5. Type cd ~/.ssh, type ssh-keygen -t rsa -b 4096 -C "<USER_ID@example.com>", and type ENTER until the progress is done(If you want to get randomart image again later, type ssh-keygen -lv)
  6. Copy whole content of id_rsa.pub(e.g. ssh-rsa AA ... == USER_ID@example.com) and add a new SSH key to your GitHub account

Install Visual Studio Code

  1. Visit Visual Studio Code official website and download .deb file
  2. Open a terminal(Ctrl + Alt + T), change a path to download folder and type sudo apt install ./FILE_NAME.deb -y
@RyanJeong
Copy link
Author

@RyanJeong
Copy link
Author

samba

sudo apt-get install iptables

sudo ufw allow 139/tcp
sudo ufw allow 1139/tcp
sudo ufw allow 445/tcp
sudo ufw allow 1445/tcp

sudo iptables -t nat -A PREROUTING -p tcp --dport 1139 -j REDIRECT --to-port 139
sudo iptables -t nat -A PREROUTING -p tcp --dport 1445 -j REDIRECT --to-port 445

sudo apt-get install iptables-persistent
sudo netfilter-persistent save

sudo iptables -t nat -L

@RyanJeong
Copy link
Author

nvidia docker

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker

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