Skip to content

Instantly share code, notes, and snippets.

@msutter
Last active March 11, 2018 08:55
Show Gist options
  • Save msutter/4d7f55226d2d779cbec77b9eea3e76b3 to your computer and use it in GitHub Desktop.
Save msutter/4d7f55226d2d779cbec77b9eea3e76b3 to your computer and use it in GitHub Desktop.
description
[[snippets]]
description = "Create a .keep file in all empty directories"
command = "find . -type d -empty -print0 | xargs -0 -I % touch %/.keep"
output = ""
[[snippets]]
description = "Display all listen port"
command = "lsof -Pan -i tcp -i udp"
output = ""
[[snippets]]
description = "Process with the largest memory usage"
command = "ps aux | sort -nrk +4 | head -n 1"
output = ""
[[snippets]]
description = "Top 10 IP address with the number of occurrences"
command = "tail -10000 access_log | cut -f 1 -d ' ' | sort | uniq -c | sort -nr | head -10"
output = ""
[[snippets]]
description = "All file rename (01.txt -> 01.md)"
command = "ls | sed -e s/\\.txt// | awk '{print .txt .md}' | xargs -n 2 mv"
output = ""
[[snippets]]
description = "Display prime numbers"
command = "seq 1 100 | perl -lne 'print if (1x$_) !~ /^1?$|^(11+?)\\1+$/'"
output = ""
[[snippets]]
description = "Descending order of line length"
command = "awk '{print length($0), $0}' sample.txt | sort -nr | head"
output = ""
[[snippets]]
description = "Check expiration date of SSL certficate"
command = "echo | openssl s_client -connect example.com:443 2> /dev/null | openssl x509 -dates -noout"
output = ""
[[snippets]]
description = "Get my global IP address"
command = "curl ifconfig.co"
output = ""
[[snippets]]
description = "Connect to redhat openshift host fra15 remote sublime (training)"
command = "ssh -i ~/.ssh/fra15key -R 52698:localhost:52698 ec2-user@bastion.fra15.example.opentlc.com"
output = ""
[[snippets]]
description = "Delete remote branch"
command = "git push origin --delete ${BTD}"
output = ""
[[snippets]]
description = "Delete local branch"
command = "git branch -D ${BTD}"
output = ""
[[snippets]]
description = "Get jenkins test users creds"
command = "pass c2c_mgmtsrv/freeipa/jenkins-test-users"
output = ""
[[snippets]]
description = "list by size"
command = "du -hs * | gsort -h"
output = ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment