Skip to content

Instantly share code, notes, and snippets.

View protrolium's full-sized avatar

Ꮹανiη Ꮐaмвoα protrolium

View GitHub Profile
@protrolium
protrolium / convert-pdf-to-png.md
Created January 13, 2019 20:03
imagemagick + ghostscript to covert PDFs to PNG (high quality)

$ convert -verbose -density 150 -trim document.pdf -quality 100 -sharpen 0x1.0 PDF-IMAGES/image.png

@protrolium
protrolium / ghostscript-pdf.md
Last active December 24, 2023 18:57
using ghostscript to compress PDF filesize

Compress PDF filesize

$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \ -dNOPAUSE -dBATCH -dColorImageResolution=150 \ -sOutputFile=output.pdf someBigFile.pdf

Combine/Merge PDFs

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf source1.pdf source2.pdf source3.pdf

@protrolium
protrolium / git-commands.md
Last active December 24, 2023 18:57
git cheatsheet

git rm --cached [filenames]

Here’s how I removed all the files I wanted to delete from one of my bin subdirectories:

git rm --cached bin/com/devdaily/sarah/\*

I use the unusual * syntax at the end of that command instead of * because you need to escape the * from the git command. In a simpler example, if there was just one file in the bin directory named Foo.class that I wanted to remove from the Git repository, I would use this command:

@protrolium
protrolium / jupyter-not-finding-packages.md
Last active July 13, 2023 22:10
Troubleshooting why Jupyter notebook wasn't finding installed python packages

Tried creating and installing needed packages into a virtual python environment, but Jupyter notebook would still throw Module not found errors, even after pip, pip3 on base installation, as well as pip, pip3 install method into the virtual environment.

conda create -n my-conda-env         # creates new virtual env
source activate my-conda-env         # activate environment in terminal
conda install jupyter                # install jupyter + notebook
jupyter notebook                     # start server + kernel

To solve, in jupyter notebook, run:

@protrolium
protrolium / dorico.md
Last active March 19, 2023 00:04
Dorico Keyboard Shortcuts

Dorico | default keybindings

adjust octave
command + option + up/down arrow key

adjust note rhythmic value
shift option left right arrow key

shift note (or staff object i.e. clef) forwards/backwards
option left right arrow key

@protrolium
protrolium / bitwig-keyboard-shortcuts.md
Last active March 11, 2023 18:07
various keyboard shortcuts for controlling Bitwig Studio DAW

Bitwig Studio Keyboard Shortcuts

1-5 - Tools
ctrl + enter - commander
0 - deactivate clip (Toggle Active)
b - insert from library
shift + f - follow playhead
/ - toggle adaptive beat grid

Panels:

@protrolium
protrolium / find_command.md
Last active March 9, 2023 23:22
reference sheet for python / virtual environments / jupyter notebooks

find all virtual environments

find ~ -type f -name "activate" -exec egrep -l nondestructive /dev/null {} \; 2>/dev/null

alternative (more broad):
find ~ -d -name "site-packages" 2>/dev/null

@protrolium
protrolium / fix_exfat_drive.md
Created February 1, 2023 16:42 — forked from scottopell/fix_exfat_drive.md
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
@protrolium
protrolium / videogrep-notes.md
Created January 14, 2023 00:51
some tasks with videogrep

list video subtitles

yt-dlp --list-subs [video url]

download video subtitles with yt-dlp after downloading video

yt-dlp --skip-download --write-sub --write-auto-sub --sub-lang "en.*" [video url]

rename .vtt or srt to match video name

check video for most frequent words with --ngrams [int]

`videogrep -i path/to/file --ngrams 1

TiddlyWiki: Getting Started with digital gardens, networked thinking and non-linear research

4 April 2021
Gavin Gamboa
@gavcloud

Overview

We will be diving into the Tiddlywiki framework (TW), which is an open-source tool great for compiling notes, research, bookmarking, and making non-linear and personalized knowledge maps. In my case I used it to build a virtual portfolio and bookcase for logging my reading notes and keeping track of my projects.

Prerequisites