Skip to content

Instantly share code, notes, and snippets.

@x2q
x2q / wordpress_importer.rb
Created March 18, 2012 00:46 — forked from stammy/wordpress_importer.rb
Import a WordPress database and generate markdown files for Jekyll
# based on the import script by icebreaker, which is based on mojombo's
# https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# https://gist.github.com/303570
# edited to rewrite image URLs to use my CloudFront URL
require 'rubygems'
require 'sequel'
require 'fileutils'
# $ export DB=my_wpdb
@x2q
x2q / ping_atftp.sh
Created September 19, 2012 08:12
Simple script to ping and then atftp a firmware image e.g. openwrt or dd-wrt
#!/bin/bash
# Simple script to ping and then atftp a firmware image
# Works on my machine and an ASUS WL-500g series router
# Usage: ./ping_atftp 192.168.1.1 openwrt-brcm47xx-squashfs.trx
EXPECTED_ARGS=2
if [ $# -ne $EXPECTED_ARGS ]; then
echo "Usage: `basename $0` ip-addr firmware-image"
exit 1;
fi
@x2q
x2q / nets-psip.xml
Created October 9, 2012 07:11
PBS/Nets (Teller) jPOS ISO Bridge Settings
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE isopackager SYSTEM "genericpackager.dtd">
<!-- NETS Single Message field descriptions for GenericPackager -->
<isopackager>
<isofield
id="0"
length="4"
name="MESSAGE TYPE INDICATOR"
@x2q
x2q / SPIII-Current-Cost.sh
Created October 11, 2012 14:39
First attempt to fetch data from a SPIII solar controller and My Current Cost and post the data to emoncms.org
#!/bin/bash
# Crontab
# # m h dom mon dow command
# */1 * * * * /home/raspberrypi/SPIII-Current-Cost.sh
function update {
data=`curl -s --request GET --header "X-ApiKey: <api-key>" \
http://api.cosm.com/v2/feeds/<feed-id>.csv | awk -F "\"*,\"*" '{print "el-"$1":"$3}' | tr '\n' ','`
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d @json.txt https://pay.jumio.com/api/netverify/v1/performNetverify
@x2q
x2q / dmesg
Created October 15, 2012 13:46
Linux/Ubuntu 12.10 on a HP Pavilion dv9000 (dv9780eo)
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.5.0-17-generic (buildd@allspice) (gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) ) #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 (Ubuntu 3.5.0-17.28-generic 3.5.5)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.5.0-17-generic root=UUID=b4054db7-5b94-4218-a01d-9938f4255bf6 ro quiet splash
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009f7ff] usable
@x2q
x2q / cpuinfo
Created October 15, 2012 14:14
Linux/Ubuntu 12.10 on a Packard Bell EasyNote (ML61)
processor : 0
vendor_id : AuthenticAMD
cpu family : 17
model : 3
model name : AMD Athlon(tm) X2 Dual-Core QL-64
stepping : 1
microcode : 0x2000032
cpu MHz : 1050.000
cache size : 512 KB
physical id : 0
@x2q
x2q / vereq.xml
Created November 20, 2012 08:09
Visa 3D Secure VEReq/VERes Examples
<?xml version="1.0" encoding="UTF-8"?>
<ThreeDSecure>
<Message id="999">
<VEReq>
<version>1.0.2</version>
<pan>4444333322221111</pan>
<Merchant>
<acqBIN>411111</acqBIN>
<merID>99000001</merID>
<password>99000001</password>
@x2q
x2q / crreq.xml
Created November 21, 2012 08:34
Visa 3D Secure CRReq/CRRes Examples
<?xml version="1.0" encoding="UTF-8"?>
<ThreeDSecure>
<Message id="999">
<CRReq>
<version>1.0.1</version>
<pan>4444333322221111</pan>
<Merchant>
<acqBIN>411111</acqBIN>
<merID>99000001</merID>
<!--<password>99000001</password>-->
@x2q
x2q / Gemfile
Created December 1, 2012 09:55
simple and fast Ruby/Rack/Thin setup for a serving static html site with ssl support
source :rubygems
gem 'rack-contrib'
gem 'thin'
gem 'rack-ssl-enforcer'