python -c 'import pty; pty.spawn("/bin/bash")'
socat file:`tty`,raw,echo=0 tcp-listen:4444
import cProfile | |
import pstats | |
from io import StringIO | |
def print_profile(f): | |
""" | |
Wrap a function with this decorator to obtain profiling information; | |
the output of cProfile is sent to a logger called 'profile'. |
set -g history-limit 1000000 | |
set -g allow-rename off | |
# Join windows | |
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'" | |
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'" | |
# split panes using | and - | |
bind | split-window -h | |
bind - split-window -v |
sudo lsblk | |
sudo growpart /dev/[DEVICE_ID] [PARTITION_NUMBER] | |
sudo resize2fs /dev/[DEVICE_ID][PARTITION_NUMBER] |
# !/bin/bash | |
# | |
# greplines.sh | |
# Grep all lines from first to last occurrence of <pattern> in <file> | |
# | |
if [ "$#" -lt 2 ]; then | |
echo "usage: $0 <pattern> <file> [-v]" | |
exit | |
fi |
ctrl+x+e
Open an editor for writing a large command
mount -t tmpfs tmpfs <folder> -o size=8192M
Mounts a temporary RAM disk to folder. Useful for temp files with very high speed.
tee -a <file>
Captures stdout and writes it to <file>
disown -a && exit
Closes the terminal without stopping running commands
sudo du -a / 2>/dev/null | sort -n -r | head -n 20
Find the 20 largest files in linux