Skip to content

Instantly share code, notes, and snippets.

@benlemasurier
benlemasurier / gist:7775947
Last active December 30, 2015 04:29
wheezy php 5.5 upgrade notes
# very rough php 5.4->5.5 upgrade guide
# your environment may differ slightly, just let me know and I'll help out where I can.
# go to http://www.dotdeb.org/instructions/ and add the wheezy php 5.5 repositories under
# section 2 to /etc/apt/sources.list
#
# It's safe to leave the default dotdeb entries if you want.
# method 1 (preferred, easiest)
# upgrade all packages
SELECT
a.attname AS field,
t.typname AS type,
format_type(a.atttypid, a.atttypmod) AS complete_type,
a.attnotnull AS isnotnull,
(SELECT 't'
FROM pg_index
WHERE c.oid = pg_index.indrelid
AND a.attnum = ANY (pg_index.indkey)
AND pg_index.indisprimary = 't'
@benlemasurier
benlemasurier / gist:5293789
Created April 2, 2013 16:42
aprs passcode
short passcode(const char *callsign) {
uint8_t i, len;
short hash = KEY;
char no_ssid[10], *p1 = no_ssid, *ptr = no_ssid;
// remove SSID
while((*callsign != '-') && (*callsign != '\0')) *p1++ = toupper((int) (*callsign++));
*p1 = '\0';
i = 0;
/*
* Blode - a simple, powerful syslog-like event broadcast daemon
* Copyright (C) 2010 Ben LeMasurier
*
* This program can be distributed under the terms of the GNU GPL.
* See the file COPYING.
*/
/*
* (syslog like) message severity
;(function($) {
var _graph = {
log_buffer: [],
legend: '',
background: '',
foreground: '',
element: null,
tick: 100, // ms
bar_width: 3,
#!/bin/bash
# Check whether any submodule is about to be updated with the
# commit. Ask the user for confirmation.
echo "Checking if any submodules are being updated..."
ROOT_DIR=$(git rev-parse --show-cdup)
SUBMODULES=$(grep path ${ROOT_DIR}.gitmodules | sed 's/^.*path = //')
@benlemasurier
benlemasurier / stormfs.spec
Created January 31, 2012 20:41
stormfs rpm spec
Name: stormfs
Version: 0.02
Release: 1%{?dist}
Summary: A FUSE abstraction layer for cloud storage
Group: System Environment/Kernel
License: GPL
URL: https://github.com/benlemasurier/stormfs
Source0: https://github.com/downloads/benlemasurier/stormfs/stormfs-0.02.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
require 'formula'
class Stormfs < Formula
url 'https://github.com/downloads/benlemasurier/stormfs/stormfs-0.01.tar.gz'
homepage 'https://github.com/benlemasurier/stormfs'
md5 'e11b7a1afc7fdd6675d813315c42431b'
depends_on 'pkg-config' => :build
depends_on 'glib'
depends_on 'fuse4x'
@benlemasurier
benlemasurier / gist:1691005
Created January 27, 2012 21:26
homebrew new
require 'formula'
class Stormfs < Formula
url 'https://github.com/downloads/benlemasurier/stormfs/stormfs-0.01.tar.gz'
homepage 'https://github.com/benlemasurier/stormfs'
md5 '7ec795563156bef7286849c3a1c6c906'
depends_on 'pkg-config'
depends_on 'fuse4x-kext'
depends_on 'fuse4x'
@benlemasurier
benlemasurier / gist:1687218
Created January 27, 2012 05:36
stormfs homebrew test
require 'formula'
class Stormfs < Formula
url 'https://github.com/downloads/benlemasurier/stormfs/stormfs-0.01.tar.gz'
homepage 'https://github.com/benlemasurier/stormfs'
md5 '440ceda482e5b5e747217847fe8a9df6'
depends_on 'pkg-config'
depends_on 'fuse4x-kext'
depends_on 'fuse4x'