Skip to content

Instantly share code, notes, and snippets.

View marcust's full-sized avatar

Marcus More-Thiesen marcust

View GitHub Profile
@marcust
marcust / upo-rss-export.pl
Created October 19, 2011 19:28
Export use.perl.org content as RSS
#!/usr/bin/perl -w
use strict;
use SOAP::Lite;
use XML::RSS;
use DateTime::Format::Flexible;
use DateTime::Format::Mail;
my $user = shift ||
@marcust
marcust / git-swap
Created October 30, 2011 09:53
Git Swap: Swap the two upmost commits
#!/bin/sh
# Copyright (c) 2011 by Marcus Thiesen (marcus@thiesen.org)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# m
@marcust
marcust / github-events.js
Created October 31, 2011 21:08
Playing a little bit with Github Event streams
(function() {
"use strict";
var user = "marcust";
var url = "https://api.github.com/users/" + user +"/events?callback=?";
function handleDefaultEvent( repoElement, timeElement, payloadHandler ) {
var element = document.createElement('div');
element.appendChild( payloadHandler() );
@marcust
marcust / git-tracking
Created December 15, 2011 09:02
git-tracking - show information about what the current branch is tracking
#!/bin/sh
CURRENT_BRANCH=$(git name-rev --name-only HEAD)
REMOTE_REF=$(git config --get-regexp branch.$CURRENT_BRANCH.merge | cut -d' ' -f 2 | sed -e 's|refs/heads/||');
REMOTE=$(git config --get-regexp branch.$CURRENT_BRANCH.remote | cut -d' ' -f 2);
if [ -z "$1" -o "$1" = 'branch' ]; then
echo $REMOTE_REF
fi;
@marcust
marcust / update-dnsmasq
Last active August 3, 2016 06:21
Nameserver setup script for OpenVPN in combination with Ubuntu's NetworkManager and dnsmasq
#!/bin/bash
#
# Parses DHCP options from openvpn to send to dnsmasq via dbus
# To use set as 'up' and 'down' script in your openvpn *.conf:
# up /etc/openvpn/update-dnsmasq
# down /etc/openvpn/update-dnsmasq
#
# Used snippets of resolvconf script by Thomas Hood and Chris Hanson.
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
#
#!/bin/sh
set -ue
IMAGE_WIDTH=692
IMAGE_HEIGHT=692
WIDTH=28
HEIGHT=21
COUNT=$(($WIDTH * $HEIGHT))
@marcust
marcust / start-ueboom.sh
Created March 14, 2016 19:40
Power on a UE Boom via LE Blootooth commands using gatttool
#!/bin/sh
set -ue
HANDLE=0x0003
VALUE=4480ebedc17401
MAC=88:C6:26:1E:F5:38
gatttool -b $MAC --char-write-req --handle=$HANDLE --value=$VALUE