Skip to content

Instantly share code, notes, and snippets.

@bobisme
bobisme / gist:1076479
Created July 11, 2011 18:36
Exim : retry time not reached for any host after a long failure period
cd /var/spool/exim/db
sudo rm retry retry.lockfile wait-remote_smtp wait-remote_smtp.lockfile
sudo /etc/init.d/exim restart
@bobisme
bobisme / gist:1076485
Created July 11, 2011 18:38
Redirect one IP to another with iptables.
iptables -t nat -A OUTPUT -p all -d XXX.XXX.XXX.XXX -j DNAT --to-destination YYY.YYY.YYY.YYY
@bobisme
bobisme / gist:1078482
Created July 12, 2011 17:29
Build/install custom linux kernel headers in ubuntu.

Linux Headers

  • Install tools to build:
sudo apt-get update
sudo apt-get install kernel-package fakeroot wget bzip2
  • Linux-2.6.39.1-linode34 is same as regular 2.6.39
@bobisme
bobisme / perf.js
Created February 20, 2012 20:07
Javascript Matrix Multiplication
// ORIGINAL random matrix multiply //
// originally from:
// https://github.com/JuliaLang/julia/blob/master/test/perf/perf.js //
function assert(t) { if (!t) throw new Error("assertion failed"); }
function runTest(func, arg, str) {
var tmin = Number.POSITIVE_INFINITY;
var t = (new Date).getTime();
var C = func(arg);
@bobisme
bobisme / perf.js
Created February 22, 2012 18:37
More julia perf.js benchmark tweaking.
var mt = require('microtime');
// TO BEAT:
// fib 0.168085
// parse_int 0.417948
// mandel 2.943993
// quicksort 0.912189
// pi_sum 47.051191
// rand_mat_stat 14.281034
// rand_mat_mul 192.106009
// printfd 33.056021
@bobisme
bobisme / bxxcamsync.js
Created April 12, 2012 23:25
BXX Camera Sync Enhancement (http://bxxweb.com)
// I saw the site from a link on Reddit.
// I wished I could easily sync the cameras.
// 3 hours later I had a script to do it.
// Just copy and paste it into your console. (I'm too lazy to make an extension).
//
// Features:
// - Control all cameras simultaneously by using the controls of any camera view.
// (except for volume and crap like that).
// - Have cams playing? Launch another and it should sync up automatically.
//
@bobisme
bobisme / wakesleep
Created March 28, 2013 09:21
Mac has been acting stupidly since I upgraded to 10.8. My VM has been crashing when it sleeps and I've been told that skype is always switching between "online" and "offline". So... Do this instead of just sleeping.
#!/bin/sh
VM="Ubuntu Server"
function wakefunc {
VBoxManage startvm $VM
osascript -e 'tell application "Skype" to send command "SET USERSTATUS ONLINE" script name "wakescript"'
}
function sleepfunc {
@bobisme
bobisme / gist:5261956
Last active December 15, 2015 12:39
Upgrade end-of-lifed Ubuntu installation.

Upgrade end-of-lifed Ubuntu installation.

So, apt-get fails you. What do?

Step 1: Grind through old isos.

Old versions of ubuntu are found here.

@bobisme
bobisme / gist:97af586808674e36bfe6
Created May 13, 2014 12:43
Installing pyzmq on Mac OS X 10.9
brew install libzmq
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install pyzmq --install-option="--zmq=/usr/local/Cellar/zeromq/4.0.4"
@bobisme
bobisme / install-openerp-linux.mkd
Created May 15, 2014 07:22
Installing OpenERP in Linux virtualenv (Ubuntu 14.04)

Installing OpenERP on Ubuntu 14.04

Many steps taken from [code.zoia.org][].

Install dependencies

apt-get