Skip to content

Instantly share code, notes, and snippets.

@jakestanley
jakestanley / spleeter.sh
Created February 18, 2022 00:46
spleeter_cheatsheet
# assuming an existing spleeter setup
cd ~/tmp/spleeter
# current directory structure should include output and pretrained_models
spleeter separate -p spleeter:4stems -o output track.mp3
@jakestanley
jakestanley / pandoc_cheatsheet.sh
Created February 4, 2022 14:13
pandoc cheat sheet (mainly for markdown stuff)
# chain a bunch of markdown files together to produce a html page for a blog or similar
pandoc -s header.md 2022-01-04.md footer.md -o 2022-01-04.html -t html --metadata title="2022-01-04"
@jakestanley
jakestanley / youtube-dl_cheatsheet.sh
Last active February 4, 2022 14:11
youtube-dl cheat sheet
# gracefully terminate a youtube-dl stream capture after 30 minutes
timeout -s SIGINT 30m youtube-dl <video_url>
# extract audio from youtube video
youtube-dl --extract-audio --audio-format mp3 --output "%(title)s.%(ext)s" \
https://youtu.be/<video_key>
@jakestanley
jakestanley / bashcheatsheet.sh
Created February 4, 2022 14:08
bash cheat sheet (may include sh and zsh stuff)
# randomise lines to a file (i'm aware of the UUOC here)
cat ~/Desktop/tickets.txt | sort --random-sort >> ~/Desktop/random.txt
@jakestanley
jakestanley / mavencheatsheet.sh
Last active February 4, 2022 14:16
maven cheat sheet
# locate single artifact in the dependency tree
mvn dependency:tree -Dincludes=:tomcat-embed-core
# analyse and push sonar report (substitute example.com obviously)
./mvnw -e -P coverage \
-Dsonar.branch.name=$(git rev-parse --abbrev-ref HEAD) \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dsonar.host.url=https://sonar.example.com \
-Ddependency-check.skip=true \
--batch-mode \
@jakestanley
jakestanley / tmuxcheatsheet.sh
Last active February 4, 2022 14:09
tmux cheat sheet
# create or attach to a tmux session
tmux new-session -A -s PERSONAL
import bpy
exportFolder = "D:\\Dropbox\\Art\\OBJ\\YoutubeTutorial\\"
selected = []
for a in bpy.data.scenes['Scene'].objects:
if a.select_get():
selected.append(a)
#!/usr/bin/env bash
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo apt-get install git zsh vim curl tmux
# install nvidia 2070 driver
# sudo apt-get install nvidia-driver-430
@jakestanley
jakestanley / home_directory_init.bash
Last active July 13, 2019 20:48
home directory initialisation script
#!/usr/bin/env bash
# My home directory structure is inspired by the Unix File
# System structure with an emphasis on being light weight,
# simple and easy to migrate. I have a tendency to hop between
# various operating systems and (often virtual) machines. This
# exists for my personal reference.
#
# Your home directory will be populated with a number of folders:
#
@jakestanley
jakestanley / archive.bash
Last active October 4, 2018 07:50
clean and archive a git directory that contains many repos
#!/usr/bin/env bash
DATE=$(date '+%Y-%m-%dT%H-%M-%S')
TEMP_DIR=$HOME/tmp/archive
ARCHIVE_DIR=$HOME/archive
rm -rf $TEMP_DIR
mkdir -p $ARCHIVE_DIR
mkdir -p $TEMP_DIR