Skip to content

Instantly share code, notes, and snippets.

@matiwinnetou
Last active November 15, 2019 09:35
Show Gist options
  • Save matiwinnetou/36fd9f469305a772ba3033623c8efc47 to your computer and use it in GitHub Desktop.
Save matiwinnetou/36fd9f469305a772ba3033623c8efc47 to your computer and use it in GitHub Desktop.
description
[[snippets]]
description = "ssh inet kokosz"
command = "ssh -A root@kokosz.nerdpol.ovh"
output = ""
[[snippets]]
description = "git fetch all"
command = "git fetch --all"
output = ""
[[snippets]]
description = "git fetch origin && git rebase origin/master"
command = "git fetch origin && git rebase origin/master"
output = ""
[[snippets]]
description = "ssh -A teofil"
command = "ssh -A mati@pirx.nerdpol.ovh"
output = ""
[[snippets]]
description = "git ls"
command = "git log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate"
output = ""
[[snippets]]
description = "git ll"
command = "git log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate --numstat"
output = ""
[[snippets]]
description = "osx dns clear"
command = "sudo killall -HUP mDNSResponder"
output = ""
[[snippets]]
description = "get my public IP Address"
command = "curl ipecho.net/plain ; echo"
output = ""
[[snippets]]
description = "shuttle-kokosz"
command = "sshuttle -H -r root@kokosz.nerdpol.ovh 192.168.1.0/24"
output = ""
[[snippets]]
description = "all ports we listen on"
command = "netstat -tulanp"
output = ""
[[snippets]]
description = "remove all merged branches"
command = "git branch --merged | grep -v '*' | xargs -n 1 git branch -d"
output = ""
[[snippets]]
description = "git reset soft/hard to origin master"
command = "git reset --hard origin/master"
output = ""
[[snippets]]
description = "git list local branches"
command = "git branch -lvv"
output = ""
[[snippets]]
description = "disk usage"
command = "du -h -d1"
output = ""
[[snippets]]
description = "new tmux session"
command = "tmux new-session -s new_session"
output = ""
[[snippets]]
description = "tmux attach"
command = "tmux attach -t new_session"
output = ""
[[snippets]]
description = "tmux ls"
command = "tmux ls"
output = ""
[[snippets]]
description = "tmux kill-session -s"
command = "tmux kill-session -s new_session"
output = ""
[[snippets]]
description = "brew update"
command = "brew update && brew upgrade && brew cleanup && brew cask upgrade"
output = ""
[[snippets]]
description = "random password"
command = "openssl rand -base64 20"
output = ""
[[snippets]]
description = "generate numeric wifi passwords 8 chars only"
command = "crunch 8 8 chars=0123456789"
output = ""
[[snippets]]
description = "create tar archive"
command = "tar cvf archive.tar ./"
output = ""
[[snippets]]
description = "extract tar archive"
command = "tar xvf archive.tar"
output = ""
[[snippets]]
description = "list boots"
command = "journalctl --list-boots"
output = ""
[[snippets]]
description = "ssh local jaga"
command = "ssh root@jaga"
output = ""
[[snippets]]
description = "opkg update && opkg upgrade"
command = "opkg update && opkg upgrade"
output = ""
[[snippets]]
description = "tincd launch matiz"
command = "sudo tincd -n matiz -D"
output = ""
[[snippets]]
description = "sshfs kokosz toshiba"
command = "sshfs root@192.168.1.1:/mnt/toshiba /Users/mati/mount/kokosz-toshiba"
output = ""
[[snippets]]
description = "kokosz certificate valid"
command = "echo | openssl s_client -connect kokosz.nerdpol.ovh:8081 2>/dev/null | openssl x509 -dates -noout"
output = ""
[[snippets]]
description = "yarn upgrade interactive"
command = "yarn upgrade-interactive"
output = ""
[[snippets]]
description = "ab 10 clients each 100 requests with keep alive"
command = "ab -k -c <no_users=10> -n <reqs=100> -t <time_secs=30> <protocol=http>://<host=localhost>:<port=8080><path=/>"
output = ""
[[snippets]]
description = "ab 2 10 clients each 100 requests with keep alive"
command = "ab -k -c <no_users=10> -n <reqs=100> -t <time_secs=30> \"<url=http://localhost:8080/>\""
output = ""
[[snippets]]
description = "osx list all apps from AppStore"
command = "mdfind kMDItemAppStoreHasReceipt=1"
output = ""
[[snippets]]
description = "yarn install"
command = "yarn install"
output = ""
[[snippets]]
description = "osx load tincd"
command = "sudo launchctl load -w /Library/LaunchDaemons/matiz.tinc.plist"
output = ""
[[snippets]]
description = "osx unload tincd"
command = "sudo launchctl unload -w /Library/LaunchDaemons/matiz.tinc.plist"
output = ""
[[snippets]]
description = "gradlew ben-manes dependency check"
command = "./gradlew dependencyUpdates"
output = ""
[[snippets]]
description = "git commit next and push"
command = "git commit -m \"next\" && git push"
output = ""
[[snippets]]
description = "docker-machine start"
command = "docker-machine start"
output = ""
[[snippets]]
description = "docker machine env"
command = "eval $(docker-machine env)"
output = ""
[[snippets]]
description = "git rebase continue"
command = "git rebase --continue"
output = ""
[[snippets]]
description = "curl post request example (insecure)"
command = "curl -v -k --data \"<params=param1=value1&param2=value2>\" <url=https://localhost:4443/fahrzeuge/surveyData>"
output = ""
[[snippets]]
description = "git branch set upstream"
command = "git branch -u <fork=mszczap>/<branch=master>"
output = ""
[[snippets]]
description = "git branch delete local and remote"
command = "git branch -D <branch_name> && git push --delete mszczap <branch_name>"
output = ""
[[snippets]]
description = "git remote delete branch"
command = "git push --delete <fork=mszczap> <branch=apache-rewrite-seo-part>"
output = ""
[[snippets]]
description = "curl simple http bench"
command = "for i in {1..3}; curl -s -w \"%{time_total}\\n\" -o /dev/null <url=http://localhost:8080/>"
output = ""
[[snippets]]
description = "brew output command version"
command = "brew list nvm | head -n 1 | cut -d '/' -f"
output = ""
[[snippets]]
description = "git apply trick"
command = "git apply <(git diff --binary origin/master..<fork=origin>/<branch=branch-1>)"
output = ""
[[snippets]]
description = "git remote add matiwinnetou git@github.com:matiwinnetou/swagger-play24.git"
command = "git remote add matiwinnetou git@github.com:matiwinnetou/swagger-play24.git"
output = ""
[[snippets]]
description = "git branch --unset-upstream"
command = "git branch --unset-upstream"
output = ""
[[snippets]]
description = "git clean -f -d"
command = "git clean -f -d"
output = ""
[[snippets]]
description = "pacman-mirrors for Germany"
command = "sudo pacman-mirrors -c Germany"
output = ""
[[snippets]]
description = "jps with fzf with gc.run"
command = "jcmd `jps | fzf | awk {'print $1}'` <command=help>"
output = ""
[[snippets]]
description = "delete remote mszczap branch"
command = "git branch -r | grep \"mszczap\" | sed -e 's/mszczap\\///g' | fzf | xargs git push mszczap --delete"
output = ""
[[snippets]]
description = "delete remote origin branch"
command = "git branch -r | grep \"origin\" | sed -e 's/origin\\///g' | fzf | xargs git push origin --delete"
output = ""
[[snippets]]
description = "delete local branch"
command = "git branch -l | fzf | xargs git branch -D"
output = ""
[[snippets]]
description = "git stash and rebase master stash pop"
command = "git stash && git rebase origin/master && git stash pop"
output = ""
[[snippets]]
description = "java pid killer"
command = "kill -9 `jps | fzf | awk {'print $1}'`"
output = ""
[[snippets]]
description = "debian check version"
command = "lsb_release -da"
output = ""
[[snippets]]
description = "osx vpn kokosz up"
command = "sudo launchctl load -w /Library/LaunchDaemons/matiz.tinc.plist"
output = ""
[[snippets]]
description = "osx vpn kokosz down"
command = "sudo launchctl unload -w /Library/LaunchDaemons/matiz.tinc.plist"
output = ""
[[snippets]]
description = "linux which options can be set on module"
command = "modinfo -p i915"
output = ""
[[snippets]]
description = "linux module which options are set"
command = "systool -m i915 -av"
output = ""
[[snippets]]
description = "linux module enable setting"
command = "sudo modprobe i915 enable_psr=0"
output = ""
[[snippets]]
description = "linux manjaro nvidia settings"
command = "optirun -b none nvidia-settings -c :8"
output = ""
[[snippets]]
description = "linux geth fast console"
command = "geth --verbosity 0 --fast --cache=512 console"
output = ""
[[snippets]]
description = "ethereum eth mining"
command = "eth -m on -G -a 0x234Cd16E533EEd6D2cE81AF811Ad6645767F3ec2 -i -v 8 //"
output = ""
[[snippets]]
description = "linux journalctrl last boot"
command = "journalctl --boot=-1"
output = ""
[[snippets]]
description = "linux journalctrl errors on last boot"
command = "journalctl --boot=-1 -p err"
output = ""
[[snippets]]
description = "linux systemd analyze blame"
command = "systemd-analyze blame"
output = ""
[[snippets]]
description = "linux journalctrl for program (unit)"
command = "journalctl -u ntpd.service"
output = ""
[[snippets]]
description = "linux errors on last boot"
command = "journalctl -b -p err"
output = ""
[[snippets]]
description = "linux journalctrl disk usage"
command = "journalctl --disk-usage"
output = ""
[[snippets]]
description = "linux journalctrl flush journal 1 month"
command = "sudo journalctl --vacuum-time=1months"
output = ""
[[snippets]]
description = "linux journalctrl list servies"
command = "systemctl list-units --type=service"
output = ""
[[snippets]]
description = "linux list units timer"
command = "systemctl list-units --type=timer"
output = ""
[[snippets]]
description = "docker run -ti strayge/alpine-py3-numpy-scipy /bin/sh"
command = "linux docker run bin sh"
output = ""
[[snippets]]
description = "docker remove old containers"
command = "docker container prune"
output = ""
[[snippets]]
description = "docker remove old dangling resources"
command = "docker system prune"
output = ""
[[snippets]]
description = "systemd analyze critical chain"
command = "systemd-analyze critical-chain"
output = ""
[[snippets]]
description = "docker build based on custom docker file"
command = "docker build -f Dockerfile.linux ."
output = ""
[[snippets]]
description = "linux list video hardware"
command = "sudo lshw -C video"
output = ""
[[snippets]]
description = "linux software brightness"
command = "xrandr --output eDP1 --brightness .4"
output = ""
[[snippets]]
description = "linux show all xorg input devices"
command = "sudo xinput"
output = ""
[[snippets]]
description = "manjaro start one getty manually"
command = "systemctl start getty@tty1.service"
output = ""
[[snippets]]
description = "linux systemctl list targets"
command = "systemctl list-units --type=target"
output = ""
[[snippets]]
description = "linuc clean pacman cache"
command = "sudo pacman -Sc"
output = ""
[[snippets]]
description = "linux nvidia monitor cpu usage"
command = "watch -n 1 nvidia-smi"
output = ""
[[snippets]]
description = "linux nvidia gpustats"
command = "watch --color -n1.0 gpustat"
output = ""
[[snippets]]
description = "manjaro list video drivers"
command = "inxi -G"
output = ""
[[snippets]]
description = "dbus monitor system"
command = "sudo dbus-monitor --system"
output = ""
[[snippets]]
description = "linux list block devices"
command = "lsblk"
output = ""
[[snippets]]
description = "git remove non tracked files"
command = "git clean -f -d"
output = ""
[[snippets]]
description = "hey http scalability test"
command = "hey -c 20 -n 20 <url:http://localhost:8080>"
output = ""
[[snippets]]
description = "linux pacman optimize"
command = "sudo pacman-optimize"
output = ""
[[snippets]]
description = "linux systemd faied"
command = "sudo systemctl --failed"
output = ""
[[snippets]]
description = "linux mkinitcpio for all kernels"
command = "sudo mkinitcpio -P"
output = ""
[[snippets]]
description = "arch reflector rank mirrors"
command = "reflector --country Germany --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlis"
output = ""
[[snippets]]
description = "debstrap ubuntu zesty container"
command = "debootstrap --arch=amd64 zesty /var/lib/machines/boinc/ http://archive.ubuntu.com/ubuntu/"
output = ""
[[snippets]]
description = "pacman clear cache"
command = "pacman -Scc"
output = ""
[[snippets]]
description = "find linux largest files"
command = "du -a / | sort -n -r | head -n 10"
output = ""
[[snippets]]
description = "nmap ssh server scan"
command = "nmap -p 22 --open -sV 192.168.1.0/24"
output = ""
[[snippets]]
description = "dig query dns server"
command = "dig @192.168.100.1 www.onet.pl"
output = ""
[[snippets]]
description = "pip update all dependencies"
command = "pip freeze --local | grep -v '^\\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
output = ""
[[snippets]]
description = "j2v8 osx build"
command = "python build.py -t macos -a x64"
output = ""
[[snippets]]
description = "gpg import key"
command = "gpg --recv-key <key=702353E0F7E48EDB>"
output = ""
[[snippets]]
description = "update all python modules"
command = "pip freeze --local | grep -v '^\\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
output = ""
[[snippets]]
description = "git tag - create a new git tag"
command = "git tag -a \"my tag\" -m \"my tag\""
output = ""
[[snippets]]
description = "git tag list tags"
command = "git tag -l"
output = ""
[[snippets]]
description = "git push tags to remote"
command = "git push --tags"
output = ""
[[snippets]]
description = "generate random password"
command = "openssl rand -base64 16 | colrm 17"
output = ""
[[snippets]]
description = "gpg --recv-keys 8F0871F202119294"
command = "gpg --recv-keys 8F0871F202119294"
output = ""
[[snippets]]
description = "mvn display new versions"
command = "mvn versions:display-plugin-updates"
output = ""
[[snippets]]
description = "kafka reset consumer group"
command = "kafka-consumer-groups --group kpi-cassandra-realtime-indexer --topic xdc_mobile-ad-log-v3 --reset-offsets --to-earliest"
output = ""
[[snippets]]
description = "ebay stock value"
command = "curl --silent \"https://query1.finance.yahoo.com/v7/finance/quote?region=US&corsDomain=finance.yahoo.com&symbols=EBAY\" | jq \".quoteResponse .result[0].regularMarketPrice\""
output = ""
[[snippets]]
description = "Szczecin za m2"
command = "curl --silent \"https://kokosz.nerdpol.ovh:8086/\" | jq \".\""
output = ""
[[snippets]]
description = "brew cask list"
command = "brew search --casks --desc ''"
output = ""
[[snippets]]
description = "git get short sha1"
command = "git rev-parse --short <long_sha>"
output = ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment