- Get your external IP:
curl -s ipecho.net/plain
- Get your internal IP:
ipconfig getifaddr en0
- Test http with netcat:
echo -e "HTTP/1.1 200 OK\nContent-Type: text/html\n\n Jesus Christ is my Lord!" | nc -vv -l 8080
- Extract SVG from the 30's page of PDF file using Poppler:
pdftocairo -f 30 -l 30 -svg book.pdf 30.svg
- Extract files from
archive.zip
with filenames in Russian:unzip -O cp866 archive.zip
- Make JSON array from list of all
*.txt
filenames in current directory:ls *.txt|jq -R -s -c 'split("\n")' > list.json
- Print out all Russian Bible book names with their numbers:
http jbbl.github.io/rst/index.json|fx ".books.reduce((a,b) =>a+`\n`+b.nr+`: `+b.name,``)"|column
- Print out John 1:1 from Greek Textus Receptus:
http jbbl.github.io/tr.json|fx .books[4-1].chapters[1-1].verses[1-1] "`«`+this.text+`» (`+this.name+`)`"
- Print out Ps.83:3 in RST translation:
http jbbl.github.io/rst/ps/83.json|fx .verses[3-1] "`«`+this.text+`» (`+this.name+`)`"
- Copy Ps.83:3 in RST translation into the clipboard buffer:
http jbbl.github.io/rst/ps/83.json|fx .verses[3-1] "`«`+this.text+`» (`+this.name+`)`"|pbcopy
- Print out whole chapter 1 of book of Psalms in KJV translation:
http jbbl.github.io/kjv/ps/1.json|fx ".verses.reduce((a,b) =>a+`\n`+b.verse+`. `+b.text,this.name)"
- List of
*.txt
filenames from current directory saved in JSON array:ls *.txt|jq -R -s -c 'split("\n")' > ./list.json
- List only subdirectories of current directory (files not included):
ls -d */
- Executes
ls -l
with all*.md
files from~/dev
directory:find ~/dev -iname \*.md -exec ls -l \{\} +
- Finding
*.md
files excludingnode_modules
directories from search path:find ~/dev -iname \*.md -not -path \*node_modules\* 2>/dev/null
- To keep my mac software updated with homebrew, homebrew-cask-upgrade and mas:
brew update;brew upgrade;brew cu --all --yes --cleanup;mas upgrade;brew cleanup;brew bundle dump --force --describe --file=~/Brewfile
- To set
hostname
tomyMac.myDomain.ru
:sudo scutil --set HostName myMac.myDomain.ru
- Full year calendar for 2020 and 2021 side by side (fish analog of bash's
paste <(cal 2020) <(cal 2021)
):paste (cal 2020|psub) (cal 2021|psub)
- Chars frequency in Psalm 90:
http jbbl.github.io/rst/ps/90.json|fx ".verses.reduce((a,b) =>a+b.text+`\n`,``)"|grep -o '.'|tr А-Я а-я|sort|uniq -c|sort -rn
- Glueing 6 tile images together vertically using
ImageMagick
:montage *.jpg -tile 1x6 -geometry +0+0 imagelist.jpg
- Adding transparent padding to an image using
ImageMagick
:convert withoutpadding.jpg -resize 1200x630 -gravity center -background none -extent 1200x630 withpadding.jpg
- Mirroring an image using
ImageMagick
:convert -flop input.png output.png
- Viewing
picture.png
image with60
columns width using imgcat:imgcat --width=60 picture.png
- Saving current weather report to the
weather.png
file with transparency using wttr.in API:http -do weather.png wttr.in/Новороссийск,Видова,58_lang=ru_format=v2_t_F.png
- Making screenshot with current weather using webkit2png:
webkit2png -F -z 2.0 -W 608 --delay=2 -o wttrNovorossEn 'https://wttr.in/Novorossiysk,Vidova,58?lang=en&format=v2&F'
- Get forms of Russian word
Иисус
:http https://ws3.morpher.ru/russian/declension\?format=json\&s=Иисус
- Merge some pdf files into one
merged.pdf
file:gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf file1.pdf file2.pdf
- Delete second page from
in.pdf
file and put result inout.pdf
withpdftk server
:Note that last version ofpdftk in.pdf cat 1 3-end output out.pdf
pdftk server
for Mac are not listed on the official web site!!! - Cropping
short.mp3
file with 3 min 16 sec duration from 44 min 44 sec oflong.mp3
file:ffmpeg -i long.mp3 -ss 00:44:44 -t 00:03:16 short.mp3
- Convert high bitrate MP3 to 92k bitrate using FFmpeg:
ffmpeg -i input.mp3 -codec:a libmp3lame -b:a 92k output.mp3
- Extracting screenshot for
video.mkv
withffmpeg
at a given time (3m16s):ffmpeg -ss 00:03:16 -i video.mkv -vframes 1 -q:v 2 screenshot.jpg
- Detect and extract slides in
video.mkv
withslide-detector.py
script by Daniel Perelman:./slide-detector.py video.mkv
- Print out banner
Христос воскресе!
withfiglet
:figlet -C utf8 -f banner Христос воскресе!
- Run local static web server on port
8000
with Python version 3.X:python -m http.server
Last active
December 24, 2022 16:02
-
-
Save a1ip/acc83b7d4e5faa55b432 to your computer and use it in GitHub Desktop.
Useful Mac OS X terminal one-liners in fish shell.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment