Skip to content

Instantly share code, notes, and snippets.

View Denperidge's full-sized avatar

Cat Denperidge

View GitHub Profile
@Denperidge
Denperidge / spleeter-bash.md
Last active June 26, 2020 22:15
A simple cli that will run spleeter without too much hassle

Spleeter-Bash

Simply run spleeter-bash.sh "/path/to/file" "/path/to/file/x/if/multiple/", select the model you'd like to use, and done! The script will make sure the pretrained_models are saved with spleeter-bash.sh (so they don't need to be redownloaded every run) and will make sure that the output gets set in a subdirectory of the source file. (In case of multiple files, the first files' directory will be used, since Spleeter only supports one output directory)

Prerequisites

@Denperidge
Denperidge / prepend-date-recursive.bat
Last active January 2, 2021 12:47
Prepend Date modified/LastWriteTime to all files in directory and subdirectories using Powershell 7 Core
@echo off
REM Bat file intended to allow drag and drop of directories, as well as bypassing executionpolicy temporarily (instead of having to change it machine wide for a while)
pwsh -ExecutionPolicy Bypass -File "%~dp0prepend-date-recursive.ps1" "%1%"
@Denperidge
Denperidge / ffmpeg-commands.sh
Last active June 24, 2024 12:03
Some useful FFMPEG commands I've needed over time
# Add a keyframe every 1 frame (useful for working with video in Ableton - https://stackoverflow.com/a/33855249
ffmpeg -i input.mp4 -c:v libx264 -x264opts keyint=1 output.mp4
for filename in /mnt/sd/PRIVATE/AVCHD/BDMV/STREAM/*.MTS; do
echo $filename
ffmpeg -i "${filename}" -vcodec libx265 -acodec pcm_s16le "${currentdir}/$(basename ${filename}).mov" -report
done
@Denperidge
Denperidge / fixes.md
Last active August 26, 2021 12:35
Links and instructions to fix problems I've encountered!
@Denperidge
Denperidge / caddy-linux-service.sh
Last active February 28, 2024 10:49
A simple bash script that installs caddy as a service on your Linux system, merely automating the official steps described here https://caddyserver.com/docs/install#linux-service
#!/bin/bash
echo "Enter your download url that you made from here: https://caddyserver.com/download"
read downloadurl
curl --output caddy $downloadurl
chmod +x caddy
sudo mv caddy /usr/bin
@Denperidge
Denperidge / quick-multiple-ssh-key-setup.py
Last active April 10, 2021 23:24
Quickly configure ssh key access to multiple servers!
from os import chdir, path, name
from subprocess import run
"""
If you're like me and postponed setting up ssh keys for way too long
and now you have a bunch of servers to do it with, here you go!
Credit where credit is due!
SSH setup tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-2
@Denperidge
Denperidge / randomize.js
Last active May 6, 2021 20:28
Randomizer for your website. I don't recommend using this.
<script>
function rng(min, max) {
// Inclusive rng function from W3Schools https://www.w3schools.com/js/js_random.asp
return Math.floor(Math.random() * (max - min + 1) ) + min;
}
var destructibleTextElements =
jQuery("span,p,h2,h4,h5,a,label")
.filter(function() {
// Visibility check through offsetparent from from https://stackoverflow.com/a/21696585
@Denperidge
Denperidge / gulpfile.js
Last active June 19, 2021 10:33
A Gulpfile for Pug/Sass/Babel development: Pug+Sass+Autoprefixer+Babel+UglifyJS+BrowserSync
// Run the following two npm installs to get all the requirements set up
// npm install --global gulp-cli
// npm install --save-dev gulp gulp-pug node-sass gulp-sass gulp-autoprefixer gulp-babel @babel/core @babel/preset-env gulp-uglify browser-sync gulp-plumber
// You can configure the following variables to your liking
var sourceDir = 'src/';
var destDir = 'docs/';
var pugGlob = `${sourceDir}**.pug`;
var sassGlob = [`${sourceDir}**.scss`, `!${sourceDir}/**/vendor/**`];
var jsGlob = [`${sourceDir}**/*.js`, `!${sourceDir}/**/vendor/**`];
@Denperidge
Denperidge / $ nextcloud-postgres-docker.md
Last active August 14, 2021 15:14
Raspberry Pi Nextcloud-Docker

Raspberry Pi Nextcloud-Docker

  • MySQL/MariaDB doesn't have an armhf docker image by default, hence postgresql is used instead
  • For some reason, the postgres env variables don't seem to work. If that's the case, use nextcloud for for DB and USER, and localhost:5432 for HOST
  • I used Caddy for HTTPS encryption
  • NEXTCLOUD_DATA_DIR=/var/www/html/data fixes a config write issue. The fix was found on this SO post!
@Denperidge
Denperidge / @README
Last active November 21, 2022 12:03
Setup a Terraria server on Raspbian with one shell script!
Archived!
This has been moved to a dedicated repo: https://github.com/denperidge/terraria-raspbian-server
------------------------------------------
------------------------------------------