Skip to content

Instantly share code, notes, and snippets.

@wandernauta
wandernauta / sp
Last active April 16, 2024 15:37
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
augeas { "add sss to nsswitch":
context => "/files/etc/nsswitch.conf",
changes => [
"set database[. = 'passwd']/service[last()+1] 'sss'",
],
onlyif => "match database[. = 'passwd']/service[. = 'sss'] size == 0",
}
### Keybase proof
I hereby claim:
* I am wandernauta on github.
* I am wandernauta (https://keybase.io/wandernauta) on keybase.
* I have a public key whose fingerprint is 48B7 5653 600D 17BB A5FF 233D B3DC C8CA BAD3 EEEE
To claim this, I am signing this object:
@wandernauta
wandernauta / Main.hs
Last active November 30, 2016 16:15
Floating-point Haskell type for use in VW diesel engines
import VWFloat
testResult :: VWFloat
testResult = 214.0
limit :: VWFloat
limit = 200.0
main = do
putStrLn "Emissions within limit?"
import com.fasterxml.jackson.databind.ObjectMapper;
public class Example {
public static void main(String[] args) throws Exception {
String jsonInput = "{\"name\": \"Redshirt\", \"phaserToKill\": true}";
new ObjectMapper().readValue(jsonInput, StarfleetEnsign.class);
}
}
<xsl:template>a<![CDATA[</xsl:template>]]>b</xsl:template>
http://abcde.einval.com/download/abcde-2.7.tar.gz
http://alioth.debian.org/frs/download.php/file/3977/minicom-2.7.tar.gz
http://aphyr.com/riemann/riemann-0.2.9.tar.bz2
http://archive.apache.org/dist/jena/binaries/apache-jena-3.0.1.tar.gz
http://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-2.3.1.tar.gz
http://archive.apache.org/dist/jmeter/binaries/apache-jmeter-2.11.tgz
http://archive.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz
http://archive.mozilla.org/pub/thunderbird/releases/38.6.0/source/thunderbird-38.6.0.source.tar.bz2
http://archives.eyrie.org/software/kerberos/pam-krb5-4.7.tar.gz
http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-0.8.13.tar.gz
<!DOCTYPE x [ <!ENTITY y "a]>b"> ]>
<x>
<a b="&y;>" />
<![CDATA[[a>b <a>b <a]]>
<?x <a> <!-- <b> ?> c --> d
</x>
@wandernauta
wandernauta / pithread.c
Created December 3, 2013 13:12
pithread.c
// Includes
#include <math.h> // for pow
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
// Useful macro's
#define lock pthread_mutex_lock(&job->mutex);
@wandernauta
wandernauta / wander.c
Created November 26, 2013 13:59
Mergesort implementatie
#include "as1_t2.h"
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
// CONFIGURATION.
// Change these to change the type of array msort sorts, or the key it sorts
// on.