Skip to content

Instantly share code, notes, and snippets.

View dewey's full-sized avatar
👋
Click here to edit status

Philipp Defner dewey

👋
Click here to edit status
View GitHub Profile
@dewey
dewey / lastfm.php
Created June 22, 2013 16:30
Last.fm "now playing" script for Textual. Installation: Replace 'apfeltalkdewey' with your Last.fm username. Copy this script to ~/Library/Application Scripts/com.codeux.irc.textual/lastfm.php Usage: /lastfm
#!/usr/bin/php
<?php
$doc = new DOMDocument();
$doc->load("http://ws.audioscrobbler.com/2.0/user/apfeltalkdewey/recenttracks.xml?limit=1");
$arrFeeds = array();
foreach ($doc->getElementsByTagName('track') as $node) {
$itemRSS = array (
'artist' => $node->getElementsByTagName('artist')->item(0)->nodeValue,
'name' => $node->getElementsByTagName('name')->item(0)->nodeValue
);
execute pathogen#infect()
filetype plugin indent on
syntax on
set hlsearch
set showmatch
set expandtab
set shiftwidth=4
set copyindent
set tabstop=4
set incsearch
@dewey
dewey / rc
Created May 13, 2013 14:03
lftp settings: Add to ~/.lftp/rc
set ssl:verify-certificate no
set pget:default-n 10
set mirror:use-pget-n 10
set mirror:parallel-transfer-count 3
set bmk:save-passwords yes
set xfer:clobber on
@dewey
dewey / gist:5330673
Created April 7, 2013 14:16
Add OpenVPN clients and publish encrypted directory containing cert and config files.
#!/bin/bash
cd /etc/openvpn/easy-rsa/2.0/keys
if [ ! -f $1-openvpn.key ];
then
echo "Please generate the client certificate using: . /etc/openvpn/easy-rsa/2.0/build-key $1-openvpn"
echo "and reinvoke the script."
else
DIRNAME="$1-openvpn"
TMPDIR="/tmp/$DIRNAME"
ENCPW=`openssl rand -base64 32`