Skip to content

Instantly share code, notes, and snippets.

@Holzhaus
Holzhaus / format_hdd.sh
Created May 12, 2014 13:36
mkfs.ext4 for large file drives
#!/bin/sh
if [[ $UID -ne 0 ]]; then
echo "$0 must be run as root."
exit 1
fi
if [[ $# -ne 2 ]]; then
echo "Invalid number of arguments."
echo "Usage: $0 BLK_DEV LABEL"
exit 2
fi
@Holzhaus
Holzhaus / phrase_matcher.py
Last active August 29, 2015 14:05
A working phrase matching example
import itertools
import string
import re
class PhraseMatcher(object):
ACTIONS = []
WORDS = {}
@classmethod
def get_possible_phrases(cls):
# Sample implementation, there might be a better one
@Holzhaus
Holzhaus / julius.py
Created October 10, 2014 18:35
Very Basic Julius STT Engine for Jasper
# You need to download the VoxForge Dict from:
# http://www.repository.voxforge1.org/downloads/SpeechCorpus/Trunk/Lexicon/VoxForge.tgz
# and put it to this location:
# /home/jan/Downloads/VoxForge.tgz
import os
import re
import tempfile
import subprocess
import shutil
@Holzhaus
Holzhaus / PKGBUILD
Created October 17, 2014 18:36
RTL-SDR PKGBUILD
# By Jan Holthuis <[email protected]>
pkgname=rtl-sdr-keenerd-git
pkgver=0.0.0
pkgrel=1
pkgdesc="Keenerd's RTL-SDR experimental branch"
arch=('i686' 'x86_64' 'armvh6')
url="https://github.com/keenerd/rtl-sdr"
license=('MIT')
depends=('libusb>=1.0')
@Holzhaus
Holzhaus / adblockupdater.sh
Created December 26, 2014 01:44
Adblock script for OpenWRT
# Adblock script for OpenWRT
# (c) 2014 by Jan Holthuis
#
# This is an adblocker script for OpenWRT. Simply run this script as a
# daily cronjob on your OpenWRT-router. This works since OpenWRT
# revision 39312 [1] and does not manipulate any files in /etc/.
# Instead, this adds the adblock serverlist as a separate file
# to /tmp/dnsmasq.d/. It also checks the file with grep to make sure
# that it doesn't contain malicious commands.
#
@Holzhaus
Holzhaus / output.txt
Created January 30, 2015 18:47
ODROID-C1 pulseaudio output
# pulseaudio -v
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 5.0
I: [pulseaudio] main.c: Page size is 4096 bytes
I: [pulseaudio] main.c: Machine ID is 3a6485ee48ce47a6a28f1945c45447c5.
I: [pulseaudio] main.c: Using runtime directory /root/.config/pulse/3a6485ee48ce47a6a28f1945c45447c5-runtime.
I: [pulseaudio] main.c: Using state directory /root/.config/pulse.
I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-5.0/modules.
I: [pulseaudio] main.c: Running in system mode: no
@Holzhaus
Holzhaus / c1_displaytool.sh
Created March 23, 2015 15:56
ODROID-C1 display tool
#!/bin/bash
#
# Copyright (c) 2015, Jan Holthuis <[email protected]>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
@Holzhaus
Holzhaus / cell-scan-conv.py
Last active August 29, 2015 14:18
Cell Scan Converter
#!/usr/bin/env python
"""
cell-scan-conv.py - A simple script to mass convert images while keeping only
some of the RGB channels to make cells more visible on cell
scans. Please note that ImageMagick's convert command needs
to be installed and in your $PATH.
Copyright (c) 2015, Jan Holthuis
All rights reserved.
@Holzhaus
Holzhaus / PKGBUILD
Created April 18, 2015 16:55
PKGBUILD for libretro-pocketsnes-git
# Maintainer: mfussenegger
# Contributor: Jan Holthuis <holthuis dot jan at googlemail dot com>
pkgname=libretro-pocketsnes-git
pkgver=r15.ac83fb2
pkgrel=1
pkgdesc="ARM based SNES emulator for libretro"
arch=('arm' 'armv6h' 'armv7h')
url="https://github.com/libretro/pocketsnes-libretro"
license=('custom')
makedepends=('git')
@Holzhaus
Holzhaus / pacman-mount.sh
Last active August 29, 2015 14:19
Simple pacman script to fix broken USB-Stick installations
#!/bin/bash
#
# This is a simple script I wrote to fix broken ArchLinuxARM installation
# on USB drives or SD cards. If you encountered a crash, power failure or
# kernel panic while updating the kernel, systemd or something like that
# and are unable to boot your device, you can simply plug the USB drive/
# SD card into your desktop computer and run this script.
# You can't simply chroot and run the script from there, because your
# desktop computer's architecture is probably x86/x86_64 and your single
# board computer is ARM-based.