Skip to content

Instantly share code, notes, and snippets.

@Thermionix
Thermionix / gen.coreboot.info.sh
Last active April 5, 2017 09:38
generate coreboot dev info
#!/bin/bash
command -v lspci >/dev/null 2>&1 || { echo "lspci (pkg pciutils) required for this script" >&2 ; exit 1 ; }
command -v lsusb >/dev/null 2>&1 || { echo "lsusb (pkg usbutils) required for this script" >&2 ; exit 1 ; }
command -v dmidecode >/dev/null 2>&1 || { echo "dmidecode (pkg dmidecode) required for this script" >&2 ; exit 1 ; }
command -v biosdecode >/dev/null 2>&1 || { echo "biosdecode (pkg dmidecode) required for this script" >&2 ; exit 1 ; }
command -v dmesg >/dev/null 2>&1 || { echo "dmesg (pkg util-linux) required for this script" >&2 ; exit 1 ; }
command -v git >/dev/null 2>&1 || { echo "git (pkg git-core) required for this script" >&2 ; exit 1 ; }
command -v svn >/dev/null 2>&1 || { echo "svn (pkg subversion) required for this script" >&2 ; exit 1 ; }
command -v make >/dev/null 2>&1 || { echo "make (pkg build-essential base-devel ...) required for this script" >&2 ; exit 1 ; }
@Thermionix
Thermionix / gist:8588489
Last active January 4, 2016 07:28
opensuse 13.1 NAS server
# install opensuse, 'server minimal selection', enable ssh
# disable firewall (and on boot) under security in yast
zypper install btrfsprogs nano smartmontools msmtp-mta mailx samba tmux
######## network interface bonding ##########
# yast > network devices > network settings
# Overview > Add > Device type = bond
@Thermionix
Thermionix / purge-old-kernels
Last active April 19, 2018 17:22
cron script for ubuntu servers to automatically purge old kernels, quickly insert with; curl https://gist.github.com/Thermionix/7797652/raw/purge-old-kernels | bash
#!/bin/bash
cat <<-'EOF' | sudo tee /usr/local/sbin/purge-old-kernels
#!/bin/sh
#This script will keep the currently running kernel and 2 latest
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
if [ "$(id -u)" != 0 ]; then
echo "ERROR: This script must run as root." 1>&2
@Thermionix
Thermionix / gist:7421858
Created November 11, 2013 22:42
BTSync as windows service
using http://nssm.cc/usage
Install BTSync
Configure your shared folders
Make sure you uncheck the "Start btsync when windows starts" option in the preferences.
Download nssm, as an admin run "nssm install BTSync"
Put in the path to the BTSync.exe
Open windows service manager and tell it to run BTSync as the user you just used to install.
Make sure BTSync isn't already running, then start the service.
@Thermionix
Thermionix / mount.iso.psm1
Last active November 15, 2022 10:39
powershell mount/unmount iso for all versions of windows
# Uses http://www.ltr-data.se/opencode.html/#ImDisk virtual disk driver for windows 7 or less
# Tries to use chocolatey to install imdisk
# Sample use case:
# Import-Module ".\mount.iso.psm1"
# Invoke-IsoExe "C:\test.iso" "setup.exe" "/passive"
function Mount-Iso([string] $isoPath)
{
if ( -not (Test-Path $isoPath)) { throw "$isoPath does not exist" }
@Thermionix
Thermionix / gist:6801791
Created October 2, 2013 22:59
NAnt functions
<assemblyfileset id="sys.assemblies">
<include name="System.dll" />
<include name="System.Net.dll" />
</assemblyfileset>
<script language="C#">
<references refid="sys.assemblies" />
<imports>
<import namespace="System.Net" />
<import namespace="System.Net.Sockets" />
@Thermionix
Thermionix / pfsense.setup.sh
Last active January 27, 2016 23:20
pfsense setup on alix board
#!/bin/bash
read -e -n1 -p "flash pfSense to CF card [y/N]: " OPTION
if [ "$OPTION" == "y" ]; then
imgfile=pfSense-2.1-RELEASE-1g-i386-nanobsd.img.gz
if [ ! -f $imgfile ]; then
read -e -n1 -p "download $imgfile [y/N]: " OPTION
if [ "$OPTION" == "y" ]; then
@Thermionix
Thermionix / videobridge.conf
Last active December 22, 2015 19:09
jitsi videobridge upstart
# /etc/init/videobridge.conf
description "jitsi videobridge"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on shutdown
exec start-stop-daemon --start \
@Thermionix
Thermionix / stream.jblive.sh
Created August 26, 2013 00:31
jblive stream rtsp audio only
#!/bin/bash
ffplay -vn -rtsp_transport tcp -allowed_media_types audio -nodisp rtsp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream
@Thermionix
Thermionix / owncloud.conf
Created August 2, 2013 03:15
nginx conf for owncloud 5.0 in subdir
location /owncloud {
client_max_body_size 1024M;
location ~ ^/owncloud/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
rewrite ^/owncloud/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/owncloud/.well-known/host-meta.json /public.php?service=host-meta-json last;
rewrite ^/owncloud/.well-known/carddav /remote.php/carddav/ redirect;