Skip to content

Instantly share code, notes, and snippets.

@snowmanunderwater
snowmanunderwater / after_install
Last active April 7, 2020 10:53
script for setup xubuntu 20.04 after install
#!/usr/bin/bash
# script for setup xubuntu 20.04 after install
USER=$(whoami)
rm -rf ~/Public ~/Templates
mkdir ~/.local/bin ~/.fonts
BEFORE=$(dpkg-query -f '${binary:Package}\n' -W | wc -l)
@snowmanunderwater
snowmanunderwater / tmux-cheatsheet.markdown
Created December 3, 2019 12:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
# create tmux
$ tmux new-session -s NAME
# detach from tmux
^b d
# attach to tmux
$ tmux attach -t NAME
# create new window
@snowmanunderwater
snowmanunderwater / latency.txt
Created August 7, 2019 14:33 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD

VSCode: Open directory from integrated terminal.

code -r .

xclip

  1. pwd | xclip copy to primary
  2. pwd | xclip -selection clipboard copy to clipboard (Ctrl+C, Ctrl+V)
  3. xclip -selection clipboard -f FILENAME copy from FILE
  4. xclip -o paste from primary