Skip to content

Instantly share code, notes, and snippets.

Rasmus Sten pajp

Block or report user

Report or block pajp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mastomigrate.sh
#!/bin/bash
# Script to migrate a Mastodon-exported following list to micro.blog
# Generate an API key here: https://micro.blog/account/apps
mbapikey=AABBCCDDEEFF001122
# Then go to your Mastodon instances data export, e.g. https://mastodon.social/settings/export
# where you can download your following list in CSV format
# Then simply pipe that list to this script, for example:
View gist:4b6b27fa1a762481bbe1
### Keybase proof
I hereby claim:
* I am pajp on github.
* I am pajp (https://keybase.io/pajp) on keybase.
* I have a public key whose fingerprint is 06BE 9349 9DBA FE81 D8DF E6BD 3659 18D4 04C2 87D3
To claim this, I am signing this object:
View gist:214deae2821b27916191
cp_dmg() {
dmg="$1"
file="$2"
destination="$3"
mountpoint=$(hdiutil attach "$dmg" -nobrowse -plist|xpath '//key[.="mount-point"]/following-sibling::*[1]' 2> /dev/null|sed -e 's/<\/*string>//g')
cp "${mountpoint}/$file" "$destination"
hdiutil detach -quiet "$mountpoint"
}
View gist:9a5ef091825431de254d
~/opensc-0.14.0$ MacOSX/build
+ test -x ./configure
+ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
View keybase.md

Keybase proof

I hereby claim:

  • I am pajp on github.
  • I am pajp (https://keybase.io/pajp) on keybase.
  • I have a public key whose fingerprint is DA73 AA92 1D95 1CBE CFC2 8B1E 9F2D 4844 DCA5 ACB4

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am pajp on github.
  • I am pajp (https://keybase.io/pajp) on keybase.
  • I have a public key whose fingerprint is 9FFF 5FAC 43A0 D590 3B58 E7E4 F4C1 5A36 5E3D 8D51

To claim this, I am signing this object:

@pajp
pajp / lights-set.js
Created Mar 4, 2014
node.js script to set all LIFX bulbs on or off, will keep on trying until 'expectedbulbs' number of lamps are in the desired state
View lights-set.js
var lifx = require('./lifx');
var util = require('util');
var lx = lifx.init();
var expectedbulbs = 2;
var target;
var bulbsAtTarget = [];
var startTime = new Date().getTime();
function processBulbState(address, powerstate) {
var atTarget = target ? powerstate > 0 : powerstate == 0;
if (atTarget) regBulbAtTarget(address);
@pajp
pajp / com.f-secure.orspclient.plist
Created Feb 19, 2014
Mac ORSP launchd plist with debug logging enabled
View com.f-secure.orspclient.plist
<?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>InitGroups</key>
<false/>
<key>GroupName</key>
<string>daemon</string>
<key>Label</key>
<string>com.f-secure.orspclient</string>
@pajp
pajp / vpn-report.sh
Created Jan 10, 2014
Generate a report of all VPN connects, system sleeps, and "location-awareness" messages for the last seven days. "location-awareness" log messages are generated by ControlPlane actions that are triggered based on my geographical location (home or work).
View vpn-report.sh
#!/bin/sh
reportfile=/vpn-reports/`date +%Y-%m-%d`.txt
echo "**** VPN report generated @ `date` ****" > $reportfile
syslog -k Sender pppd \
-k Message "L2TP connection established." \
-o -k Message "L2TP disconnected" \
-o -k Sender location-awareness \
-k Time ge -7d \
@pajp
pajp / urlwatch
Created Dec 2, 2013
(OS X) Watch a URL and display a Notification Center notification when the URL has changed
View urlwatch
#!/bin/bash
if [ -z "$1" ] ; then
echo "Supply a URL to watch."
exit 1
fi
tempfile1=`mktemp -t urlwatch`
tempfile2=`mktemp -t urlwatch`
You can’t perform that action at this time.