Skip to content

Instantly share code, notes, and snippets.

View benhutchins's full-sized avatar

Benjamin Hutchins benhutchins

View GitHub Profile
@benhutchins
benhutchins / push.sh
Last active June 6, 2020 14:28
Push a folder of git repos from a Gitlab backup back into a Gitlab server
#!/bin/bash
# This script is a utility to re-import repos from a Gitlab backup
# A gitlab backup is a .tar file, usually named something like:
# 111111111_gitlab_backup.tar
# When extracted, there is a repositories/ directory inside of it
# inside repositories/ is a folder for each user and group in
# Gitlab which had a project at the time of export.
# This script is designed to be run inside of the a user/group
# directory, and it will automatically reimport all the projects
@benhutchins
benhutchins / ssh-aws-sh.sh
Last active September 30, 2016 05:47
Simple script to quickly add yourself to a security group, ssh in, then disconnect when you are done
HOST=$1
if [ -z $HOST ]; then
echo "You did not provide a host"
else
IP=`curl -s echoip.com`
# set the AWS Security Group based on host
if [ $HOST = "staging" ]; then
AWS_SG_ID=sg-12345
Verifying that +benhutchins is my blockchain ID. https://onename.com/benhutchins
@benhutchins
benhutchins / database.js
Created September 24, 2015 05:50
Flat-file database in Node
let fs = require('fs')
let path = require('path')
class FlatFileDatabase {
constructor (root) {
this.root = root
}
get (collectionName, key) {
let file = path.join(this.root, collectionName, key + '.json')
@benhutchins
benhutchins / keybase.md
Created September 30, 2014 14:33
keybase.md

Keybase proof

I hereby claim:

  • I am benhutchins on github.
  • I am hutchins (https://keybase.io/hutchins) on keybase.
  • I have a public key whose fingerprint is 9760 F10F 32C4 8D6D FBD8 2BBF 58AC EE83 C46E A04D

To claim this, I am signing this object:

@benhutchins
benhutchins / bhutchins-pgpkey.pub
Created September 25, 2014 13:47
Public OpenPGP Key for Benjamin Hutchins
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFQHPrMBCACltSlGKo9nKqP51a9R+R50fBj5P/R02PpfgGbZ3aHTyHjF3HoH
IqMmB2u8W7u01j/o4bw7+4bKypNHr0qIJOocZk0JZtiNlphU8+prcgeoAcOUYG5a
aSFp3yqcRE5W8Zb42JogBCR7U9SBsgU1RolMBnSuAR2/fMScet0OZseysXNFOG2R
kCSgvvCUaGVOAekt43jYXKya2IV/1nqdqHIuB8SjYmn1s0B2jLUtwX1c7ShSAVXA
rdiAUn+kSdg8u8e0BgYrUg9/H5/L6gmMGXBckBU5JZnvmNmlHoVuZ+NIgtYnlTzX
0RCRoeuaDHt/JA4cakMMuEGunZk+zZaV5ri3ABEBAAG0KUJlbmphbWluIEh1dGNo
aW5zIDxiaHV0Y2hpbnNAbWlsY29yZC5jb20+iQE9BBMBCgAnBQJUCH0mAhsDBQkH
09PCBQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAAAoJEFis7oPEbqBNy7AH/1AO8NQV
#!/usr/bin/env python
#
# Rapidshare Downloader
#
# I needed a way to download shit in Linux,
# This will download the links you provide
# one at a time but at least do it.
#
# @author Benjamin Hutchins
# @project Lead Bulb Download Manager
@benhutchins
benhutchins / pyget2.py
Created June 3, 2010 16:14
A python download accelerator
#!/usr/bin/env python
#
# pyget2.py
# A python download accelerator
#
# This file uses multiprocessing along with
# chunked/parallel downloading to speed up
# the download of files (if possible).
#
# @author Benjamin Hutchins
@benhutchins
benhutchins / pyget.py
Created February 24, 2010 03:10
A python parallel download script
#!/usr/bin/env python
#
# pyget.py
# A Python download accelerator
#
# by Benjamin Huthcins
# MIT License
#
# This file is incomplete, it also relies on wget to download,
# see http://gist.github.com/424080 for newer version
@benhutchins
benhutchins / facebook-poke.py
Created February 23, 2010 14:40
An old script that used to Auto Poke people on Facebook, doesn't work anymore, since their new design
# User information
user = "" ## Your Facebook email address
passwd = "" ## Your Facebook password
## Edit below this line if you want to
# Import some libraries
import cookielib, urllib, urllib2
import sys, re, time