Skip to content

Instantly share code, notes, and snippets.

View alchem0x2A's full-sized avatar
👨‍🍼

T.Tian alchem0x2A

👨‍🍼
View GitHub Profile
@alchem0x2A
alchem0x2A / Boot Into LiveCD from Grub.md
Last active July 6, 2023 20:26 — forked from carlitoplatanito/Boot Into LiveCD from Grub
Boot into a LiveCD from Grub when bootable CD or USB is broken on old PC

Useful command when Alt+power fails in macbook installation

  1. Determine the disk number
# Enter grub cmdline by pressing Right-Shift and c
grub> ls
(proc) (hd0) ...
@alchem0x2A
alchem0x2A / ffmpeg-compress-mp4
Created March 19, 2020 11:20 — forked from lukehedger/ffmpeg-compress-mp4
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@alchem0x2A
alchem0x2A / compress-pdf-with-gs.md
Created March 19, 2020 11:19 — forked from guifromrio/compress-pdf-with-gs.md
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@alchem0x2A
alchem0x2A / uninstall.sh
Created July 5, 2018 13:00 — forked from myusuf3/uninstall.sh
how to cleanly uninstall python packages installed with python setup.py
# Next time you need to install something with python setup.py -- which should be never but things happen.
python setup.py install --record files.txt
# This will cause all the installed files to be printed to that directory.
# Then when you want to uninstall it simply run; be careful with the 'sudo'
cat files.txt | xargs sudo rm -rf