Skip to content

Instantly share code, notes, and snippets.

Avatar

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

View GitHub Profile
@protrolium
protrolium / jq-helper.md
Created Aug 13, 2022
jq commands and syntax
View jq-helper.md

Remove sections of a string, filtering out all that contain "RT"

cat tweets.json | jq '.[].text | select(contains("RT") | not)'

@protrolium
protrolium / ghostscript-compress-pdf.md
Last active May 28, 2022
using ghostscript to compress PDF filesize
View ghostscript-compress-pdf.md

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

@protrolium
protrolium / img2pdf.md
Created May 16, 2022
working command for turning dir of jpegs into pdf
View img2pdf.md

$ img2pdf --first-frame-only *.jpg -o document.pdf

@protrolium
protrolium / macos-purgable-space.md
Last active Dec 7, 2021
ways of clearing local hd of unwanted storage build-up
View macos-purgable-space.md

tmutil listlocalsnapshotdates / |grep 20|while read f; do tmutil deletelocalsnapshots $f; done

Wait until it's done deleting the local snapshots. Restart your computer and it will create a new local snapshot.

Alternatively:

tmutil listlocalsnapshots /

and with

View google-cloud-platform.md

GCP Cloudshell

$ gcloud projects list

troubleshoot ssh
$ gcloud alpha compute ssh "tikapi" --zone=us-west2-a --troubleshoot

$ gcloud compute config-ssh

initialize configuration

@protrolium
protrolium / bitwig-keyboard-shortcuts.md
Last active Jul 29, 2022
various keyboard shortcuts for controlling Bitwig Studio DAW
View bitwig-keyboard-shortcuts.md

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 / python_notes.md
Last active Jun 11, 2021
reference sheet for python / virtual environments / jupyter notebooks
View python_notes.md

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 / jupyter-not-finding-packages.md
Last active Jul 17, 2021
Troubleshooting why Jupyter notebook wasn't finding installed python packages
View jupyter-not-finding-packages.md

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:

View tw-workshop-lessonplan.md

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

@protrolium
protrolium / rename.md
Last active Mar 5, 2021
rename command utility
View rename.md

rename | syntax and examples

brew install rename
to install

rename "s/SEARCH/REPLACE/g" *

This will replace the string SEARCH with REPLACE in every file (that is, *). The /g means global, so if you had a SEARCH_SEARCH.jpg, it would be renamed REPLACE_REPLACE.jpg. If you didn't have /g, it would have only done substitution once, and thus now named REPLACE_SEARCH.jpg. If you want case-insensitive, add /i (that would be, /gi or /ig at the end).

Examples