Skip to content

Instantly share code, notes, and snippets.

View abythell's full-sized avatar

Andrew Bythell abythell

View GitHub Profile
@abythell
abythell / arduino-firmware-stk500.diff
Created January 8, 2013 19:50
Patch for Arduino firmware for programming via STK500
diff --git a/hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/makefile b/hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/make
index 1fb4ed3..a2782ac 100755
--- a/hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/makefile
+++ b/hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/makefile
@@ -116,7 +116,7 @@ OBJDIR = .
# Path to the LUFA library
-LUFA_PATH = ../..
+LUFA_PATH = ../../LUFA
@abythell
abythell / camdate.sh
Created April 8, 2013 17:54
Use gphoto2 to set the system time from a USB-attached camera. Handy for use on a Raspberry Pi which does not have a real-time clock or network connection for NTP.
#!/bin/bash
# Set system date using gphoto2 camera
#
# Make sure a root user is running this script
#
if [[ $EUID -ne 0 ]]; then
echo "Must run as root/sudo"
exit -1
fi
@abythell
abythell / camdate-java-install.sh
Last active December 15, 2015 23:19
A script to download, build, and install CamDate, a Java application built using libgphoto2-jna. CamDate sets the current system time to the current time on a USB-attached camera.
#!/bin/bash
#
# Automatically download, build, and install CamDate, a tool
# to set the System Time on a Raspberry Pi using a gphoto2-suppored
# camera.
#
#
# Check if root
#
@abythell
abythell / rxtx.xml
Last active December 31, 2015 13:59
Ant tasks for distributing Java projects that use RXTX binaries.
<!--
rxtx.xml
Copyright 2013 Andrew Bythell <abythell@ieee.org>
Ant tasks for distributing Java applications with platform-specific RXTX
libraries as zip files. To use:
1. Get and unzip RXTX - http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip into your project directory.
2. Copy this file (rxtx.xml) into the RXTX directory.
3. Include rxtx.xml in your build.xml.
@abythell
abythell / thingspeak-install2.sh
Last active February 17, 2016 19:10
Bash script to install Thingspeak server on Ubuntu 12.04LTS using rvm.
#!/bin/bash
# Install Thingspeak server on Ubuntu 12.04 LTS with rvm.
# Andrew Bythell <abythell@ieee.org>
# Install required packages
sudo apt-get -y upgrade
sudo apt-get -y install build-essential mysql-server mysql-client libmysqlclient-dev
sudo apt-get -y install libxml2-dev libxslt-dev git-core curl rubygems
## Install rvm
@abythell
abythell / ubuntu-domU.sh
Last active March 9, 2016 13:08
Bash script to install Ubuntu 12.04 as a Xen paravitualized domU guest on a Xen host with LVM.
#!/bin/bash
# Script to download, configure, and install Ubuntu as a Xen domU
# Uses existing LVM Volume Group. Must be run as root/sudo.
# Based on instructions at https://help.ubuntu.com/community/Xen
# User Configurable Settings
NAME=ubuntu # name of Domain to create
VG=/dev/domU # existing volume group in which to create a logical volume
LV=$NAME # name of the new logical volume to create
LV_SIZE=5G # size of the new logical volume
@abythell
abythell / ubuntu-dom0-xen.sh
Last active June 2, 2016 13:33
Bash script to automatically install and configure Xen 4.1 on Ubuntu Server 12.04 LTS
#!/bin/bash
# Setup and configure Xen DomU
# Run as root/sudo on a fresh Ubuntu Server 12.04 LTS install. Reboot when complete.
# Update
apt-get update
apt-get upgrade
# Install Xen hypervisor
apt-get install xen-hypervisor-amd64
@abythell
abythell / udisks-glue
Last active October 19, 2016 18:12
Debian/Ubuntu LSB init script for udisks-glue (automount removable media). To use/install, make the script executable, copy to /etc/init.d/udisks-glue, then run "update-rc.d udisks-glue defaults"
#!/bin/bash
### BEGIN INIT INFO
# Provides: udisks-glue
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: udisks-glue automounter
# Description: Automounts removable media
@abythell
abythell / configure.xml
Last active November 7, 2016 23:49
Ant script to download and configure the Netbeans platform, which enables Netbeans platform applications to be built without the IDE
<!--
Netbeans Platform Download-and-Config
Copyright 2013, 2016, Andrew Bythell <abythell@ieee.org>
http://angryelectron.com/
This Ant script is used to download and configure the Netbeans platform,
allowing Netbeans platform applications to be built without the IDE.
-->
<project name="configure-platform" default="configure" basedir=".">
@abythell
abythell / Password.java
Last active July 2, 2020 14:03
Using Unbound LDAP and JCIFS, create SMB/NTLM and LDAP password hashes from plaintext, then update LDAP.
/*
* Change passwords stored in LDAP
* Copyright Andrew Bythell, abythell@ieee.org
*/
package com.angryelectron.ldap;
import com.unboundid.ldap.sdk.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;