Skip to content

Instantly share code, notes, and snippets.

@joemaller
joemaller / README.md
Last active August 29, 2015 14:14
AutoFill bookmarklet - For quickly populating web forms for testing.

To install, just copy this url into a bookmark:

javascript:(function(){var s=document.createElement('script');s.type='text/javascript';s.async=true;s.src='https://rawgit.com/joemaller/6f1a1814d28d8aebd88a/raw/autofill.js';document.getElementsByTagName('head')[0].appendChild(s);})()

Lightly tested, seems to work most everywhere.

@joemaller
joemaller / README.md
Last active August 29, 2015 14:15
Kickstart wifi connection on old Mac

My webcam is running on an old MacBook that seems to have a spotty connection to the internet. When this computer drops the wifi connection, it doesn't ever seem to reconnect. The networksetup command can be used to reconnect, so I'm calling this every 5 minutes from cron to force the connection.

The command was also added to /etc/sudoers so we can call the command with sudo without a password.

@joemaller
joemaller / fail2ban unbanip commands
Created March 5, 2015 02:29
Commands for unbanning IP address jailed by fail2ban
sudo fail2ban-client set ssh unbanip 123.45.76.89
sudo fail2ban-client set vsftpd unbanip 123.45.76.89
# sudo fail2ban-client set [jail_name] unbanip [ip_address]
@joemaller
joemaller / gulpfile.js
Last active August 29, 2015 14:18
A proof-of-concept gulpfile that reloads itself onchange. Not especially stable and leaves an orphan gulp process, but useful for quickly iterating a gulpfile.
'use strict';
var gulp = require('gulp');
var spawn = require('child_process').spawn;
/**
* gulpfile-reload auto-reloads this gulpfile, called from 'watch'
* This leaves an orphaned gulp process running after `gulp watch` exits
*/
gulp.task('gulpfile-reload', function() {
@joemaller
joemaller / rpi-wifi.md
Last active May 1, 2019 20:22
WIFI on Raspberry Pi

Start with a Raspberry Pi booted from a freshly downloaded [Raspbian image][raspbian] (2015-02-16-raspbian-wheezy as of this writing). For wifi, I'm using an [Edimax EW-7811Un Wifi USB adapter][edimax] which was $10 on Amazon. I wrote this while running headless and connected via Ethernet, but the same commands will work when connected to a TV with a keyboard and mouse.

If configuring via SSH, try discovering the Raspberry Pi's IP address by running arp -a, though sometimes that table takes a while to populate. Otherwise just check the router's DHCP table.

Once you have a terminal on the Raspberry Pi, generate the necessary WPA2 pre-shared key with this [WPA Supplicant][] command:

$ wpa_passphrase your_wifi_ssid your_wifi_password

That returns something like this:

@joemaller
joemaller / ca-counties.json
Last active August 29, 2015 14:25
TopoJSON files listing county name and population for a few US States. For a D3 experiment on CodePen.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joemaller
joemaller / Script.txt
Last active August 29, 2015 14:25
audio test
Please Read the following out loud, pausing between words.
Register
One
Two
Three
Five
Eight
Thirteen
# see https://gist.github.com/joemaller/3165ace4b1f8a50924990ad373236ce8
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joemaller
joemaller / vagrant-hostmanager-nopasswd
Last active February 15, 2018 04:03
Sudoers additions for password-free Vagrant up. Save this file to /etc/sudoers.d/ with uid 0.
# Recommended with the Basic WordPress Vagrant project: https://github.com/ideasonpurpose/basic-wordpress-vagrant
# https://gist.github.com/41912f5d027a4adc7c14
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp *.vagrant.d/tmp/hosts.local /etc/hosts
%admin ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE