Skip to content

Instantly share code, notes, and snippets.

View pyropeter's full-sized avatar

PyroPeter pyropeter

View GitHub Profile
@pyropeter
pyropeter / new
Created October 7, 2009 23:30
(Looks like some ruby-on-rails error)
NoMethodError in Posts#new
Showing app/views/posts/new.html.erb where line #3 raised:
undefined method `^' for "4":String
Extracted source (around line #3):
1: <h1>New post</h1>
2:
@pyropeter
pyropeter / createthumbsandgallery.sh
Created February 20, 2010 21:32
Organize raw photos in gallery
#!/bin/sh
thumbpath="thumbs/"
size="300" # ufraw needs width and heigth to equal
fileext="jpg"
convertopts="-strip"
ufrawopts="--create-id=no --out-type=jpeg --compression=95 --size=$size"
ufrawopts="$ufrawopts --rotate=camera --wb=camera --grayscale=none --noexif"
@pyropeter
pyropeter / torus-highscores
Created March 21, 2010 10:20
Torus highscores
http://www.benjoffe.com/code/games/torus/
##### HIGHSCORES #####
### Traditional
niemand [12930]
tuxlover [10349]
PyroPeter [10224]
PyroPeter [9450]
@pyropeter
pyropeter / monitor.sh
Created July 10, 2010 12:40
Simple system monitor
#!/bin/bash
interval=5
intervalLong=300
function getSensors {
sensors | awk 'BEGIN {FS=":? +"} /^Core|^fan[12]|^temp/ {printf "%9s %9s\n", $1, $2}'
}
function getDiskfree {
@pyropeter
pyropeter / gist:476285
Created July 14, 2010 23:49
Irssi bug FS#754
Index: src/fe-common/core/hilight-text.c
===================================================================
--- src/fe-common/core/hilight-text.c (revision 5186)
+++ src/fe-common/core/hilight-text.c (working copy)
@@ -78,6 +78,7 @@
if (rec->nickmask) iconfig_node_set_bool(node, "mask", TRUE);
if (rec->fullword) iconfig_node_set_bool(node, "fullword", TRUE);
if (rec->regexp) iconfig_node_set_bool(node, "regexp", TRUE);
+ if (rec->except) iconfig_node_set_bool(node, "except", TRUE);
@pyropeter
pyropeter / connect-freenode.log
Created July 17, 2010 08:33
Bleeding-edge IRC
[thunfisch@localhorst ~]$ nc irc.freenode.net 6667
:gibson.freenode.net NOTICE * :*** Looking up your hostname...
:gibson.freenode.net NOTICE * :*** Checking Ident
:gibson.freenode.net NOTICE * :*** Found your hostname
:gibson.freenode.net NOTICE * :*** No Ident response
NICK foobarbaz
USER x y z :r
:gibson.freenode.net 001 foobarbaz :Welcome to the freenode Internet Relay Chat Network foobarbaz
:gibson.freenode.net 002 foobarbaz :Your host is gibson.freenode.net[213.179.58.83/6667], running version ircd-seven-1.0.0
:gibson.freenode.net 003 foobarbaz :This server was created Sat Jan 30 2010 at 01:13:47 CET
@pyropeter
pyropeter / duplicates.js
Created July 27, 2010 14:16
Find duplicate files
#!/usr/bin/env node
var sys = require('sys'),
fs = require('fs'),
childProcess = require('child_process')
hashtable = {}
md5table = {}
fileblacklist = []
@pyropeter
pyropeter / Successful recovery.log
Created July 28, 2010 09:38
Undelete /lib on Arch-Linux
acl-2.2.49-1
lib/
lib/libacl.so
lib/libacl.so.1.1.0
lib/libacl.so.1
attr-2.4.44-1
lib/
lib/libattr.so.1
lib/libattr.so
lib/libattr.so.1.1.0
@pyropeter
pyropeter / gist:506166
Created August 3, 2010 10:31
Google Search API documentation
# http://www.google.com/uds/GwebSearch?q=foo%20bar&v=1.0
{ responseStatus: 200
, responseData:
{ results:
[ { visibleUrl: 'www.foobar2000.org'
, titleNoFormatting: 'foobar2000'
, cacheUrl: 'http://www.google.com/search?q=cache:obAJTkESjhwJ:www.foobar2000.org'
, title: 'foobar2000'
, content: 'Media player with simple UI and low memory use. Offers plugin support for new features. Includes link to forum focused on application. [Win32]'
@pyropeter
pyropeter / LICENSE
Last active June 7, 2021 16:49
PKGBUILD parser
Copyright (c) 2010 PyroPeter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all