Skip to content

Instantly share code, notes, and snippets.

@Jip-Hop
Jip-Hop / custom_tiny_core_read_only_notes.sh
Created Apr 25, 2021
Booting from Custom Tiny Core Linux for Read Only Filesystem (SED PBA) Notes
View custom_tiny_core_read_only_notes.sh
# references
# https://fabianstumpf.de/articles/tinycore_images.htm
# https://gist.github.com/dankrause/2a9ed5ed30fa7f9aaaa2
# https://github.com/Drive-Trust-Alliance/sedutil/wiki/Encrypting-your-drive
# follow these steps on Ubuntu
sudo su
qemu-img create core-image.img 120M -f raw
modprobe nbd max_part=8 && sleep 2 && qemu-nbd -c /dev/nbd0 core-image.img -f raw
@Jip-Hop
Jip-Hop / custom-tinycore.sh
Created Apr 25, 2021 — forked from dankrause/custom-tinycore.sh
Create a custom tinycore linux iso. Adjust the config at the beginning of the script, or supply a conf as the first arg. Requires xorriso.
View custom-tinycore.sh
#!/bin/bash
set -e
function cleanup() {
# clean up our temp folder
rm -rf "${TMPDIR}"
}
trap cleanup EXIT
@Jip-Hop
Jip-Hop / autorun.sh
Created Feb 28, 2021
Autorun Synology Hyper Backup and Integrity Check with Email Notifications
View autorun.sh
#!/bin/sh
# This script is to be used in combination with Synology Autorun:
# - https://github.com/reidemei/synology-autorun
# - https://github.com/Jip-Hop/synology-autorun
#
# You need to change the task_id to match your Hyper Backup task.
# Get it with command: more /usr/syno/etc/synobackup.conf
#
# I like to keep "Beep at start and end" disabled in Autorun, because I don't
@Jip-Hop
Jip-Hop / index.html
Created Jan 4, 2020
Native window open not transparent...
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Transparent!</title>
</head>
<body>
<h1>Transparent!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
View playkey.lua
-- PLAY key menu
-- Use PLAY button to toggle RAW video preferences
require("config")
play_key_timestamp = nil
currently_selected_preset = nil
last_run_preset = nil
before_last_run_preset = nil
-- TODO: find a better way to set resolution in "RAW video" submenu
View ETC.lua
-- Crop mode toggle
-- Toggle between 3x crop mode
require('config')
-- end this script if not eosm
if camera.model_short ~= "EOSM" then
display.notify_box("Script not working on this cam");
msleep(2000);
View median_wav.py
import os, numpy as np
from scipy.io import wavfile
def show_info(aname, a):
print "Array", aname
print "shape:", a.shape
print "dtype:", a.dtype
print "min, max:", a.min(), a.max()
audio_folder_name = 'left_audio_track'
View average_wav.py
import os, numpy as np
from scipy.io import wavfile
def show_info(aname, a):
print "Array", aname
print "shape:", a.shape
print "dtype:", a.dtype
print "min, max:", a.min(), a.max()
audio_folder_name = 'right_audio_track'
View average_frames.py
# references used:
# http://stackoverflow.com/questions/17291455/how-to-get-an-average-picture-from-100-pictures-using-pil
# http://stackoverflow.com/questions/16135677/efficient-way-to-find-median-value-of-a-number-of-rgb-images
import os, numpy, PIL
from PIL import Image
start_frame = 0 # the frame number starts at 0
jpgs_in_dir = {}
max_frames_in_dir = {}