This file contains hidden or 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
% ./usenetpatch.py --help | |
usage: usenetpatch.py [-h] {diff,patch} ... | |
positional arguments: | |
{diff,patch} mode | |
diff diff mode | |
patch patch mode | |
optional arguments: | |
-h, --help show this help message and exit |
This file contains hidden or 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 python2 | |
def fileIsBinary(path): | |
text = bytearray([7, 8, 9, 10, 12, 13, 27]) + bytearray(range(0x20, 0x100)) | |
return bool(open(path, 'rb').read(1024).translate(None, text)) |
This file contains hidden or 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 python2 | |
import logging | |
# get root logger | |
log = logging.getLogger() | |
# wrapper to return message after logging | |
def log_return(fn): | |
def wrapper(msg, *args, **kwargs): | |
fn(msg, *args, **kwargs) |
This file contains hidden or 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 python2 | |
import sys | |
import random | |
text = ' '.join(sys.argv[1:]) | |
if not text: | |
sys.exit("usage: %s <text>" % sys.argv[0]) | |
output = [] | |
for char in text: |
This file contains hidden or 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
#!/bin/sh | |
mkinitcpio -g /boot/uImage.new | |
mkimage -n initramfs \ | |
-A arm -O linux -T ramdisk -C gzip \ | |
-d /boot/uImage.new /boot/uInitrd \ | |
-a 0x00000000 -e 0x00000000 |
This file contains hidden or 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
<?php | |
class Extended_property { | |
var $CI; | |
function Extended_property() | |
{ | |
this->CI =& get_instance(); | |
} |
This file contains hidden or 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
ryon.sherman@ryon-laptop /tmp % pacman -U libressl-2.0.0-2-x86_64.pkg.tar.xz | |
loading packages... | |
resolving dependencies... | |
looking for inter-conflicts... | |
:: libressl and openssl are in conflict. Remove openssl? [y/N] y | |
Packages (2): openssl-1.0.1.h-1 [removal] libressl-2.0.0-2 | |
Total Installed Size: 4.93 MiB | |
Net Upgrade Size: -1.23 MiB |
This file contains hidden or 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 php | |
<?php | |
if (!count(debug_backtrace())) { | |
$script = new Script(); | |
print date('l', $script->date).": ". | |
html_entity_decode("[temp 0°:0°:%] "). | |
"[sun {$script->sun->rise}-{$script->sun->set}]". | |
"\n"; | |
} |
This file contains hidden or 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 sh | |
LOC="en-US" | |
for RES in _1920x1200 _1366x768 _1280x720 _1024x768; do | |
XML="http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=${LOC}" | |
URL="http://www.bing.com$(echo $(curl -s ${XML}) | grep -oP "<urlBase>(.*)</urlBase>" | cut -d ">" -f 2 | cut -d "<" -f 1)${RES}.jpg" | |
IMG=${URL##*/} | |
curl -s -o /tmp/$IMG $URL | |
file /tmp/$IMG | grep -i HTML && rm -rf /tmp/$IMG && continue |
This file contains hidden or 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 python2 | |
from subprocess import Popen, PIPE | |
def fortune(db=''): | |
f = Popen(['fortune', db], stdout=PIPE).communicate()[0] | |
return unicode(f).strip().encode('ascii', 'xmlcharrefreplace') |
NewerOlder