Skip to content

Instantly share code, notes, and snippets.

@AffanIndo
Last active January 6, 2020 16:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AffanIndo/a95921b7139f2965401d637ca4acba2a to your computer and use it in GitHub Desktop.
Save AffanIndo/a95921b7139f2965401d637ca4acba2a to your computer and use it in GitHub Desktop.
pacman: sudo pacman -Syu PACKAGENAME # install (and update package list)
sudo pacman -S PACKAGENAME # install
pacman -Ss PACKAGENAME # search
pacman -Si PACKAGENAME # info about package
pacman -Qs PACKAGENAME # search installed package
pacman -Qi PACKAGENAME # info about installed package
pacman -Ql PACKAGENAME # list all installed package
sudo pacman -R PACKAGENAME # normal remove
sudo pacman -Rsn PACKAGENAME # remove package, dependencies, and backup configuration files
pacman -Qdt # list orphans
sudo pacman -Rs $(pacman -Qdt) # remove orphans
apt: sudo apt-get install PACKAGENAME # install
sudo apt-get update # update package list
sudo apt-get updgrade # upgrade everything
sudo apt-get --purge remove PACKAGENAME # normal remove
sudo apt-get remove PACKAGENAME # remove but not the configuration files
sudo apt-get autoremove # remove any unused packages
sudo apt-get --purge autoremove PACKAGENAME # remove package and the configuration files too
sudo apt-get purge --autoremove PACKAGENAME # remove package and the configuration files too
apt-cache search PACKAGENAME # search
sudo apt-get clean # clean cached deb
youtube-dl: youtube-dl LINK # normal download
youtube-dl --embed-subs LINK # embed the subs
youtube-dl --all-subs LINK # download subs as separate file
youtube-dl -F LINK # list all available formats and quality
youtube-dl -f NUMBER LINK # download the format/quality specified, don't select DASH
youtube-dl --no-playlist LINK # download the video only if the video is in playlist
git: git clone <git url> # membuat local repository dari online repositorty
git add . # memasukkan semua file agar siap untuk dicommit
git commit -m "MESSAGE" # commit local dengan message
git push # push local repo ke online repo
git pull # update local repo dari online repo
git branch # list kan branch yang ada
git checkout -b <branch name> # membuat branch baru
git branch -d branch_name # mendelete branch
git push -u origin <branchname> # push branch ke master di online
git push origin --delete <branchname> # mendelete branch online
git reset --hard HEAD~1 # buang commit ini jadi load commit sebelumnya
wine: wine # menjalankan wine
winecfg # wine configuration
winetricks # menginstall windows additional library
virtualenv: virtualenv -p /usr/bin/python3 py3env # menjalankan virtualenv dengan sumber python (-p) dari
# /usr/bin/python3 dengan nama folder py3env
source py3env/bin/activate # mengaktifasi virtual env dengan command source ke file activate
pip install PACKAGENAME # menginstall package dengan pip
deactivate # mematikan virtual env
pip freeze > requirements.txt # list aplikasi yang ddiinstall oleh pip, lalu output ke requirements.txt
pip uninstall -r requirements.txt # pip uninstall recursively file2 yang ada pada requirements.txt
rm -r py3env # menghapus folder virtualenv py3env
xdotool: xdotool key XF86MonBrightnessUp # increase brightness
xdotool key XF86MonBrightnessDown # decrease brightness
mplayer: q # quit
p # pause
up arrow # jump forward in file more
right arrow # jump forward in file less
down arrow # jump back in file more
left arrow # jump back in file less
0 # volume up
9 # volume down
m # volume mute
f # full screen
o # on-screen display
v # toggle subtitles
I # show file name
mplayer *.mp3 # play all *.mp3 files
mplayer -playlist <(find "$PWD" -type f) # search all mp3 files then play all of them as playlist
tmux: # use this with my dotfiles config
<prefix> - # split to the bottom
<prefix> \ # split to the right
<prefix> <C-h> # resize pane
<prefix> <C-j> # resize pane
<prefix> <C-k> # resize pane
<prefix> <C-l> # resize pane
<prefix> h # change active pane
<prefix> j # change active pane
<prefix> k # change active pane
<prefix> l # change active pane
<prefix> x # kill pane
<prefix> & # kill window
<prefix> c # create window
<prefix> n # next window
<prefix> N # previous window
<prefix> [1234567890] # select window
<prefix> T # hide bottom panel
<prefix> , # rename window
<prefix> $ # rename session
<prefix> z # fullscreen pane
<prefix> ! # break pane into several windows
<previx> <C-o> # rotate pane
:swap-window -s X -t Y # swap the position of tab X and Y
npm & yarn: npm install === yarn # install stuff from package.json
npm install taco --save === yarn add taco # install then put taco in package.json
npm install taco@latest --save === yarn add taco # same thing
npm uninstall taco --save === yarn remove taco # remove then remove taco in package.json
package.json is default in Yarn.
npm install taco --save-dev === yarn add taco --dev # install then put taco in dev dependencies
npm update --save === yarn upgrade # update all packages. never use the npm because it is broken
npm install taco --global === yarn global add taco # be careful with global installing
npm init === yarn init
npm link === yarn link
npm outdated === yarn outdated
npm publish === yarn publish
npm run === yarn run
npm cache clean === yarn cache clean
npm login === yarn login # and logout
npm test === yarn test
npm install --production === yarn --production
mount external drive: sudo fdisk -l # list all available drives
sudo mkdir /media/drive # create mount folder
sudo mount /dev/sdb1 /media/drive # mount
snap: sudo snap find PACKAGENAME # list the available packages
sudo snap install PACKAGENAME # install a package
sudo snap list # view all the installed snap packages
sudo snap refresh PACKAGENAME # upgrade a package to its latest available version
sudo snap refresh # upgrade all packages
sudo snap refresh --list # view all package that can be updated
sudo snap revert PACKAGENAME # undo update
sudo snap changes # view a list of logged actions
sudo snap remove PACKAGENAME # uninstall a package
i3: mod+shift+e # logout
mod-shift-c # reload config
i3-msg-reload
mod+shift+r # restart all services
i3-msg restart
mod+enter # open terminal
mod+j/k/l/; # change focus
mod+shift+h/j/k/l # move window
mod+up/down/left/right
mod+r # resize mode
mod+f # toggle fullscreen
mod+v # split to the right
mod+h # split to the bottom
mod+space # toggle floating
mod+drag # drag floating
mod+[1234567890] # switch workspace
mod+shift+[1234567890] # send app to another workspaceA
mod+shift+q # kill app
mod+d # open dmenu
mod+e # default view
mod+s # stack view
mod+w # tabbed view
nmcli: nmcli con show # list all available wireless devices
nmcli con show -a # list only available wireless devices
nmcli device disconnect DEVICENAME # disconnect
nmcli device connect DEVICENAME # connect
systemd: systemctl list-unit-files # list all services
systemctl list-unit-files | grep enabled # list all enabled services
systemctl enable SERVICE # enable means start it now and forever
systemctl start SERVICE # start means start it just for now and stop it when reboot
scrot: scrot # screenshot fullscreen instantly then save to current folder
scrot -u # screenshot current window
scrot -ub # screenshot current window and include border
scrot -s # screenshot selected window
scrot /home/path/path # screenshot then save it to the path
scrot -e 'mv $f ~/path/to/destination' # screenshot then save it to the path
scrot -d 5 # delay 5 seconds
scrot --delay 5 # delay 5 seconds
scrot -u -d 5 -c # screenshot current window but delay 5 second and do countdown
chown: sudo chown USERNAME: * # change ownership from root to USERNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment