Skip to content

Instantly share code, notes, and snippets.

View pikesley's full-sized avatar
💭
I fly cargo planes full of rubber dogshit out of Hong Kong

pikesley pikesley

💭
I fly cargo planes full of rubber dogshit out of Hong Kong
View GitHub Profile
@pikesley
pikesley / fake-blogs.rb
Last active October 24, 2016 12:23
So I heard you wanted to misuse some tools to generate some fake content for your Jekyll site
require 'date'
require 'httparty'
require 'timecop'
dawn_of_time = DateTime.parse '2016-01-01'
today = DateTime.now
while today > dawn_of_time do
Timecop.freeze today do
d = DateTime.now.strftime '%Y-%m-%d'
@pikesley
pikesley / README.md
Created October 22, 2016 15:55
Pivertise your Pi

How to Pivertise your Pi

You know how sometimes you connect your Raspberry Pi to a wifi network and then you have absolutely no way of finding out its IP address (Zeroes are particularly bad for this)? Well, I fixed it. Paste the run-once-at-boot-time systemd script into /etc/systemd/system/pivertiser.service and enable it with sudo systemctl enable pivertiser.service, paste the terrible bash hack into /home/pi/pivertiser.sh and chmod +x /home/pi/pivertiser.sh, then reboot your pi and it should show its face over here

Those addresses are stored in a hash keyed on hostname, so clearly if you never rename your pi from raspberrypi then this is an astonishingly terrible solution, but it's just solved a little problem for me. And you can of course run your own instance on Heroku if you want to

@pikesley
pikesley / Gemfile
Last active September 26, 2016 13:48
Jekyll 3 and Bootstrap 4 from scratch
source 'https://rubygems.org'
gem 'github-pages'
gem 'bootstrap', '~> 4.0.0.alpha4'
gem 'compass'
gem 'rake'
@pikesley
pikesley / pi.md
Created September 23, 2016 12:19
How do I Pi?

Before you begin

sudo easy_install gpiozero

The script

from gpiozero import LED
from time import sleep

yellow = LED(17)

@pikesley
pikesley / mongo-dumper.sh
Created August 23, 2016 12:58
Dump Mongo to Rackspace
#!/bin/bash
ZIPPATH="mongo-`date +%Y-%m-%d`.tbz"
CONTAINER=quirkafleeg-dumps
AUTHURL=https://lon.auth.api.rackspacecloud.com/v1.1/auth
AUTHXML="<?xml version='1.0' encoding='UTF-8'?><credentials xmlns='http://docs.rackspacecloud.com/auth/api/v1.1' username='`head -1 /root/.rackspace.creds`' key='`tail -1 /root/.rackspace.creds`' />"
echo -n 'Dumping... '
/usr/bin/mongodump
echo 'done'
@pikesley
pikesley / Help.md
Created March 14, 2016 14:50
Embed your README

Easily embed your README.md as documentation

  • Disregards everything before the first # Heading
  • Requires kramdown
@pikesley
pikesley / but I need
Created February 28, 2016 16:17
I cannot SASS
tr.foo {
background-color: #fa5100;
}
tr.bar {
background-color: #0c58a2;
}
@pikesley
pikesley / postinstall.md
Last active September 1, 2016 16:17
Skellington post-install help
  • Install jQuery and jasmine-jQuery (yes, this is a bit of a hack)
    curl https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js -o spec/javascripts/helpers/jquery.min.js
    curl https://raw.github.com/velesin/jasmine-jquery/master/lib/jasmine-jquery.js -o spec/javascripts/helpers/load-after-jquery-jasmine-jquery.js
  • Set up continuous integration in Travis:
@pikesley
pikesley / gist:11aa2b6ab5eba3f5f545
Last active January 13, 2016 11:26
Onename verification
Verifying that +pikesley is my blockchain ID. https://onename.com/pikesley
@pikesley
pikesley / How-to-join
Created January 4, 2016 11:32
Join my blockchain
vagrant up
(select to bridge to eth0 or eth1)
vagrant ssh
multichaind odi-chain@10.14.3.49:9255
It will complain, but it will give you a wallet address. Send that to me, and I can allow you in. Then
multichaind odi-chain@10.14.3.49:9255 -daemon