Skip to content

Instantly share code, notes, and snippets.

@gboudreau
gboudreau / greyhole.initd
Created June 8, 2011 20:34
/etc/init.d/greyhole for Debian 6
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: greyhole
# Required-Start: $network $local_fs $remote_fs mysql samba
# Required-Stop: $network $local_fs $remote_fs mysql samba
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start Greyhole daemon
### END INIT INFO
@gboudreau
gboudreau / popup.html
Created June 13, 2011 13:25
SABconnect++ new popup w graph
<html>
<head>
<link rel="stylesheet" type="text/css" href="third_party/jquery/ui-lightness/jquery-ui-1.8.13.custom.css" />
<link rel="stylesheet" type="text/css" href="css/popup.css" />
<script type="text/javascript" src="third_party/jquery/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="third_party/jquery/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="third_party/jquery/jquery.jqote2.min.js"></script>
<script type="text/javascript" src="third_party/fancy-settings/lib/store.js"></script>
<script type="text/javascript" src="scripts/pages/common.js"></script>
@gboudreau
gboudreau / lulz_contacts_checker.php
Created June 16, 2011 13:45
This will allow you to check your contacts list to find if anyone had his account hacked by Lulzsec.
<?php
/*
This will allow you to check your contacts list to find if anyone had his account hacked by Lulzsec.
Instructions:
1. Download google.csv from google.com/contacts
Alternatively, export your address book in text format, and name the exported file google.csv
2. Download this file: http://pub.pommepause.com/LulzSec%20Latest%20Release.txt
@gboudreau
gboudreau / mount_shares_locally
Last active September 14, 2020 03:57
mount_shares_locally for Ubuntu/Debian
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: mount_shares_locally
# Required-Start: $network $local_fs $remote_fs samba
# Required-Stop: $network $local_fs $remote_fs samba
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mount Samba shares locally
### END INIT INFO
@gboudreau
gboudreau / find_deprecated_growl_frameworks.sh
Created October 4, 2011 13:09
Find applications that use an old version of the Growl Framework, and thus won't work with Growl 1.3+
echo 'echo $1 | awk -F"/" "{print \$3}" ; plutil -convert xml1 -o - "$1/Versions/Current/Resources/Info.plist" | grep -A 1 CFBundleShortVersionString | tail -1 | awk -F">" "{print \$2}" | awk -F"<" "{print \$1}"' > /tmp/go.sh
find /Applications -name Growl.framework -exec sh /tmp/go.sh "{}" \;
@gboudreau
gboudreau / greyhole
Created November 3, 2011 10:52
Greyhole executable - fixed FATAL on BT display
#!/usr/bin/php
<?php
/*
Copyright 2009-2011 Guillaume Boudreau, Andrew Hopkinson
This file is part of Greyhole.
Greyhole is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
@gboudreau
gboudreau / jsonpp
Created December 5, 2011 14:38
JSON pretty-print from the command line
#!/usr/bin/php
<?php
echo json_format(file_get_contents('php://stdin')) . "\n";
// Pretty print some JSON
function json_format($json)
{
$tab = " ";
$new_json = "";
$indent_level = 0;
$in_string = false;
@gboudreau
gboudreau / smbln
Created January 3, 2012 22:23
smbln executable that allows the creation of symlinks on Samba shares mounted with the mfsymlinks option
#!/usr/bin/php
<?php
if ($argv[1] == '-s') {
$argv[1] = $argv[2];
$argv[2] = @$argv[3];
}
if (empty($argv[2])) {
$argv[2] = basename($argv[1]);
@gboudreau
gboudreau / recursive_include_parser-test.php
Created January 29, 2012 12:46
Testing recursive_include_parser function for Greyhole
<?php
file_put_contents('file1',
"this is file 1\r
include = file2
include = file3 # comment");
file_put_contents('file2', "this is file 2");
file_put_contents('file3',