Last active
September 18, 2020 08:09
-
-
Save ankurloriya/61c95a00ad8c3f6bf754a3913a0fe818 to your computer and use it in GitHub Desktop.
description
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[snippets]] | |
description = "Ping Google DNS" | |
command = "ping 8.8.8.8" | |
tag = ["network", "tool", "ping", "test", "dns", "google"] | |
output = "" | |
[[snippets]] | |
description = "Ping" | |
command = "ping <ip>" | |
tag = ["network", "tool", "ping", "test"] | |
output = "" | |
[[snippets]] | |
description = "Run GTK application in sudo mode" | |
command = "gksudo <app>" | |
tag = ["sudo", "gtk", "runas"] | |
output = "" | |
[[snippets]] | |
description = "List lisining ports with proccess" | |
command = "sudo netstat -ntlvp" | |
tag = ["network", "tool", "port"] | |
output = "" | |
[[snippets]] | |
description = "Domain Revers lookup" | |
command = "dig <ip>" | |
tag = ["network", "tool", "ip", "domain", "lookup", "revers"] | |
output = "" | |
[[snippets]] | |
description = "Get current kernel name and arch" | |
command = "uname -mrs" | |
tag = ["kernel", "linux", "name", "architecture"] | |
output = "" | |
[[snippets]] | |
description = "Get list of installed kernels" | |
command = "dpkg -l | grep \"linux\\-image\" | awk '{print $3}' | sort | uniq" | |
tag = ["kernel", "list"] | |
output = "" | |
[[snippets]] | |
description = "List of current kernel modules" | |
command = "find /lib/modules/$(uname -r) -type f -name '*.ko'" | |
tag = ["kernel", "module", "list", "linux"] | |
output = "" | |
[[snippets]] | |
description = "HDD temperature" | |
command = "hddtemp /dev/sda" | |
tag = ["hdd", "temperature", "heat", "monitor"] | |
output = "" | |
[[snippets]] | |
description = "CPU / Core temperatures" | |
command = "sensors" | |
tag = ["temperature", "heat", "monitor", "cpu"] | |
output = "" | |
[[snippets]] | |
description = "Current LAN IP address" | |
command = "ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d '/'" | |
tag = ["netowokr", "ip", "lan"] | |
output = "" | |
[[snippets]] | |
description = "Server IP address" | |
command = "nslookup <domain>" | |
tag = ["network", "ip", "domain", "server", "dns"] | |
output = "" | |
[[snippets]] | |
description = "Mail server ip address" | |
command = "nslookup -query=mx <domain>" | |
tag = ["network", "mail", "ip", "domain"] | |
output = "" | |
[[snippets]] | |
description = "List only physical partitions on current HDD" | |
command = "df --type btrfs --type ext4 --type ext3 --type ext2 --type vfat --type iso9660" | |
tag = ["hdd", "partitions", "harddisk"] | |
output = "" | |
[[snippets]] | |
description = "Git add without whitespace" | |
command = "git diff -w --no-color | git apply --cached --ignore-whitespace" | |
tag = ["whitespace", "git", "add"] | |
output = "" | |
[[snippets]] | |
description = "Broken APT packages" | |
command = "grep Broken /var/log/dist-upgrade/apt.log | awk -F ' |:' '{print $2}'" | |
tag = ["atp", "brken", "packages"] | |
output = "" | |
[[snippets]] | |
description = "Docker remove all <none> images" | |
command = "sudo docker rmi $(sudo docker images -f \"dangling=true\" -q)" | |
tag = ["docker", "images", "remove"] | |
output = "" | |
[[snippets]] | |
description = "Remove all Docker images" | |
command = "sudo docker rmi $(sudo docker images -q)" | |
tag = ["images", "docker", "remove", "all"] | |
output = "" | |
[[snippets]] | |
description = "Remove all containers" | |
command = "sudo docker container rm $(sudo docker container ls -a -q)" | |
tag = ["containers", "docker", "remove", "all"] | |
output = "" | |
[[snippets]] | |
description = "Get Running docker container" | |
command = "sudo exec -it <container> /bin/bash" | |
tag = ["docker", "container", "bash", "access"] | |
output = "" | |
[[snippets]] | |
description = "Get root user access" | |
command = "sudo -su root" | |
tag = ["root", "sudo", "access"] | |
output = "" | |
[[snippets]] | |
description = "Total directory size" | |
command = "du -sh <path>" | |
tag = ["directory", "size"] | |
output = "" | |
[[snippets]] | |
description = "Make file to reserver disk space" | |
command = "dd if=/dev/zero of=upload_test bs=102400000 count=1 (bs - size in byte)" | |
tag = ["hdd", "disk", "space", "blank"] | |
output = "" | |
[[snippets]] | |
description = "Git log of given user name" | |
command = "git log --author=\"<user name>\"" | |
tag = ["git", "log", "auther", "user"] | |
output = "" | |
[[snippets]] | |
description = "nginx reload setting" | |
command = "nginx -s reload" | |
tag = ["reload", "config", "nginx", "server"] | |
output = "" | |
[[snippets]] | |
description = "Force stop nginx" | |
command = "nginx -s stop" | |
tag = ["nginx", "force", "stop", "server"] | |
output = "" | |
[[snippets]] | |
description = "shutdown gracefully" | |
command = "nginx -s quit" | |
tag = ["nginx", "shutdown", "turnoff", "server"] | |
output = "" | |
[[snippets]] | |
description = "Running docker container name" | |
command = "sudo docker ps --format \"{{$.Names}}\"" | |
tag = ["docker", "containers", "running", "name"] | |
output = "" | |
[[snippets]] | |
description = "Stop docker running containers" | |
command = "sudo docker stop $(sudo docker ps --format \"{{$.Names}}\")" | |
tag = ["containers", "stop", "docker", "shutdown"] | |
output = "" | |
[[snippets]] | |
description = "Debug NodeJS application" | |
command = "sudo node --inspect index.js" | |
tag = ["debug", "application", "nodejs", "node", "inspect", "chrome"] | |
output = "" | |
[[snippets]] | |
description = "Debug nodejs application with startup break" | |
command = "sudo node --inspect-brk index.js" | |
tag = ["debug", "nodejs", "node", "inspect", "starup", "application", "chrome"] | |
output = "" | |
[[snippets]] | |
description = "Start mongodb server in background" | |
command = "sudo mongod --config /etc/mongod.conf &" | |
tag = ["mongodb", "process", "server", "start", "background"] | |
output = "" | |
[[snippets]] | |
description = "Find process from ps command list" | |
command = "ps -aef | grep <process name>" | |
tag = ["ps", "process", "find", "grep", "name"] | |
output = "" | |
[[snippets]] | |
description = "Active TCP UDP port list" | |
command = "lsof -Pan -i tcp -i udp" | |
tag = ["list", "open", "active", "network", "port", "applications", "ip", "remote"] | |
output = "" | |
[[snippets]] | |
description = "Top 10 memory used app" | |
command = "ps aux | sort -nrk +4 | head -n 10 | awk '{print $2\"\\t\"$11}'" | |
tag = ["applications", "debug", "monitor", "ps", "list", "memory"] | |
output = "" | |
[[snippets]] | |
description = "Check expiration date of SSL certficate" | |
command = "echo | openssl s_client -connect <domain>:443 2> /dev/null | openssl x509 -dates -noout" | |
tag = ["ssl", "openssl", "certificate", "date", "verification", "verify", "server", "tool", "tls"] | |
output = "" | |
[[snippets]] | |
description = "My Public address" | |
command = "curl ifconfig.co" | |
tag = ["public", "dns", "network", "ip", "address", "tool", "get", "find"] | |
output = "" | |
[[snippets]] | |
description = "Delete gil local branch" | |
command = "git branch -D <branch-name>" | |
tag = ["git", "delete", "branch", "local"] | |
output = "" | |
[[snippets]] | |
description = "delete remote branch" | |
command = "git push origin :<branch-name>" | |
tag = ["git", "delete", "branch", "remote"] | |
output = "" | |
[[snippets]] | |
description = "Create 100MB file containing all zeroes" | |
command = "head -c 100MB /dev/zero > <file-name>" | |
tag = ["hdd", "blank", "file", "partition"] | |
output = "" | |
[[snippets]] | |
description = "Change the message of the last commit" | |
command = "git commit --amend" | |
tag = ["git", "rename", "message", "commit", "edit"] | |
output = "" | |
[[snippets]] | |
description = "Undo the last commit (soft reset)" | |
command = "git reset --soft HEAD^" | |
tag = ["git", "rename", "undo", "soft", "reset", "message", "commit", "edit"] | |
output = "" | |
[[snippets]] | |
description = "List first commit in a repo" | |
command = "git rev-list --max-parents=0 HEAD" | |
tag = ["git", "fist", "commit", "repo"] | |
output = "" | |
[[snippets]] | |
description = "Get current linux/system name" | |
command = "uname -n" | |
tag = ["user", "get", "name", "linux"] | |
output = "" | |
[[snippets]] | |
description = "Get server SSL cerificate issuer name" | |
command = "openssl s_client -connect <domain>:443 2> /dev/null | openssl x509 -issuer | head -n 1" | |
tag = ["ssl", "openssl", "issuer", "certificate", "find", "get"] | |
output = "" | |
[[snippets]] | |
description = "Git current branch name" | |
command = "git rev-parse --abbrev-ref HEAD" | |
tag = ["git", "branch", "current"] | |
output = "" | |
[[snippets]] | |
description = "Execute command as different user (run as)" | |
command = "sudo -u <user> -H <command>" | |
tag = ["process", "command", "execute", "user", "run-as"] | |
output = "" | |
[[snippets]] | |
description = "About me - Ankur Loriya" | |
command = "xdg-open http://about.me/ankurloriya" | |
tag = ["ankur", "loriya", "about", "me"] | |
output = "" | |
[[snippets]] | |
description = "Lookup for domain name server" | |
command = "nslookup -type=ns <domain>" | |
tag = ["name-server", "server", "ip", "domain", "dns", "lookup", "get"] | |
output = "" | |
[[snippets]] | |
description = "Get gnome extension UUID" | |
command = "cat metadata.json | grep uuid | cut -d \\\" -f4" | |
tag = ["UUID", "gnome", "extension", "metadata", "json", "read", "get"] | |
output = "" | |
[[snippets]] | |
description = "Snap revert package to specific revision number" | |
command = "sudo snap revert <package> --revision <revision>" | |
tag = ["snap", "snapcraft", "package", "revert", "specific", "version", "revision"] | |
output = "" | |
[[snippets]] | |
description = "Start mongodb in background" | |
command = "sudo mongod --config /etc/mongod.conf &" | |
tag = ["mongo", "mongodb", "start", "process", "service", "background"] | |
output = "" | |
[[snippets]] | |
description = "Get OpenGL version" | |
command = "glxinfo | grep \"OpenGL version\"" | |
tag = ["intel", "amd", "graphis", "nvidia", "get", "opengl", "version", "hardware"] | |
output = "" | |
[[snippets]] | |
description = "SSH remote port tunneling" | |
command = "ssh <user>@<host> -L <local-port>:127.0.0.1:<remote-port> -N" | |
tag = ["tunneling", "remote", "local", "network", "ssh", "access", "forword"] | |
output = "" | |
[[snippets]] | |
description = "Alpine install new package" | |
command = "apk --no-cache add <package>" | |
tag = ["os", "kernel", "package", "install", "alpine", "download", "install", "docker"] | |
output = "" | |
[[snippets]] | |
description = "Restart docker container" | |
command = "docker update --restart=always <container-id>" | |
tag = ["docker", "container", "restart", "service"] | |
output = "" | |
[[snippets]] | |
description = "Kill process by command name" | |
command = "ps -afe | grep <process-name> | grep -v 'grep' | awk '{ print $2 }' | xargs <sudo> kill -9" | |
tag = ["process", "kill", "remove", "application"] | |
output = "" | |
[[snippets]] | |
description = "Set Network default Gateway" | |
command = "route add default gw <gw-ip>" | |
tag = ["netowkring", "gateway", "set"] | |
output = "" | |
[[snippets]] | |
description = "Get network default gateway" | |
command = "ip r | grep default" | |
tag = ["gateway", "networking", "ip", "address"] | |
output = "" | |
[[snippets]] | |
description = "kill specific port proccess" | |
command = "sudo netstat -ntlvp | grep \":<port>\" | awk '{ print $7 }' | awk -F \"/\" '{ print $1 }' | xargs sudo kill -9" | |
tag = ["proces", "kill", "prot", "network"] | |
output = "" | |
[[snippets]] | |
description = "Apache List Virtual Host details" | |
command = "sudo apachectl -S" | |
tag = ["apache", "proxy", "virtual", "host", "list", "details"] | |
output = "" | |
[[snippets]] | |
description = "Gnome Screen Recorder setting up limit time" | |
command = "gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length <seconds>" | |
tag = ["time", "limit", "setting", "gnome", "screen", "record", "recoreder", "tools"] | |
output = "" | |
[[snippets]] | |
description = "Get Memory and Swap details" | |
command = "free -h" | |
tag = ["memory", "swap"] | |
output = "" | |
[[snippets]] | |
description = "Force reload network service" | |
command = "sudo /etc/init.d/networking force-reload" | |
tag = ["networking", "reload", "dns", "cache", "flush"] | |
output = "" | |
[[snippets]] | |
description = "ls command with full path" | |
command = "ls -d -1 $PWD/" | |
tag = ["path", "ls", "command"] | |
output = "" | |
[[snippets]] | |
description = "Get git repo directory full path" | |
command = "git rev-parse --show-toplevel" | |
tag = ["git", "path", "repo"] | |
output = "" | |
[[snippets]] | |
description = "current branch name" | |
command = "git rev-parse --abbrev-ref HEAD" | |
tag = ["git", "branch", "current", "detail"] | |
output = "" | |
[[snippets]] | |
description = "git log with online with all branches" | |
command = "git log --full-history --pretty=oneline --date-order --decorate=full --skip=0 --max-count=100 master --follow -- <directory-file-path>" | |
tag = ["branch", "git", "find", "directory", "file", "commit", "detail", "log"] | |
output = "" | |
[[snippets]] | |
description = "git number of commits by authors" | |
command = "git shortlog -e -s -n HEAD" | |
tag = ["auther", "git", "commit", "count"] | |
output = "" | |
[[snippets]] | |
description = "Specific commit contain in which branches" | |
command = "git branch --all --contains <commit-id>" | |
tag = ["branch", "commit", "git"] | |
output = "" | |
[[snippets]] | |
description = "Get git repo remote URL" | |
command = "git remote get-url <remote-name>" | |
tag = ["ulr", "remote", "git", "repo"] | |
output = "" | |
[[snippets]] | |
description = "Find v8 version in current nodejs" | |
command = "node -p process.versions.v8" | |
tag = ["node", "js", "v8", "engine", "version", "javascript"] | |
output = "" | |
[[snippets]] | |
description = "Which V8 options in progress in current nodejs" | |
command = "node --v8-options | grep \"in progress\"" | |
tag = ["nodejs", "v8", "options", "engine", "in-progress"] | |
output = "" | |
[[snippets]] | |
description = "get path of ubuntu default wallpapers" | |
command = "dpkg -L ubuntu-wallpapers-$(lsb_release -cs)" | |
tag = ["wallpaper", "path", "location", "image"] | |
output = "" | |
[[snippets]] | |
description = "Get IP address from MAC address" | |
command = "arp -a | sed -r 's/[-]+/:/g' | awk '{ x=\"IP \"$2\" Mac \"$4; print x }' | sed -r 's/[()]//g' | grep -i <mac>" | |
tag = ["mac", "address", "ip", "arp", "network"] | |
output = "" | |
[[snippets]] | |
description = "set default shell as bash for the user" | |
command = "usermod --shell /bin/bash <username>" | |
tag = ["user", "shell", "default", "login"] | |
output = "" | |
[[snippets]] | |
description = "Ethernet Interface setting details" | |
command = "ethtool <interface-name>" | |
tag = ["ethernet", "interface", "network", "setting", "link", "negotiation", "modes", "duplex", "frame", "advertise", "speed"] | |
output = "" | |
[[snippets]] | |
description = "Computer IP Address" | |
command = "ifconfig -a | grep -A 1 $(ls -l /sys/class/net/ | grep \"pci\" | awk -F \"/\" '{ print $NF }') | grep inet | awk '{ print $2 }'" | |
tag = ["ip", "address", "network"] | |
output = "" | |
[[snippets]] | |
description = "IP address IPv4 and IPv6 with netmask" | |
command = "ifconfig -a | grep -A 2 $(ls -l /sys/class/net/ | grep \"pci\" | awk -F \"\\/\" '{ print $NF }') | grep inet | awk '{ print $2\" / \"$4 }'" | |
tag = ["ip", "ipv4", "ipv6", "netmask", "network", "address"] | |
output = "" | |
[[snippets]] | |
description = "Ethernet PCI mac address" | |
command = "ifconfig -a | grep -A 3 $(ls -l /sys/class/net/ | grep \"pci\" | awk -F \"\\/\" '{ print $NF }') | grep ether | awk '{print $2}'" | |
tag = ["network", "mac", "address", "pci", "ethernet"] | |
output = "" | |
[[snippets]] | |
description = "Docker bridge ip information" | |
command = "ifconfig -a | grep -A 2 $(ls -l /sys/class/net/ | grep \"docker\" | awk -F \"\\/\" '{ print $NF }') | grep inet | awk '{ print $2\" / \"$4 }'" | |
tag = ["docker", "ip", "address", "ipv4", "ipv6", "netmask"] | |
output = "" | |
[[snippets]] | |
description = "Docker virtual mac address" | |
command = "ifconfig -a | grep -A 3 $(ls -l /sys/class/net/ | grep \"docker\" | awk -F \"\\/\" '{ print $NF }') | grep ether | awk '{print $2}'" | |
tag = ["mac", "address", "docker", "virtual"] | |
output = "" | |
[[snippets]] | |
description = "My Computer MAC address" | |
command = "ifconfig -a | grep -A 3 $(ls -l /sys/class/net/ | grep \"pci\" | awk -F \"/\" '{ print $NF }') | grep ether | awk '{print $2}'" | |
tag = ["mac", "address", "network", "ethernet", "controller"] | |
output = "" | |
[[snippets]] | |
description = "Weather detail in terminal" | |
command = "curl Wttr.in" | |
tag = ["weather", "terminal"] | |
output = "" | |
[[snippets]] | |
description = "Disk IO Scheduler name" | |
command = "cat /sys/block/sda/queue/scheduler" | |
tag = ["disk", "io", "scheduler", "info", "device", "hdd", "queue"] | |
output = "" | |
[[snippets]] | |
description = "List system targets crons timers startup file with status" | |
command = "sudo systemctl list-unit-files" | |
tag = ["system", "systemctl", "list", "file", "startup", "cron", "socket", "service"] | |
output = "" | |
[[snippets]] | |
description = "List of startup service name" | |
command = "systemctl list-units --type service" | |
tag = ["system", "startup", "service"] | |
output = "" | |
[[snippets]] | |
description = "SSL certificate expiry date" | |
command = "openssl x509 -enddate -noout -in <pem-file-path>" | |
tag = ["ssl", "openssl", "certificate", "date", "expiry"] | |
output = "" | |
[[snippets]] | |
description = "Git tags list with commit id" | |
command = "git show-ref --tags | awk '{ print $2\"/\"$1 }' | awk -F \"/\" '{ print $3\" \"$4 }' | column -t" | |
tag = ["git", "tag", "commit", "id", "list"] | |
output = "" | |
[[snippets]] | |
description = "Git Local Branches with Commit ID" | |
command = "git show-ref --head | grep -v \"tags\\|remotes\\| HEAD\\|stash\" | awk '{ print $2\"/\"$1 }' | awk -F \"/\" '{ print $3\" \"$4 }' | column -t" | |
tag = ["git", "commit", "id", "local", "branch", "list"] | |
output = "" | |
[[snippets]] | |
description = "Git remote branches with commit ID" | |
command = "git show-ref --head | grep -v \"tags\\|heads\\| HEAD\\|stash\" | awk '{ print $2\"/\"$1 }' | awk -F \"/\" '{ print $4\" \"$5 }' | column -t" | |
tag = ["git", "branch", "commit", "id", "remote", "list"] | |
output = "" | |
[[snippets]] | |
description = "Update locate mlocate database" | |
command = "sudo updatedb" | |
tag = ["find", "file", "update", "database", "locate", "mlocate"] | |
output = "" | |
[[snippets]] | |
description = "Docker PS Short list" | |
command = "docker ps --format \"table {{.Status}}\\t{{.Ports}}\\t{{.Names}}\\t{{.Image}}\"" | |
tag = ["docker", "ps", "short", "format", "output", "pretty"] | |
output = "" | |
[[snippets]] | |
description = "SSL Certificate using certbot" | |
command = "sudo certbot --apache -d <domain>" | |
tag = ["Encrypt", "certbot", "ssl", "https", "apache", "config", "server", "certificate", "lets"] | |
output = "" | |
[[snippets]] | |
description = "Git All Branches with Tree layout" | |
command = "git log --pretty=oneline --graph --decorate --all" | |
tag = ["git", "tree", "view", "layout", "log", "commit", "branch"] | |
output = "" | |
[[snippets]] | |
description = "Git Clean Repositry Remove unwanted file" | |
command = "git clean -f -d" | |
tag = ["remove", "clean", "git", "repo"] | |
output = "" | |
[[snippets]] | |
description = "Git Commit Message Reports By Users Between 2 Commits or Branches" | |
command = "git shortlog <source-commit-branch>..<destination-commit-branch>" | |
tag = ["git", "commit", "branch", "message", "auther", "user", "report"] | |
output = "" | |
[[snippets]] | |
description = "List all store git alias (shortcuts)" | |
command = "git config -l | grep alias | sed 's/^alias\\.//g'" | |
tag = ["alias", "shortuct", "command", "git", "config"] | |
output = "" | |
[[snippets]] | |
description = "Search Git Commit message sub string" | |
command = "git log -S\"<string>\"" | |
tag = ["string", "search", "find", "git", "commit", "message"] | |
output = "" | |
[[snippets]] | |
description = "Git remove remote unwanted merged branch" | |
command = "git branch --no-color -r --merged | sed 's/*//g' | sed 's/ //g' | sed 's/remotes\\///g' | awk 'BEGIN { ORS = \" \" } { if (NR!=1) {print} }' | xargs git branch -r -d" | |
tag = ["remote", "branch", "git", "remove", "delete", "merged"] | |
output = "" | |
[[snippets]] | |
description = "Git remove local Unwanted branches" | |
command = "git branch --no-color --merged | sed 's/*//g' | sed 's/ //g' | awk 'BEGIN { ORS = \" \" } { if (NR!=1) {print} }' | xargs git branch -d" | |
tag = ["git", "remove", "delete", "branch", "merged"] | |
output = "" | |
[[snippets]] | |
description = "Git remove remote local branches which removed from remote repo" | |
command = "git fetch --prune" | |
tag = ["remote", "repo", "git", "branch", "remote", "delete"] | |
output = "" | |
[[snippets]] | |
description = "Create Directory and move to directory without type path" | |
command = "mkdir /foo/bar && cd $_" | |
tag = ["tips", "bash", "directory", "folder"] | |
output = "" | |
[[snippets]] | |
description = "Create backup file without type path again" | |
command = "cp /some/path/to/file.txt{,.bak}" | |
tag = ["tips", "bash", "backup", "file"] | |
output = "" | |
[[snippets]] | |
description = "Create all file backups in directory" | |
command = "for file in * ; do cp $file $file.bak; done" | |
tag = ["tips", "bash", "backup", "files"] | |
output = "" | |
[[snippets]] | |
description = "generate letencrypt ssl sertificate" | |
command = "certbot certonly --standalone -n --preferred-challenges http -d <domain>" | |
tag = ["ssl", "cert", "certificate", "letencrypt", "certbot"] | |
output = "" | |
[[snippets]] | |
description = "Git remove all remote branches from local repo" | |
command = "git branch -r | xargs git branch -r -d" | |
tag = ["git", "remove", "branch", "remote", "local", "repo"] | |
output = "" | |
[[snippets]] | |
description = "list file and directory with seconds and timezone" | |
command = "ls -l --time-style=full-iso" | |
tag = ["iso", "time", "timezone", "list", "directory", "file", "ls", "command", "detail"] | |
output = "" | |
[[snippets]] | |
description = "docker image update with latest tag" | |
command = "sudo docker image ls | awk '{ system(\"docker pull \"$1) }' # not sure about" | |
tag = ["docker", "pull", "image", "update", "latest"] | |
output = "" | |
[[snippets]] | |
description = "docker web UI" | |
command = "docker run -d -p 9000:9000 --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /opt/portainer:/data portainer/portainer && echo \"open http://localhost:9000\"" | |
tag = ["tool", "ui", "docker", "web", "management"] | |
output = "" | |
[[snippets]] | |
description = "Directory Size" | |
command = "du -sch * .[!.]* | sort -rh" | |
tag = ["directory", "size", "sort", "folder", "file"] | |
output = "" | |
[[snippets]] | |
description = "Clean Swap memory" | |
command = "sudo swapoff -a && sudo swapon -a" | |
tag = ["clean", "swap", "memory", "perfomance", "usage"] | |
output = "" | |
[[snippets]] | |
description = "MySQL Import SQL File Progress Watch" | |
command = "watch -n 3 'echo \"show processlist;\" | mysql -h 127.0.0.1 --port 3306 -uroot -pab@123';" | |
tag = ["watch", "mysql", "process", "monitor", "import", "query", "file", "database", "list"] | |
output = "" | |
[[snippets]] | |
description = "Import MYSQL File with file upload progress." | |
command = "pv ~/Downloads/my.sql | mysql -u root -h 127.0.0.1 --port 3306 db_name_1 -p" | |
tag = ["mysql", "import", "progress", "file", "upload", "database"] | |
output = "" | |
[[snippets]] | |
description = "MySQL Cli get all database size" | |
command = "SELECT table_schema AS \"Database Name\", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS \"Size in (MB)\" FROM information_schema.TABLES GROUP BY table_schema;" | |
tag = ["mysql", "database", "db", "size", "memory", "space", "disk", "usage"] | |
output = "" | |
[[snippets]] | |
description = "Rsync with SSH and PEM file Copy content from remote to local" | |
command = "rsync --progress --partial -v -e \"ssh -i /home/ankur/server.pem\" ubuntu@ip.com:/home/ubuntu/source.txt ./destinatation.txt" | |
tag = ["remote", "local", "server", "ssh", "rsync", "copy", "download", "file", "directory", "folder", "pem", "key"] | |
output = "" | |
[[snippets]] | |
description = "APT list seurity updates" | |
command = "apt list --upgradable | grep \"\\-security\"" | |
tag = ["apt", "list", "security", "package"] | |
output = "" | |
[[snippets]] | |
description = "Get SSL cert Subject and Common Name" | |
command = "openssl x509 -noout -subject -in ./domain3.cert" | |
tag = ["ssl", "detail", "certificate", "cert", "subject", "common", "name", "openssl", "information"] | |
output = "" | |
[[snippets]] | |
description = "Mongo DB Current Process Information" | |
command = "db.currentOp()" | |
tag = ["mongo", "database", "process", "active", "query", "db", "shell"] | |
output = "" | |
[[snippets]] | |
description = "Find thunderbird filter rules data" | |
command = "find ~/.thunderbird/ -name \"msgFilterRules.dat\" -exec ls -lthu {} \\;" | |
tag = ["filter", "mail", "thunderbirtd", "mozilla", "rule", "data", "backup"] | |
output = "" | |
[[snippets]] | |
description = "Get SSL expiry issue dates, issuer details, and Subject" | |
command = "openssl s_client -connect www.google.com:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -dates -issuer -subject -noout -in /dev/stdin" | |
tag = ["ssl", "certificate", "issuer", "expiry", "after", "before", "date", "server", "website", "fingerprint", "subject"] | |
output = "" | |
[[snippets]] | |
description = "Process count by user" | |
command = "ps hax -o user | sort | uniq -c | sort -r" | |
tag = ["user", "count", "process"] | |
output = "" | |
[[snippets]] | |
description = "Process Tree move 4 scroll way" | |
command = "ps awwfux | less -S" | |
tag = ["process", "tree", "list"] | |
output = "" | |
[[snippets]] | |
description = "Disk IO performance monitor summery" | |
command = "dstat -tdD total,sda,sdb,sdc,md1 60" | |
tag = ["disk", "io", "usage", "monitor", "performace", "tool", "top"] | |
output = "" | |
[[snippets]] | |
description = "Docker Inspect Network IP" | |
command = "docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container>" | |
tag = ["docker,netowkr,ip,inspect"] | |
output = "" | |
[[snippets]] | |
description = "Network attached containers IP" | |
command = "docker network inspect -f '{{json .Containers}}' <network-name-id> | jq '.[] | .Name + \":\" + .IPv4Address'" | |
tag = ["ip,network,container,docker,inspect,debug"] | |
output = "" | |
[[snippets]] | |
description = "Docker Netowork Subnet Gateway" | |
command = "docker network inspect -f '{{json .}}' <network-name-id> | jq '.IPAM.Config'" | |
tag = ["docker,gateway,network,subnet,inspect"] | |
output = "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment