Skip to content

Instantly share code, notes, and snippets.

@SeanHood
SeanHood / README.md
Last active April 26, 2019 20:43
Link Shortening Bookmarklets

Link Shortening Bookmarklets

Amazon and eBay love to use ugly links which aren't nice to share. Here's two bookmarklets to clean up these URLs before copying them.

How to use

Create a bookmark in your browser of choice, copy and paste the below code into the URL part of the bookmark, give it a witty name and save.

Tested with ebay.co.uk, ebay.com, ebay.de, amazon.co.uk, amazon.com in Chrome

@SeanHood
SeanHood / README.md
Last active March 18, 2025 13:29
Vendoring Python dependencies for the lazy

Vendoring Python dependencies for the lazy

Say I've written a script in Python and want to ship the whole thing in a single directory/tarball to a machine without having to polute the system by running pip or yum. This is a way to do that.

# Install deps into a directory called vendor
pip install -r requirements.txt --prefix vendor
@SeanHood
SeanHood / boomerang.html
Last active March 8, 2019 09:29
akamai/boomerang and Angular 2+ RUM
<!--
akamai/boomerang for Angular 2.x and up
Could only find docs for Angular 1.x
This is the order plugins need to be included. Boomerang, auto-xhr, spa, history.
Unsure about md5, I was getting errors from something without it.
Once things are in this order I saw `spa` and `spa_hard` navigations being sent to the beacon.
/api/boomerang is an endpoint which can receivce GET query strings or POST data and push it
into our observabilty platform as a JSON blob. Returning a 204 status code.
@SeanHood
SeanHood / bookmarklet.md
Last active February 20, 2019 08:08
eBay link prettifier bookmarklet

eBay bookmarklet

javascript:(function(s){var loc = /(.*ebay\..*itm.).*\/(\d+).*/.exec(location); prompt('Short URL', loc[1]+loc[2])})()

Changes a url like: https://www.ebay.co.uk/itm/10TB-Seagate-ST10000NM0086-Exos-X10-3-5-Enterprise-HDD-SATA-III-6Gb-s-7200/132918338972 to https://www.ebay.co.uk/itm/132918338972

Keybase proof

I hereby claim:

  • I am seanhood on github.
  • I am seanhood (https://keybase.io/seanhood) on keybase.
  • I have a public key ASC4MohPpLS55Cll2mCJM2jvb1u1kZukl39SnFCFjho3ygo

To claim this, I am signing this object:

#!/bin/bash
if [ -z "$2" ]; then echo -e "Missing arguments\nUsage: mount-sshfs server /path/to/mount"; exit 1; fi
server=$1
dir=$2
mountdir="/Volumes/${server}-$(basename $2)"
mkdir $mountdir
#!/bin/bash
sudo apt-get update
sudo apt-get install -y \
build-essential libevent-dev libssl-dev libgcrypt-dev libkrb5-dev \
libpam0g-dev libwrap0-dev libdb-dev libtdb-dev libmysqlclient-dev \
avahi-daemon libavahi-client-dev libacl1-dev libldap2-dev \
libcrack2-dev systemtap-sdt-dev libdbus-1-dev libdbus-glib-1-dev \
libglib2.0-dev tracker libtracker-sparql-0.16-dev libtracker-miner-0.16-dev
wget http://prdownloads.sourceforge.net/netatalk/netatalk-3.1.8.tar.gz?download -O netatalk-3.1.8.tar.gz -quiet
#!/usr/bin/python
import hashlib
from time import gmtime
foo=1
while foo:
foo = hashlib.sha224(str(gmtime()))