Skip to content

Instantly share code, notes, and snippets.

Avatar
💬
;--;DROP TABLE status;

Adam Baxter voltagex

💬
;--;DROP TABLE status;
View GitHub Profile
View peak-finding-faster.rs
fn main()
{
//this code is meant to find a "peak" in an array.
let arr = [1,2,3,11,5,6,7,8,9,10,9];
println!("length {}",arr.len());
let middle = (arr.len()/2)-1;
@voltagex
voltagex / check-updates.sh
Created Apr 6, 2014
Bash script to run nsupdate from a spool directory, for cron
View check-updates.sh
#!/bin/bash
SPOOL=/var/spool/nsupdate
KEYFILE=/etc/bind/ns-voltagex.org_rndc-key
UPDATECOMMAND="nsupdate -k $KEYFILE -v"
shopt -s nullglob #stop script trying to act on a file called *.update
for file in $SPOOL/*.update; do
echo $file
$UPDATECOMMAND $file
echo
@voltagex
voltagex / gmvault.txt
Created May 6, 2014
Huge log for gmvault install
View gmvault.txt
(gmvault)voltagex@nightmare:/media/files/Email$ pip install --verbose --pre gmvault --allow-external IMAPClient
Downloading/unpacking gmvault
Using version 1.8.1-beta (newest of versions: 1.8.1-beta, 1.8-beta, 1.7-beta, 1.6-beta, 1.5-beta, 1.0-beta)
Downloading gmvault-1.8.1-beta.tar.gz (93kB):
Downloading from URL https://pypi.python.org/packages/source/g/gmvault/gmvault-1.8.1-beta.tar.gz#md5=a0b26d814506748deca8e2eee4086b31 (from https://pypi.python.org/simple/gmvault/)
...Downloading gmvault-1.8.1-beta.tar.gz (93kB): 93kB downloaded
Running setup.py (path:/media/files/Email/gmvault/build/gmvault/setup.py) egg_info for package gmvault
PATH = /media/files/Email/gmvault/build/gmvault/./src/gmv/gmvault_utils.py
1.8.1-beta
@voltagex
voltagex / android-sid.md
Last active Aug 29, 2015
Building Android on Debian Testing/Sid
View android-sid.md

Because make-4.0 is now the default in Testing and Sid, you'll need to either explicitly call make-3.8 or replace make 4.0 temporarily.

The version you need is: https://launchpad.net/debian/+source/make-dfsg/3.81-8.3 due to autotools 1.13 not building make properly.

You will also need to install automake 1.11 and then sudo update-alternatives --config automake (to build the older version of make)

View 01.xcodebuild
2015-07-16 23:29:43 -0400
xcodebuild
-configuration
Release
install
DSTROOT=/
PREFIX=/usr/local/Cellar/darwinbuild/HEAD
SYMROOT=build
View gist:3b93587c0d2a710a99ef
voltagex@goldengate:~/src/serial-vm-buildroot$ make menuconfig
umask 0022 && make -C /home/voltagex/src/buildroot O=/home/voltagex/src/serial-vm-buildroot/build BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=/home/voltagex/src/serial-vm-buildroot/kernel.config BR2_EXTERNAL=/home/voltagex/src/serial-vm-buildroot/external menuconfig
GEN /home/voltagex/src/serial-vm-buildroot/build/Makefile
configuration written to /home/voltagex/src/serial-vm-buildroot/build/.config
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
voltagex@goldengate:~/src/serial-vm-buildroot$ make savedefconfig
umask 0022 && make -C /home/voltagex/src/buildroot O=/home/voltagex/src/serial-vm-buildroot/build BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=/home/voltagex/src/serial-vm-buildroot/kernel.config BR2_EXTERNAL=/home/voltagex/src/serial-vm-buildroot/external savedefconfig
@voltagex
voltagex / sip-monitor.sh
Created Apr 13, 2010
How to monitor SIP traffic - the cheap way
View sip-monitor.sh
mkfifo /root/sip
while true; do ngrep SIP -i host 10.1.1.2 > /root/sipfifo; done;
socat stdio tcp4-listen:55061,crnl < /root/sipfifo
View top-posts.json
{
"date": "2015-09-10",
"days": {
"2015-09-01": {
"postviews": [
{
"id": 84,
"href": "http://blog.voltagex.org/2015/09/06/reimplementing-apt-file-badly/",
"date": "2015-09-06 12:14:47",
"title": "Reimplementing apt-file, badly",
@voltagex
voltagex / Binutils
Last active Sep 20, 2015
Reproducing hello world
View Binutils
System A: GNU ld (GNU Binutils for Debian) 2.25
System B: GNU ld (GNU Binutils) 2.25.1
View gist:80735dee8e8a451d9354
magnet:?xt=urn:btih:28bd44e92fa8c2b022da538759a55ff6b08a5123&dn=pocorgtfo09.pdf&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce&ws=https%3a%2f%2fwww.alchemistowl.org%2fpocorgtfo%2f
magnet:?xt=urn:btih:0bc5f8640c49bfc3300455a857804e77e878c8ee&dn=pocorgtfo08.pdf&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce&ws=https%3a%2f%2fwww.alchemistowl.org%2fpocorgtfo%2f
magnet:?xt=urn:btih:ce97d9a5aac9ca49990d2968f4951128f896f6ca&dn=pocorgtfo07.pdf&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce&ws=https%3a%2f%2fwww.alchemistowl.org%2fpocorgtfo%2f
magnet:?xt=urn:btih:c24c1837b36ea7e37ddf41380587ecbad184172e&dn=pocorgtfo06.pdf&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce&ws=https%3a%2f%2fwww.alchemistowl.org%2fpocorgtfo%2f
magnet:?xt=urn:btih:3af334b26a3c6373c214ac4156f08c656708ce8c&dn=pocorgtfo05.pdf&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce&ws=https%3a%2f%2fwww.alchemistowl.org%2fpocorgtfo%2f
magnet:?xt=urn:btih:048fe40ff677ebec789d6a507dfe224ca91da237&dn=pocorgtfo04.pdf