Skip to content

Instantly share code, notes, and snippets.

View duncan-bayne's full-sized avatar

Duncan Bayne duncan-bayne

View GitHub Profile
@duncan-bayne
duncan-bayne / sp
Last active January 16, 2022 09:53 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/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.
#
➜ ~ sudo service bluetooth start ubt0
➜ ~ sudo hccontrol -n ubt0hci remote_name_request 00:18:00:3b:92:34
BD_ADDR: 00:18:00:3b:92:34
Name: FILCO Bluetooth Keyboard
➜ ~ sudo cat /etc/bluetooth/hcsecd.conf
# ... snip ...
device {
bdaddr 00:18:00:3b:92:34;
name "FILCO Bluetooth Keyboard";
key nokey;
@duncan-bayne
duncan-bayne / uh-oh.js
Created January 5, 2017 04:08
Test script
alert('uh oh!');
@duncan-bayne
duncan-bayne / jsbin.log
Created November 16, 2016 22:50
Failure to install jsbin
➜ ~ npm -g i jsbin
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN engine sqlite3@2.2.4: wanted: {"node":">= 0.8.0 < 0.13.0"} (current: {"node":"4.6.0","npm":"2.15.9"})
npm WARN deprecated set-immediate@0.1.1: Use `setimmediate` instead
|
> sqlite3@2.2.4 install /home/duncan/node/lib/node_modules/jsbin/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
make: Entering directory '/home/duncan/node/lib/node_modules/jsbin/node_modules/sqlite3/build'
@duncan-bayne
duncan-bayne / nmcli-bounce.sh
Created April 18, 2016 05:21
Bounce NetworkManager connections on timeouts
#!/bin/bash
SSID=$1
if [ -z "$SSID" ]; then
echo "usage: nmcli-bounce SSID"
exit -1
fi
HOST=cogent.co
@duncan-bayne
duncan-bayne / gist:7111638
Created October 23, 2013 02:26
Trying to use pry-rescue and Cucumber with an Around hook.
Around do |scenario, block|
Pry::rescue do
block.call
end
end
client = RestClient::Resource.new(SATISFACTION_BOOKIES_URI,
:ssl_client_key => OpenSSL::PKey::RSA.new(File.read('client.pem'), 'mypassword'))
client.put(:object => data)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IPSec</key>
<dict>
<key>SystemConfig</key>
<dict>
<key>IPSec</key>
<dict>
@duncan-bayne
duncan-bayne / gist:4752329
Created February 11, 2013 03:35
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "atlas-dev-precise64-#{`hostname`.strip}"
config.vm.host_name = "atlas-dev-precise64-#{`hostname`.strip}"
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
config.vm.boot_mode = :gui
config.vm.network :bridged
@duncan-bayne
duncan-bayne / gist:4752282
Created February 11, 2013 03:30
ls -l ~/.rvm/archives/wayneeseguin-rvm-287a5f6/
vagrant@atlas-dev-precise64-devmac-1:~/.rvm/archives$ ls -l ~/.rvm/archives/wayneeseguin-rvm-287a5f6/
total 232
drwxr-xr-x 1 vagrant vagrant 408 Feb 9 02:42 binscripts
drwxr-xr-x 1 vagrant vagrant 272 Feb 9 02:42 config
drwxr-xr-x 1 vagrant vagrant 204 Feb 9 02:42 contrib
drwxr-xr-x 1 vagrant vagrant 204 Feb 9 02:42 docs
drwxr-xr-x 1 vagrant vagrant 102 Feb 9 02:42 examples
drwxr-xr-x 1 vagrant vagrant 204 Feb 9 02:42 gemsets
-rw-r--r-- 1 vagrant vagrant 2198 Feb 9 02:42 HACKING.md
drwxr-xr-x 1 vagrant vagrant 1632 Feb 9 02:42 help