Skip to content

Instantly share code, notes, and snippets.

@xiao0yy
xiao0yy / f.zsh
Created February 24, 2020 03:18
tmux in ssh/mosh
sst() {
prune_str=${1#*@}
formatted=$prune_str[-8,$#prune_str]
/usr/bin/ssh -t "$@" "LANG=$LANG tmux new -A -s $formatted"
}
mot() {
prune_str=${1#*@}
formatted=$prune_str[-8,$#prune_str]
/usr/local/bin/mosh "$@" -- tmux new -A -s $formatted
@xiao0yy
xiao0yy / npm-g-u.sh
Created October 20, 2017 06:52
Npm Global Update
npm -g outdated | awk 'NR != 1 {print $1"@"$3}' | xargs npm -g i
@xiao0yy
xiao0yy / gist:196385873c3c105f00a93742775dbaff
Created August 7, 2017 09:50 — forked from khakimov/gist:3558086
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'