Skip to content

brongulus/cheatsheets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cheat Sheet

This ia a test repository containing some of my cheatsheets

  1. ffmpeg
  2. wget

Termux

Useful scripts

Pandoc docx tectonic

pandoc -s input.docx --extract-media=./media --pdf-engine=tectonic --template=pandoc_template.tex -V documentclass="book" -V classoptions="oneside,letterpaper,openany" -V geometry="margin=1 in" -V mainfont="Noto Serif JP" -o out.pdf

Pdf page resize (pdfjam, tectonic)

pdfjam --outfile out.pdf --paper a5paper --latex /usr/bin/tectonic in.pdf

Convert Images to a pdf

magick *.jpg out.pdf

Combine pdfs

qpdf --empty --pages *.pdf -- out.pdf

pdftk *.pdf cat output out.pdf

Compress PDF

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf input.pdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dDownsampleColorImages=true \
-dColorImageResolution=150 -dNOPAUSE  -dBATCH -sOutputFile=output.pdf input.pdf
gs -q -dNOPAUSE -dBATCH -dSAFER -dOverprint=enable -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dEmbedAllFonts=true -dSubsetFonts=true -dAutoRotatePages=/None -dColorImageDownsampleType=/Bicubic -dColorImageResolution=150 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=150 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=150 -sOutputFile=output.pdf input.pdf

List all files in a directory

echo *.pdf | tr ' ' $'\n'

Extract audio from YT

youtube-dl -f bestaudio --extract-audio --audio-format mp3 --embed-thumbnail --add-metadata <url>

YT Playlists with subtitles

youtube-dl --write-auto-sub --embed-subs --merge-output-format mp4 <url> -o "%(playlist_index)2d - %(title)s.%(ext)s"

Remove wine xdg applications

rm -f ~/.local/share/mime/packages/x-wine*
rm -f ~/.local/share/applications/wine-extension*
rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*
rm -f ~/.local/share/mime/application/x-wine-extension* 

Download images from 4ch thread

wget -P pictures -nd -r -l 1 -H -D i.4cdn.org -A webm -R *?????????????s* <url>
  • P: dir prefix
  • nd: no dir hierarchy
  • r: recursive
  • l: recursion depth level
  • D: domain list
  • A/R: accept/reject

Replace web links with local files for downloaded 4ch webpage

sed -i 's/https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/i\.4cdn\.org\/[a-z]{1,4}/\./g' 'file'
sed -i 's/https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/torako.wakarimasen.moe\/file\/torako\/[a-z]{1,4}\/image\/\d+\/\d+/\./g' 'file'
  • [a-z] Char class, {1,4} Quantifier, matches prev token b/w 1 to 4 times, as many times as possible
  • \d is [0-9], + is 1 or more times

Reminder

echo 'notify-send "Work day is done!"' | at 4:00PM # at now + 1 minute

Blog Workflow

Make changes, save, export (SPC m e H A), run hugo, push!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published