Skip to content

Instantly share code, notes, and snippets.

View pkruithof's full-sized avatar

Peter Kruithof pkruithof

  • TreeHouse
  • Breda, NL
View GitHub Profile

Keybase proof

I hereby claim:

  • I am pkruithof on github.
  • I am pkruithof (https://keybase.io/pkruithof) on keybase.
  • I have a public key ASB6mY2hC-sXkdxfVtWsZ6sAAkUuzEfuAVbW-uXSid3kvwo

To claim this, I am signing this object:

# deb http://mirror.transip.net/ubuntu/ubuntu wily main restricted
# deb http://mirror.transip.net/ubuntu/ubuntu wily-updates main restricted
# deb http://security.ubuntu.com/ubuntu wily-security main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirror.transip.net/ubuntu/ubuntu wily main restricted
deb-src http://mirror.transip.net/ubuntu/ubuntu wily main restricted
@pkruithof
pkruithof / gist:7387e453374bd710a015
Created July 1, 2015 07:21
Puli & Sensiolabs Insight
Log from Sensiolabs Insight when it tried to install dependencies:
---------------------
<warn>The "puli"/"puli.phar" command could not be found.</warn>
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
[...]
Generating optimized autoload files
{% macro vhost(name, server_name, config={}) %}
{% set defaults = { 'server_name': server_name } %}
{% do defaults.update(config) %}
{{ name }}:
file.managed:
- template: jinja
- source: salt://nginx/site.conf
- defaults: {{ defaults }}
{% endmacro %}
<?php
$gzp = gzopen('feed.xml.gz', 'r');
$fp = fopen('feed.xml', 'w');
while (!gzeof($gzp)) {
fwrite($fp, gzgets($gzp, 4096));
}
fclose($fp);
@pkruithof
pkruithof / swf-extract-sounds.sh
Created November 18, 2013 18:58
Extracts sounds out of a swf, using swfextract
#!/bin/bash
basename=`basename $1`
dir=${basename%.*}
mkdir -p "$dir"
output=`swfextract "$1" | grep "Sounds:"`
echo "${output:23}" | tr "," "\n" | while read word; do
swfextract -s $word "$1" -o "$dir/$word.mp3"
done
@pkruithof
pkruithof / gist:1231701
Created September 21, 2011 09:53
Mysql duplicate columns
SELECT DISTINCT column1 FROM table GROUP BY column1 HAVING COUNT(column1) > 1
@pkruithof
pkruithof / gist:1139524
Created August 11, 2011 12:26
Create ISO from folder contents
DVDDIR=$1
OUTDIR=`dirname "$DVDDIR"`
DVDNAME=`basename "$DVDDIR"`
hdiutil makehybrid -udf -udf-volume-name "$DVDNAME" -o "$OUTDIR/$DVDNAME.iso" "$DVDDIR"
@pkruithof
pkruithof / gist:1131598
Created August 8, 2011 11:22
Sag error reporting
<?php
error_reporting(E_ALL & ~E_NOTICE | E_STRICT); // (Show all errors, except for notices)
$sag_supported = E_ALL ^ E_NOTICE;
$current = error_reporting();
var_dump($current > $sag_supported || $current < 0); // true
var_dump(($current & E_NOTICE) > 0); // false
@pkruithof
pkruithof / delete_svn_dirs.sh
Created July 6, 2011 07:54
Recursively delete .svn directories
find . -type d -name .svn -print0 | xargs -0 rm -rf