Skip to content

Instantly share code, notes, and snippets.

@cirrusUK
Last active Jun 19, 2021
Embed
What would you like to do?
pet : CLI Snippet Manager
[[snippets]]
description = "system info"
command = "inxi -F"
output = ""
[[snippets]]
description = "output random letters"
command = "head /dev/urandom | tr -dc a-z | cut -c4-8"
output = ""
[[snippets]]
description = "markdown image"
command = "[![OnFileNotWanted's DEV Profile](https://i.imgur.com/xWHUUyq.png)](https://dev.to/_cirrus_minor_)"
output = ""
[[snippets]]
description = "image"
command = "feh 'https://i.imgur.com/gejB62N.jpg'"
output = ""
[[snippets]]
description = "CPU Temperature"
command = "inxi -F | grep 'System Temperatures' | cut -c12-43"
output = ""
[[snippets]]
description = "CPU Temp"
command = "sensors | awk 'NR == 4' |colrm 23"
output = ""
[[snippets]]
description = "battery info"
command = "cat /sys/devices/platform/smapi/BAT0/remaining_running_time"
output = ""
[[snippets]]
description = "battery remaining"
command = "cat /sys/devices/platform/smapi/BAT0/remaining_percent"
output = ""
[[snippets]]
description = "last 10 pacman updates"
command = "cat /var/log/pacman.log | grep upgraded | tail -n10"
output = ""
[[snippets]]
description = "graphics info"
command = "lspci -k |grep -A3 VGA"
output = ""
[[snippets]]
description = "Resize Image"
command = "convert \"/home/cirrus/Desktop/00.jpg\" -resize 800x600 -quality 100 \"/home/cirrus/tmp/splashtxt.jpg\""
output = ""
[[snippets]]
description = "bat themes list"
command = "bat --list-themes | fzf --preview=\"bat --theme=\"Tomorrow-Night\" --color=always ~/.zshrc\""
output = ""
[[snippets]]
description = "printf color"
command = "printf \"\\x1b[38;2;255;100;0mTRUECOLOR\\x1b[0m\\n\""
output = ""
[[snippets]]
description = "alsi color"
command = "alsi -c1=red -c2=blue -t red "
output = ""
[[snippets]]
description = "osd mpd np"
command = "~/.bin/mpdnposd"
output = ""
[[snippets]]
description = "ansiweather glasgow"
command = "ansiweather -a false -l glasgow -u metric | rev | cut -c69- | rev | osd_cat -o 55 -A right -p bottom -O 1 -c orange -u black -f '-*-pragmatapro-*-*-*-*-24-*-*-*-*-*-*-*'"
output = ""
[[snippets]]
description = "BBC World Service"
command = "mpv 'http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/sbr_vlow/llnw/bbc_wor"
output = ""
[[snippets]]
description = "Get External I.P"
command = "curl ifconfig.io"
output = ""
[[snippets]]
description = "Build and install PGKBUILD in current directory."
command = "makepkg -si"
output = ""
[[snippets]]
description = "Create or update SRCINFO for PGKBUILD in current directory."
command = "makepkg --printsrcinfo > .SRCINFO"
output = ""
[[snippets]]
description = "Show 20 Most Used Commands."
command = "fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] \" \" CMD[a]/count*100 \"% \" a;}' | grep -v \"./\" | column -c3 -s \" \" -t | sort -nr | nl | head -n20"
output = ""
[[snippets]]
description = "Show Date Of Filesystem Creation"
command = "sudo dumpe2fs $(mount | grep 'on \\/ ' | awk '{print $1}') | grep 'Filesystem created:'"
output = ""
[[snippets]]
description = "see all internal IP connected to network"
command = "fping -a -r 0 -g 192.168.1.0/24"
output = ""
[[snippets]]
description = "boot messages"
command = "echo -n Boot Messages | pv -qL 10 && sudo journalctl -b | ccze -A"
output = ""
[[snippets]]
description = "show time takes services to start"
command = "systemd-analyze blame"
output = ""
[[snippets]]
description = "Activate Laptop Camera"
command = "ffplay -f v4l2 -fflags nobuffer -flags low_delay -video_size 482x476 -framerate 30 -i /dev/video0"
output = ""
[[snippets]]
description = "OSD"
command = "osd_countdown --wait '$1' --message 'Time out' --font '-*-dejavu sans mono-*-*-*-*-30-*-*-*-*-*-*-*' -cgreen | blink"
output = ""
[[snippets]]
description = "monitor cpu speeds in realtime"
command = "watch grep \\\"cpu MHz\\\" /proc/cpuinfo"
output = ""
[[snippets]]
description = "dclock"
command = "dclock -bg black -fg turquoise -led_off black -geometry 114x49"
output = ""
[[snippets]]
description = "Show Errors From Previous Boot"
command = "journalctl -b -p err | ccze -A"
output = ""
[[snippets]]
description = "Random Fun Facts"
command = "wget randomfunfacts.com -O - 2>/dev/null | grep \\<strong\\> | sed \"s;^.*<i>\\(.*\\)</i>.*$;\\1;\""
output = ""
[[snippets]]
description = "Fan Info"
command = "sudo cat /proc/acpi/ibm/fan"
output = ""
[[snippets]]
description = "Fuzzy Pkg browser"
command = "fzpkg"
output = ""
[[snippets]]
description = "HDD R/W"
command = "iostat -d -x -p sda | grep -w 'sda' | awk '{print \"Read: \"$6 \" Write: \" $7}'"
output = ""
[[snippets]]
description = "kernel messages"
command = "sudo journalctl -f _TRANSPORT=kernel"
output = ""
[[snippets]]
description = "Pacmans Last Package Update"
command = "tac /var/log/pacman.log | grep upgraded | head -n 1 | cut -c 2-17"
output = ""
[[snippets]]
description = "List installed AUR packages"
command = "pacman -Qqm"
output = ""
[[snippets]]
description = "sort files dirs by size"
command = "ls -lSrh | ccze -A"
output = ""
[[snippets]]
description = "list dirs first"
command = "ls -FN --group-directories-first --color=auto"
output = ""
[[snippets]]
description = "FreeRAM"
command = "free -m -l -t | bat"
output = ""
[[snippets]]
description = "Show Moon Cycle"
command = "curl -sL http://wttr.in/moon | head -n-4"
output = ""
[[snippets]]
description = "MPV for Audio"
command = "mpv --geometry=150x150+1192+597 --autofit-smaller=150x150 --shuffle --no-config --playlist=\"/home/cirrus/Music/mp3.pls\""
output = ""
[[snippets]]
description = "listening ports"
command = "lsof -i -P | grep LISTEN"
output = ""
[[snippets]]
description = "Dennis Ritchie"
command = "curl -Ls https://git.io/unix"
output = ""
[[snippets]]
description = "Remove Pacman's db lock"
command = "sudo rm /var/lib/pacman/db.lck"
output = ""
[[snippets]]
description = "Use Reflector To Update Mirrorlist."
command = "reflector.py --protocol https --latest 30 --country GB --number 20 --sort rate --save /etc/pacman.d/mirrorlist"
output = ""
[[snippets]]
description = "Use ffmpeg to screencast"
command = "ffmpeg -video_size 1366x768 -framerate 30 -f x11grab -i :0.0 -f pulse -ac 2 -i default ~/video/scast/output\"${RANDOM}\".mkv"
output = ""
[[snippets]]
description = "Use Mplayer to view cam."
command = "mplayer tv://"
output = ""
[[snippets]]
description = "Use feh to slideshow pictures"
command = "cd /home/cirrus/Pictures | feh -z -D 15"
output = ""
[[snippets]]
description = "top processes"
command = "ps axo %cpu,%mem,comm |sort -unr| head -n 9"
output = ""
[[snippets]]
description = "Show HDD UUID"
command = "ls /dev/disk/by-uuid/ -alh"
output = ""
[[snippets]]
description = "Wifi Signal"
command = "iwconfig wlp3s0 | grep -i --color signal"
output = ""
[[snippets]]
description = "Use MPV to view cam."
command = "mpvtv://-tvwidth=640:height=480:device=/dev/video0"
output = ""
[[snippets]]
description = "Share File via 0x0.st"
command = "curl -F 'file=@yourfile.png' https://0x0.st"
output = ""
[[snippets]]
description = "External IP"
command = "curl --fail https://ipapi.co/ip"
output = ""
[[snippets]]
description = "Download all the URLs mentioned in the url-list.txt file"
command = "cd ~/video/misc && cat url-list.txt | xargs wget –c"
output = ""
[[snippets]]
description = "remove spaces from filenames"
command = "for a in ./**/*\\ *(Dod); do mv $a ${a:h}/${a:t:gs/ /_}; done"
output = ""
[[snippets]]
description = "Sort the output from `ls -l' by file size"
command = "ls -fld *(OL)"
output = ""
[[snippets]]
description = "find file by contained text"
command = "find / -xdev -type f -print0 | xargs -0 grep -H \"foo\""
output = ""
[[snippets]]
description = "Add Audio To Video."
command = "ffmpeg -i /home/cirrus/video/NDE2.m4v -i '/home/cirrus/Music/Pink Panther1.mp3' -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 ~/output.mp4"
output = ""
[[snippets]]
description = "Convert Images From .gif to .png"
command = "for i in **/*.gif; convert $i $i:r.png"
output = ""
[[snippets]]
description = "espeak"
command = "espeak -s 125 -v en+f5 'Please be quiet in the sanitarium'"
output = ""
[[snippets]]
description = "Using cat to weld video files together."
command = "cat file1.mp4 file2.mp4 > welded.mp4"
output = ""
[[snippets]]
description = "sort alphabeticaly"
command = "cat unordered_file | sort > ordered_file"
output = ""
[[snippets]]
description = "Show only error, critical, and alert priority messages"
command = "journalctl -p err..alert"
output = ""
[[snippets]]
description = "Make all journal files contain no data older than 2 weeks."
command = "journalctl --vacuum-time=2weeks"
output = ""
[[snippets]]
description = "Select Area Of Screen To Capture As .png"
command = "scrot -s '%Y-%m-%d--%s_$wx$h_scrot.png'"
output = ""
[[snippets]]
description = "Previous Commands"
command = "fc -li -146 | awk '{print $4}' | sort | uniq -c"
output = ""
[[snippets]]
description = "Show VDU resoloution."
command = "xdpyinfo | grep -B 2 resolution"
output = ""
[[snippets]]
description = "Find Broken Symlinks."
command = "find -xtype l -print"
output = ""
[[snippets]]
description = "Markdown Inline Link."
command = "This is [an example](http://example.com/ \"Title\") inline link."
output = ""
[[snippets]]
description = "Markdown Hyperlink"
command = "[This link](http://example.net/) has no title attribute."
output = ""
[[snippets]]
description = "Xcowsay Example."
command = "xcowsay --at 1200,40 --image \"/home/cirrus/.icons/bbc-news-icon.png\" \"Headlines\""
output = ""
[[snippets]]
description = "MPD Rpi Server Now Playing"
command = "/home/cirrus/.bin/mpc21"
output = ""
[[snippets]]
description = "Colour Hex Codes"
command = "tco -d"
output = ""
[[snippets]]
description = "OSD Countdown Timer"
command = "/home/cirrus/.bin/countdown '60'"
output = ""
[[snippets]]
description = "Glasgow UK News"
command = "googler -N Glasgow"
output = ""
[[snippets]]
description = "My Football Team News"
command = "googler -N Glasgow Rangers FC"
output = ""
[[snippets]]
description = "Search ArchWiki"
command = "googler -w wiki.archlinux.org 'xorg'"
output = ""
[[snippets]]
description = "xdg-mime query filetype"
command = "xdg-mime query filetype ~/djtux.png"
output = ""
[[snippets]]
description = "Determine the default application for a MIME type:"
command = "xdg-mime query default image/jpeg"
output = ""
[[snippets]]
description = "Change the default application for a MIME type."
command = "xdg-mime default feh.desktop image/jpeg"
output = ""
[[snippets]]
description = "tmux2html"
command = "~/venv/bin/tmux2html 0 -o ~/misc/tmux${RANDOM}.html"
output = ""
[[snippets]]
description = "streamlink play video url"
command = "streamlink -p mpv \"https://www.filmon.com/tv/cbs-reality1\" low,worst"
output = ""
[[snippets]]
description = "sort processes by CPU usage."
command = "ps -Ao pcpu,pid,args | sort -r -k1"
output = ""
[[snippets]]
description = "MPV Now Playing OSD without socket."
command = "ponymix list --short | awk -F '\\t' '/sink-input/ && $4 == \"mpv Media Player\" {print $3}' | osd_cat -A center -p bottom -f '-*-roboto-*-*-*-*-34-*-*-*-*-*-*-*' -c#ffd700 -s 5 && /home/cirrus/.bin/mpvnp"
output = ""
[[snippets]]
description = "chunk.io : Upload file"
command = "curl -u user:pass -T path/to/file https://chunk.io"
output = ""
[[snippets]]
description = "Share file 200MB limit"
command = "curl -n -T /home/cirrus/insults.txt https://chunk.io"
output = ""
[[snippets]]
description = "scp files by extension to remote server"
command = "scp -P 22 -rv /home/cirrus/Music/*.{zip,7z} . cirrus@192.168.1.33:/srv/http/public/compressed.audio/"
output = ""
[[snippets]]
description = "Sky Sports Premier League Acestream"
command = "acestream-launcher \"acestream://b1287a591efec541df0776abba6505b735fad6ae\" --player mpv"
output = ""
[[snippets]]
description = "Sky News Acestream"
command = "acestream-launcher \"acestream://b1287a591efec541df0776abba6505b735fad6ae\" --player mpv"
output = ""
[[snippets]]
description = "Docubox Acestream"
command = "acestream-launcher \"acestream://f0ea243f79c62258b54e5534efda52a8c4975fe3\" --player mpv"
output = ""
[[snippets]]
description = "Sky Sports Main Event Acestream"
command = "acestream-launcher \"acestream://bd419a0b7dd325185fd6ed60665b91b5d31eed49\" --player mpv"
output = ""
[[snippets]]
description = "BT Sports 1 Acestream"
command = "acestream-launcher \"acestream://87302a71ba909500eb09071ec79533647e0df8a7\" --player mpv"
output = ""
[[snippets]]
description = "BT Sports 2 Acestream"
command = "acestream-launcher \"acestream://d22d1e93ed4fa57474f3f295b179a9eefa429fbd\" --player mpv"
output = ""
[[snippets]]
description = "Crime Investigation Acestream"
command = "acestream-launcher \"acestream://b6e13f77adea8d80eb0911c44df97285402d28d4\" --player mpv"
output = ""
[[snippets]]
description = "Discovery I.D Acestream"
command = "acestream-launcher \"acestream://edab79c8db315e65218b751c3c25c123f1ffc2ac\" --player mpv"
output = ""
[[snippets]]
description = "Discovery Acestream"
command = "acestream-launcher \"acestream://72971bc15afdfbc40ddcd23b2ee0959b37a19b82\" --player mpv"
output = ""
[[snippets]]
description = "YouTube Viewer Subscriptions"
command = "youtube-viewer -SV --subs-order=relevance"
output = ""
[[snippets]]
description = "RT Documentary Acestream"
command = "acestream-launcher \"acestream://64c00dd68aa4d7676bd4921a07f69a939b73c235\" --player mpv"
output = ""
[[snippets]]
description = "NatGeo Acestream"
command = "acestream-launcher \"acestream://2a5bfd0aba0ed173a0e0bddd24f334cba01ab601\" --player mpv"
output = ""
[[snippets]]
description = "Al Jazeera Documentary Acestream"
command = "acestream-launcher \"acestream://1d229814f7cbb80d2fbf553cd8e9fc61de840407\" --player mpv"
output = ""
[[snippets]]
description = "Magellan TV Acestream"
command = "acestream-launcher \"acestream://d651011bed5e69e62e726e10eb0ade9565541e45\" --player mpv"
output = ""
[[snippets]]
description = "CGTN Documentary [EN][576p] Acestream"
command = "acestream-launcher \"acestream://42fa09b3170658c96a91087ea93066e5e8f83fbd\" --player mpv"
output = ""
[[snippets]]
description = "Limit info to specific devices"
command = "hwinfo --short --cpu --disk --listmd --gfxcard --wlan --printer"
output = ""
[[snippets]]
description = "display your Linux hardware information:"
command = "sudo lshw -short | ccze -A"
output = ""
[[snippets]]
description = "display a HUD that shows RAM used by the system every second"
command = "while true; do free | grep Mem | awk '{print $3/$2 * 100.0}'; sleep 1; done | osd_cat --align center --pos middle --lines 1 --delay 2 -f '-*-roboto-*-*-*-*-34-*-*-*-*-*-*-*' -c#ffd700"
output = ""
[[snippets]]
description = "display a HUD showing CPU usage every second"
command = "while true; do top -b -n1 | grep \"Cpu(s)\" | awk '{print $2 + $4}'; sleep 1; done | osd_cat --align center --pos middle --lines 1 --delay 2 -f '-*-roboto-*-*-*-*-34-*-*-*-*-*-*-*' -c#ffd700"
output = ""
[[snippets]]
description = "Show 120 gists"
command = "gh gist list -L 120 | ccze -A"
output = ""
[[snippets]]
description = "Github Streamlink Issues."
command = "gh issue list -R streamlink/streamlink | ccze -A"
output = ""
[[snippets]]
description = "Github mps-youtube Issues"
command = "gh issue list -R mps-youtube/mps-youtube | ccze -A"
output = ""
[[snippets]]
description = "OxygenTV"
command = "mpv 'https://s3.ustv24h.live/Oxygen/myStream/chunks.m3u8?nimblesessionid=8768432&wmsAuthSign=c2VydmVyX3RpbWU9MTAvMy8yMDIwIDk6Mzk6MjcgUE0maGFzaF92YWx1ZT1TMmEvL3l0Rk1DRkN1Qm1PeEhXdVh3PT0mdmFsaWRtaW51dGVzPTI0MA=='"
output = ""
[[snippets]]
description = "TrumpToilet"
command = "donald cirrus | toi"
output = ""
[[snippets]]
description = "playerctl show mpv metadata"
command = "playerctl -p mpv metadata -f \"{{xesam:title}}\""
output = ""
[[snippets]]
description = "playerctl show metadata from all current players"
command = "{ echo \"$(playerctl metadata title | awk -v len=40 '{ if (length($0) > len) print substr($0, 1, len-3) \"...\"; else print; }' | tr -d '&' | awk '{print \"\" $0 \"\"}')\"; echo - \"$(playerctl metadata artist)\" - \"$(playerctl metadata album)\"; } | tr \"\\n\" \" \""
output = ""
[[snippets]]
description = "playerctl now playing"
command = "playerctl -p mpd metadata --format \"Now playing: {{ artist }} - {{ album }} - {{ title }}\""
output = ""
[[snippets]]
description = "playerctl firefox metadata"
command = "playerctl -p firefox metadata --format \"{{ title }}\""
output = ""
[[snippets]]
description = "sudo Pacman -Syu --overwrite"
command = "sudo pacman -Syu --overwrite \"*\""
output = ""
[[snippets]]
description = "list YT documentaries"
command = "straw-viewer :re=\"^Documentaries Full\""
output = ""
[[snippets]]
description = "samba share mount BTHUB USB"
command = "sudo mount -t cifs //192.168.1.254/usb1 /mnt/BTHUB -o username=cirrus,password=PASSWORD,workgroup=workgroup,iocharset=utf8,uid=cirrus,gid=root,vers=1.0"
output = ""
[[snippets]]
description = "remove pacman db.lck"
command = "sudo rm -rf /var/lib/pacman/db.lck"
output = ""
[[snippets]]
description = "hackersays"
command = "wget hackersays.com/quote -O - 2>/dev/null | sed \"s;^.*<i>\\(.*\\)</i>.*$;\\1;\""
output = ""
[[snippets]]
description = "save video to disk with streamlink"
command = "streamlink -o ~/video/%(title)s.m2t <url> 420p,480p,high"
output = ""
[[snippets]]
description = "Check if network interface is UP/DOWN"
command = "cat /sys/class/net/wlp3s0/operstate"
output = ""
[[snippets]]
description = "show enabled systemd units"
command = "systemctl list-unit-files --state=enabled"
output = ""
[[snippets]]
description = "show installed kernels"
command = "file /boot/vmlinuz-linux* | awk '/Linux kernel/ {printf \"\\t%s\\n\", $9}' | sort -r"
output = ""
[[snippets]]
description = "copy files from paths defined in a .txt file"
command = "IFS=$'\\n' && for i in $(cat ~/pathlist.txt); do cp \"$i\" ~/folder/; done"
output = ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment