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
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
assafmo / unmount.sh
Created Feb 19, 2019
Safely unmount disk on ubuntu
View unmount.sh
#!/bin/bash
DEV=$(mount | grep /media/ | awk '{print $1}')
udisksctl unmount -b "$DEV"
udisksctl power-off -b "$DEV"
@assafmo
assafmo / csv
Last active Feb 28, 2019
Handle CSV files with awk
View csv
gawk -v FPAT=\'[^,]*|"[^"]*"\' '{print $3}' < test.csv
@assafmo
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
assafmo / url_to_pdf.sh
Last active Dec 27, 2018
Use headless chrome to print a page to pdf
View url_to_pdf.sh
#!/bin/bash
google-chrome --headless --disable-gpu --print-to-pdf="$PDF_NAME" "$URL"
@assafmo
assafmo / client.sh
Last active Dec 30, 2018
SSH Over TOR (Good for any service, also to expose a server behind NAT)
View client.sh
#!/bin/bash
sudo apt install -y tor
# get hostname from /var/lib/tor/ssh/hostname on the server
torsocks ssh user@xxxxyyyyzzzzaaaa.onion
@assafmo
assafmo / bluetooth_off.sh
Created Dec 13, 2018
Turn Bluetooth off on Linux
View bluetooth_off.sh
#!/bin/bash
rfkill block bluetooth
@assafmo
assafmo / fstab
Last active Dec 13, 2018
Mount /tmp as tmpfs
View fstab
# https://blog.ubuntu.com/2016/01/20/data-driven-analysis-tmp-on-tmpfs
# In /etc/fstab:
tmpfs /tmp tmpfs rw,size=128m,noexec,nosuid 0 0
@assafmo
assafmo / rescan_hd.sh
Created Dec 12, 2018
Rescan hard drives without rebooting
View rescan_hd.sh
#!/bin/bash
echo "- - -" > sudo tee /sys/class/scsi_host/*/scan
@assafmo
assafmo / sysctl.conf
Created Dec 12, 2018
set BBR for TCP
View sysctl.conf
# put in /etc/sysctl.conf
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
You can’t perform that action at this time.