This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin.bash | |
# stigok 22-02-2018 | |
KEYDIR=/etc/initcpio/keys | |
function help { | |
cat <<EOF | |
This hook will embed decryption keys for the encrypted root device into | |
initramfs to automatically mount the root partition after a successful | |
decryption of the boot partition. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import queue | |
import threading | |
import sys | |
class ThreadedQueue: | |
def __init__(self, task, timeout=10): | |
self.threads = dict() | |
self.queues = dict() | |
self.task = task | |
self.timeout = timeout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set screen brightness | |
# Usage: setbrightness more|less|<int> | |
DIR="/sys/class/backlight/intel_backlight" | |
MAX_VALUE=$( < $DIR/max_brightness ) | |
MAX_STEP=${MAX_STEP:-8} | |
STEP_AMOUNT=$(( $MAX_VALUE / $MAX_STEP )) | |
CURRENT_VALUE=$( < $DIR/brightness ) | |
CURRENT_STEP=$(( $CURRENT_VALUE / $STEP_AMOUNT )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int SECOND = 1000; | |
const int MINUTE = 60 * SECOND; | |
const int RESOLUTION = 1 * SECOND; | |
//const int EXTRA_TURN_TIME = SECOND; | |
const int GREEN = 0; | |
const int RED = 1; | |
const int DRY_RUN = 1; // Comment this whole line to enable gpio pins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test(): | |
print("Test method") | |
if __name__ == "__main__": | |
print("Main method") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See /boot/overlays/README for all available options | |
gpu_mem=128 | |
start_file=start_x.elf | |
fixup_file=fixup_x.dat | |
initramfs initramfs-linux.img followkernel | |
# Enable ALSA interface | |
audio=on | |
uart0=off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import dialogs, ugfx, network, badge, deepsleep | |
#import dialogs from micropython/unix/modules/dialogs.py | |
import ugfx, network, badge, time | |
mocked_messages = [ | |
'sshow: hei, verden!', | |
'krav: hello, world!', | |
'sshow: funker dette?', | |
'krav: ja :):):):)', | |
'sshow: hei, verden!', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Do something after rsync completes | |
# | |
# Usage: after-rsync <srcdir> <command> [...args] | |
set -x | |
srcdir=$1 | |
shift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Convert a video file to a cross-browser HTML5 video compatible file format | |
# | |
# Usage: vid2html5 <infile> [<outdir>] | |
# | |
# stigok jul 2017 | |
infile="$1" | |
timestamp=`date +'%Y-%m-%d-%H%M%S'` | |
outdir=${2:-.} | |
outfile=$outdir/$timestamp.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Initiates reconnect of the openvpn process | |
# | |
# Made for /etc/NetworkManager/dispatcher.d/, but should be working | |
# for /etc/network/if-up.d/ as well. | |
# | |
IFACE=$1 | |
ACTION=$2 |