Skip to content

Instantly share code, notes, and snippets.

View kvz's full-sized avatar

Kevin van Zonneveld kvz

View GitHub Profile
#!/usr/bin/perl
#fetch Gravatars
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
my $size = 90;
#!/bin/bash
set -x
mp3="/data/music/music/!Frank!/CD1/007 Mixed By Dave Seaman.mp3"
mp3="/data/music/music/!House!/Progressive/Sander Kleinenberg/This Is Everybody Too CD1.mp3"
outbase="gourcedump"
getavatars="1"
#resolution="640x480"
resolution="800x600"
# http://nullkey.ath.cx/projects/glc/wiki/HowtoInstall
@kvz
kvz / default.nginx
Created November 30, 2010 12:35
A default Nginx config file that will server any (cake) php site in /var/www/*
server {
listen 80 default;
server_name _;
set $site $host;
if ($site ~ "^(w{3}\.)?(.*)$") { set $site $2; }
set $root /var/www/$site;
if (-d /var/www/www.$site) { set $root /var/www/www.$site; }
if (!-d $root) { rewrite ^(.*)$ http://decomissioned.plutonia.nl$1 break; }
@kvz
kvz / gist:740269
Created December 14, 2010 10:55
LinkedIn
Dear Kevin van Zonneveld,
In order to ensure that you continue to have the best experience using LinkedIn, we are constantly monitoring our site to make sure your account information is safe.
We have recently disabled your account for security reasons. To reset your password, follow these quick steps:
Go to the LinkedIn website
Click on "Sign In"
Click on "Forgot Password?" and follow the directions on the website
Thank you,
@kvz
kvz / unpacker.sh
Created March 1, 2011 10:28
Script that will unpack & cleanup fresh Synology Downloadstation files
#!/opt/bin/bash
# @todo: Don't delete parent dir if Dir == Root
# @todo: Root = $1 - But what about series!
set +x
export PATH="/opt/bin:/opt/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/syno/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/syno/bin:/usr/syno/sbin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/syno/bin:/usr/syno/sbin:/usr/local/bin:/usr/local/sbin"
# Locking
LockFile="/volume1/downloads/nas_is_unpacking.lock"
if [ -f "${LockFile}" ]; then
@kvz
kvz / Who_needs_foreach_anyway.php
Created April 12, 2011 10:34
Groups nested hour registration data & sums up the total overage in 2011 per customer
<?php
// Thank you CakePHP Set::combine() & PHP5.3 : )
// http://book.cakephp.org/view/1492/combine
$cust_overage = array_map(function ($regs) {
return array_sum($regs);
}, Set::combine(
$this->Hour->overage(2011),
'/Hour/id',
'/Hour/amount',
'/Hour/customer_id'
@kvz
kvz / gist:964330
Created May 10, 2011 11:50
Only in the Java world..
[kevin@imac ~/workspace/transloadit (master *)]$ ps axu |ack -i netbeans
kevin 79252 0.0 8.2 4439876 690260 ?? S Mon01PM 17:56.29 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Djdk.home=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home -classpath /Applications/NetBeans/NetBeans 7.0.app/Contents/Resources/NetBeans/platform/lib/boot.jar:/Applications/NetBeans/NetBeans 7.0.app/Contents/Resources/NetBeans/platform/lib/org-openide-modules.jar:/Applications/NetBeans/NetBeans 7.0.app/Contents/Resources/NetBeans/platform/lib/org-openide-util-lookup.jar:/Applications/NetBeans/NetBeans 7.0.app/Contents/Resources/NetBeans/platform/lib/org-openide-util.jar:/Applications/NetBeans/NetBeans 7.0.app/Contents/Resources/NetBeans/platform/lib/locale/boot_ja.jar:/Applications/NetBeans/NetBeans 7.0.app/Contents/Resources/NetBeans/platform/lib/locale/boot_pt_BR.jar:/Applications/NetBeans/NetBeans 7.0.app/Contents/Resources/NetBeans/platform/lib/locale/boot_ru.jar:/Applicati
@kvz
kvz / gist:965016
Created May 10, 2011 18:09
Yeah I know
[kevin@imac ~/workspace/transloadit (master *)]$ ps axu |ack -i vim
kevin 60377 0.0 0.2 2795864 15260 ?? Ss 8:07PM 0:00.20 /Applications/MacVim.app/Contents/MacOS/MacVim -MMNoWindow yes
kevin 60362 0.0 0.1 2551780 9972 ?? Ss 8:07PM 0:00.15 /Applications/MacVim.app/Contents/MacOS/Vim -f -g .
@kvz
kvz / un_checkbox.js
Created July 7, 2011 12:00
Uncheck 200+ boxes using chrome console on sites that neither support jquery nor have an 'unselect all' function :)
// In Chrome, right click => Inspect Element
// Goto the Console tab.
// Execute the following:
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(script);
$(':checkbox').prop('checked', false);
@kvz
kvz / bonnie.md
Created July 9, 2011 11:20
Aws disk speeds

EBS: Single disk

Using uid:33, gid:33.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.