Skip to content

Instantly share code, notes, and snippets.

Assaf Morami assafmo

Block or report user

Report or block assafmo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
assafmo /
Created Nov 24, 2019
jq process only valid JSONs
cat some.log | jq -R 'fromjson? | .date'
assafmo /
Last active Dec 18, 2019
Setup a new ubuntu machine for performance
set -e
# CPU scaling_governor=performance
printf 'Setting scaling_governor to performance... '
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor > /dev/null
assafmo /
Created Jul 17, 2019
Easticsearch + Kibana on docker
docker pull
docker pull
docker run --name some-elastic -e 'discovery.type=single-node' -d --restart always -p 9200:9200
docker run --name some-kibana -d --restart always --link some-elastic:elasticsearch -p 5601:5601
assafmo /
Last active Jun 7, 2019
Fish shell configs
# ~/.config/fish/
set -gx GOPATH /home/lala/workspace/go
set -gx PATH $PATH /usr/local/go/bin $GOPATH/bin
function fish_prompt
set_color --bold $fish_color_cwd
echo -n (prompt_pwd)
set_color normal
echo -n ' > '
ssh -D 1080 -N user@proxy-server & # The & won't work with password authentication
curl -x socks5://localhost:1080
assafmo / config
Created Mar 13, 2019
i3wm config
View config
# WinKey
set $mod Mod4
# Set resulotion
exec "xrandr --output eDP-1 --mode 1600x900"
# Set background
exec "feh --bg-fill /home/assafmo/Pictures/Wallpapers/IMG_20180929_063914.jpg"
# Natural scrolling (xinput list -> get device id -> xinput list-props $id -> get libinput Natural Scrolling Enabled id)
assafmo /
Created Feb 19, 2019
Safely unmount disk on ubuntu
DEV=$(mount | grep /media/ | awk '{print $1}')
udisksctl unmount -b "$DEV"
udisksctl power-off -b "$DEV"
assafmo / csv
Last active Feb 28, 2019
Handle CSV files with awk
View csv
gawk -v FPAT=\'[^,]*|"[^"]*"\' '{print $3}' < test.csv
assafmo / ssh_config
Last active Dec 30, 2018
SSH Multiplexing
View ssh_config
# Put in ~/.ssh/config
Host *
ControlMaster auto
ControlPath ~/.ssh/%r@%h:%p
ControlPersist yes
ServerAliveInterval 30
assafmo /
Last active Dec 27, 2018
Use headless chrome to print a page to pdf
google-chrome --headless --disable-gpu --print-to-pdf="$PDF_NAME" "$URL"
You can’t perform that action at this time.