This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo ./a.out | |
PID: 7780 | |
Child! | |
ERR: 0! | |
Success | |
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | |
root 1 0.0 0.0 1852 344 pts/3 S+ 23:16 0:00 ./a.out | |
root 2 0.0 0.0 1932 504 pts/3 S+ 23:16 0:00 sh -c ps auxwf | |
root 3 0.0 0.0 4336 1008 pts/3 R+ 23:16 0:00 \_ ps auxwf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
from pygeoip import GeoIP | |
g = GeoIP('GeoIP.dat') | |
r = re.compile(r'20. ([0-9]+) "') | |
d = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sched.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/mount.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2013 Aaron Brady | |
* Copyright (C) 2008-2012 Red Hat, Inc. | |
* Copyright (C) 2008 IBM Corp. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either | |
* version 2.1 of the License, or (at your option) any later version. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadPlugin curl_json | |
<Plugin curl_json> | |
<URL "http://localhost:5000/"> | |
Instance "fpmunix" | |
<Key "connecting"> | |
Instance "connecting" | |
Type "listen_queue" | |
</Key> | |
<Key "connected"> | |
Instance "connected" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# git config annex.ftp-hook = "/usr/local/bin/git-annex-ftp.py" | |
# git annex initremote iwebftp type=hook hooktype=ftp encryption=none | |
from ftplib import FTP | |
import os | |
f = FTP('prefix.iweb-storage.com', 'prefix-admin', 'password') | |
f.set_pasv(True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ru magento-17/app/code/core/Mage/Core/Helper/Cookie.php magento-patched/app/code/core/Mage/Core/Helper/Cookie.php | |
--- magento-17/app/code/core/Mage/Core/Helper/Cookie.php 2012-07-05 11:49:29.000000000 +0100 | |
+++ magento-patched/app/code/core/Mage/Core/Helper/Cookie.php 2013-09-26 10:52:24.701527319 +0100 | |
@@ -69,7 +69,7 @@ | |
{ | |
$acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites(); | |
$acceptedSaveCookiesWebsites[Mage::app()->getWebsite()->getId()] = 1; | |
- return serialize($acceptedSaveCookiesWebsites); | |
+ return json_encode($acceptedSaveCookiesWebsites); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
states = ('DEFAULT', 'HAVE_FILE') | |
fl = re.compile('^fl=(.*)') | |
num = re.compile('^\d+ (\d+)') | |
state = 0 | |
current_file = '' | |
inclusive = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Adapted from David Llewellyn-Jones's code | |
# http://www.flypig.co.uk/?page=list&list_id=363&list=blog | |
# By Aaron Brady | |
# http://insom.me.uk/ | |
import turtle as t | |
import sys | |
import tty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function box_name { | |
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s | |
} | |
local current_dir='${PWD/#$HOME/~}' | |
local git_info='$(git_prompt_info)' | |
function virtualenv_info_2 { | |
[ $VIRTUAL_ENV ] && ( | |
echo "%{$terminfo[bold]$fg[red]%}v:%{$fg[yellow]%}`basename $VIRTUAL_ENV`%{$reset_color%}" |