Skip to content

Instantly share code, notes, and snippets.

@probonopd
probonopd / ShairPort for squeezelite (LMS)
Last active August 29, 2015 13:56
Running ShairPort/ShairTunes/AirTunes on squeezeplug distro (Raspbian wheezy based) to serve to squeezelite clients on WR703n
# Running ShairPort/ShairTunes/AirTunes on squeezeplug distro (Raspbian wheezy based)
# to serve to squeezelite clients on WR703n
# Install in Logitech Media Server: Click on Settings, then select
# the Plugins tab, at the bottom of the page add the repo:
# http://raw2.github.com/StuartUSA/shairport_plugin/master/public.xml
# Copy precompiled helper binary in place
sudo cp /var/lib/squeezeboxserver/cache/InstalledPlugins/\
Plugins/ShairTunes/shairport_helper/pre-compiled/\
@probonopd
probonopd / schwaebische_orbituaries.py
Created March 9, 2014 15:41
Create an RSS feed out of schwaebische.de orbituaries images
#!/usr/bin/python
#
# Create an RSS feed out of schwaebische.de orbituaries images
#
import os, sys, time, datetime, urllib2, re
from BeautifulSoup import BeautifulSoup
debug = False
@probonopd
probonopd / connect_ssh_macaddr.sh
Last active August 29, 2015 13:57
Connect to the device with known MAC address but unknown Ethernet addres
#!/bin/bash
# Connect to the device with known MAC address but unknown Ethernet addres
## Or simply:
## sudo nmap -sP 192.168.180.0/24 | grep "FE:ED"
MAC="10:FE:ED" # Can be just partial
OWNIP=$(LANG="" ifconfig | grep "inet addr" | head -n 1 | cut -d ":" -f 2 | cut -d " " -f 1)
SUBNET="$(echo $OWNIP | cut -d "." -f 1).$(echo $OWNIP | cut -d "." -f 2).$(echo $OWNIP | cut -d "." -f 3).0/24"
ssh $(sudo nmap -sP $SUBNET | grep FE:ED -C 2 | head -n 1 | cut -d " " -f 5) -l root
@probonopd
probonopd / fast-sd-flashing.sh
Last active August 29, 2015 13:57
Fast dd SD card flashing on Mac
# Flash FAST (9 MB/sec with SanDisk Class 10 16 GB card; roughly 8 minutes for 4 GB)
sudo dd if=$FILE of=/dev/rdiskX bs=1m
# Check the status
# Run on second terminal
while pgrep ^dd; do pkill -INFO dd; sleep 10; done
# Or, use this GUI
http://www.gingerbeardman.com/dd-gui/dd-gui-021.zip
@probonopd
probonopd / announce
Last active August 29, 2015 13:58
Announce services using tinysvcmdns
#!/bin/sh /etc/rc.common
# This script should not have the same name as one of the binaries
# that gets launched by it, otherwise it terminates itself rather
# than shutting down cleanly.
START=94
STOP=1
start() {
@probonopd
probonopd / 0_reuse_code.js
Created June 21, 2014 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: 311c206e82386107364cd0e6b042e88d87bd7a68
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
Clang: 5.1 build 503
@probonopd
probonopd / Antergos Arch OS ISO boot from loop GRUB2
Last active August 29, 2015 14:08
WORKING Antergos Arch OS ISO boot from loop GRUB2
menuentry "Antergos" {
iso_path="/boot/iso/antergos-2014.08.07-x86_64.iso"
search --no-floppy --file ${iso_path} --set
live_args="for-arch --> img_loop=${iso_path} img_dev=/dev/sda1 earlymodules=loop"
custom_args=""
iso_args="archisobasedir=arch archisolabel=ANTERGOS quiet"
loopback loop ${iso_path}
linux (loop)/arch/boot/vmlinuz ${live_args} ${custom_args} ${iso_args}
initrd (loop)/arch/boot/archiso.img /boot/iso/additional-initramfs/initramfs
}
@probonopd
probonopd / fstab
Created November 22, 2014 17:44
WORKING extroot /etc/config/fstab for OpenWrt Barrier Breaker 14.07-rc2
config global automount
option from_fstab 1
option anon_mount 1
option delay_root 3
config mount
option target /overlay
option device /dev/sda1
option fstype ext4
option options rw,sync,noatime
@probonopd
probonopd / shairport
Last active August 29, 2015 14:10
WORKING SHAIRPORT ON wr703n http://stdio.be/blog/2014-08-26-Shairport-on-TL-WR703N/ for sending AirPlay audio to the TP-Link TL-WR703N
cat > /etc/init.d/shairport <<\EOF
#!/bin/sh /etc/rc.common
NAME='shairport'
START=99
start() {
SPEAKER=$(amixer scontrols | head -n 1 | cut -d "'" -f 2)
amixer sset $SPEAKER '80%' || exit 1
sleep 2
shairport -d -a $(uci get system.@system[0].hostname)