Skip to content

Instantly share code, notes, and snippets.

@russelldavies
russelldavies / hterm_solarized.js
Last active May 7, 2021 18:31
Chrome/Chromium OS hterm and Secure Shell solarized color scheme.
// Run in the JavaScript console of the hterm browser window
// Clear all existing settings - you probably don't want to do this.
// Preferences are now stored in "chrome.storage.sync" instead of
// "window.localStorage" so if you clear your preferences the changes
// will be propagated to other devices.
//term_.prefs_.storage.clear();
var htermProfiles = [
@russelldavies
russelldavies / agp_wifi.py
Created December 26, 2014 15:13
Malaga airport free wifi
# -*- coding: utf-8 -*-
import random
import requests
def random_mac():
return ''.join(('%02x' % i for i in [
0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
@russelldavies
russelldavies / okc.py
Created May 5, 2015 12:35
OK Cupid Questions
"""
Script to find out when a person answered their questions on OK Cupid.
For some reason OKC displays when someone has answered a question when you
answer the same question in relation to their profile.
Kind of useless but interesting to see that most people insomniacs.
"""
from datetime import datetime
from functools import partial
#!/usr/bin/env python
from flask import Flask, request, abort
import cups
import requests
import os
import tempfile
app = Flask(__name__)
@russelldavies
russelldavies / dsl_stats.gpi
Last active October 13, 2016 16:28
Connection Health
set terminal png enhanced size 1200,675 linewidth 2
set output 'dsl_stats.png'
set title 'DSL Stats'
set autoscale fix
set grid
set datafile separator ','
set key autotitle columnhead
set xlabel 'Timestamp (UTC)'
@russelldavies
russelldavies / build.sh
Created November 24, 2016 16:53
AWS Lambda Weasyprint
#!/bin/sh
mkdir task
cp build_weasyprint.sh task
docker run --rm -it -v $PWD/task:/var/task \
-e LD_LIBRARY_PATH='/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib' \
lambdalinux/baseimage-amzn build_weasyprint.sh
@russelldavies
russelldavies / keybase.md
Created February 23, 2017 01:52
keybase.md

Keybase proof

I hereby claim:

  • I am russelldavies on github.
  • I am russelldavies (https://keybase.io/russelldavies) on keybase.
  • I have a public key whose fingerprint is 8F53 80D1 15B4 BD2D 58CA C847 DA4B 04BC 5CE0 B6FE

To claim this, I am signing this object:

@russelldavies
russelldavies / backup.sh
Last active January 21, 2021 15:31
Restic backup script
#!/bin/sh
if [ $# -lt 4 ]; then
echo $0: Missing arguments
echo usage: $0 repo password aws_access_key aws_secret_key
exit 1
fi
export RESTIC_PASSWORD=$1
export RESTIC_PASSWORD=$2
@russelldavies
russelldavies / anagrams.elm
Last active March 13, 2018 21:31
Anagram Solver
module Main exposing (..)
import Char
import Dict exposing (Dict)
createMap : String -> Dict Int (List String) -> Dict Int (List String)
createMap word dict =
let
key =
module Lcd exposing (main)
import Html exposing (Html, div, input)
import Html.Events exposing (onInput)
import Svg exposing (..)
import Svg.Attributes exposing (..)
import List.Extra exposing (zip)
import Array exposing (Array)
import Maybe.Extra