Skip to content

Instantly share code, notes, and snippets.

View henrysher's full-sized avatar
💭
I may be slow to respond.

Henry Huang henrysher

💭
I may be slow to respond.
View GitHub Profile
@henrysher
henrysher / uri_validate.py
Created December 26, 2011 08:40 — forked from mnot/uri_validate.py
uri_validate.py: Validation regex for URIs, URI references, and relative URIs
#!/usr/bin/env python
"""
Regex for URIs
These regex are directly derived from the collected ABNF in RFC3986
(except for DIGIT, ALPHA and HEXDIG, defined by RFC2234).
They should be processed with re.VERBOSE.
"""
D, [2012-01-18T09:16:21.806438 #21498] DEBUG -- : Executing 'cd /var/lib/rpm/ && cat /tmp/Packages.dump | /usr/lib/rpm/rpmdb_load Packages' command...
D, [2012-01-18T09:16:33.289224 #21498] DEBUG -- : Command 'cd /var/lib/rpm/ && cat /tmp/Packages.dump | /usr/lib/rpm/rpmdb_load Packages' executed.
D, [2012-01-18T09:16:33.313033 #21498] DEBUG -- : Executing 'rpm --rebuilddb' command...
D, [2012-01-18T09:17:33.666334 #21498] DEBUG -- : Command 'rpm --rebuilddb' executed.
D, [2012-01-18T09:17:33.666974 #21498] DEBUG -- : RPM database recreated...
I, [2012-01-18T09:17:33.667333 #21498] INFO -- : Executing post operations after build...
D, [2012-01-18T09:17:33.668264 #21498] DEBUG -- : Executing '/opt/ks.sh' command...
D, [2012-01-18T09:21:07.010384 #21498] DEBUG -- : Command '/opt/ks.sh' executed.
D, [2012-01-18T09:21:07.012541 #21498] DEBUG -- : Post commands from appliance definition file executed.
T, [2012-01-18T09:21:07.012973 #21498] TRACE -- : Closing guestfs...
name: test-vmware
summary: Just Enough Operating System based on CentOS 6
os:
name: centos
version: 6
hardware:
partitions:
"/":
size: 2
"/boot":
/etc/qemu/target-x86_64.conf
/etc/rc.d/init.d/qemu
/etc/sasl2/qemu.conf
/usr/bin/qemu
/usr/bin/qemu-alpha
/usr/bin/qemu-arm
/usr/bin/qemu-armeb
/usr/bin/qemu-cris
/usr/bin/qemu-ga
/usr/bin/qemu-i386
@henrysher
henrysher / TestingUploadSe2Sauce.java
Created February 3, 2012 07:59 — forked from santiycr/TestingUploadSe2Sauce.java
Remote File Upload using Selenium 2's FileDetectors
import junit.framework.Assert;
import junit.framework.TestCase;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.*;
import java.net.URL;
import java.util.concurrent.TimeUnit;
public class TestingUploadSe2Sauce extends TestCase {
private RemoteWebDriver driver;
@henrysher
henrysher / tag_instance.py
Created February 9, 2012 05:08 — forked from garnaat/tag_instance.py
Add a new/value tag to an instance
>>> import boto
>>> c = boto.connect_ec2()
>>> reservations = c.get_all_instances()
>>> reservations
[Reservation:r-b73716d6]
>>> instance = reservations[0].instances[0]
>>> instance
Instance:i-366c4354
>>> instance.tags
{}
Xen Minimal OS!
start_info: 0x1890000(VA)
nr_pages: 0x1e0000
shared_inf: 0xbdaeb000(MA)
pt_base: 0x1893000(VA)
nr_pt_frames: 0x11
mfn_list: 0x990000(VA)
mod_start: 0x0(VA)
mod_len: 0
flags: 0x0
LABEL=79d3d2d4 / ext4 defaults 1 1
/dev/xvdb /mnt ext3 defaults 0 0
/dev/xvdc /data ext3 defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
@henrysher
henrysher / LICENSE.txt
Created February 20, 2012 14:22 — forked from aemkei/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@henrysher
henrysher / gistie.rb
Created April 22, 2012 02:51 — forked from martinisoft/gistie.rb
command-line posting to gist
#!/usr/bin/env ruby
# Made by Pieter de Bie <frimmirf@gmail.com>
# Based on a "Pastie" task by someone
require "tempfile"
GIST_URL = 'http://gist.github.com/gists'
GIST_LOGIN_URL = 'https://gist.github.com/session'
USERNAME = "martinisoft"
TOKEN = "6ef8395fecf207165f1a82178ae1b984"