Skip to content

Instantly share code, notes, and snippets.

View tedroden's full-sized avatar

Ted Roden tedroden

View GitHub Profile
# From: http://www.staringispolite.com/likepython/
uh from sys import exit
# Grab the user's name.
ok so like name = raw_input("yo! what's your name?" ) right
# Make sure they entered something, then say hi.
if name.strip() is actually like "":
toootally just exit()
;; to run this, start "sbcl"
;; sbcl> (load "hello-world")
;; then point your browser to http://localhost:9021
(require "http-server.lisp" "../http-server.lisp")
;; handle the HTTP request
(defun handle-request (conn)
;; show "Hello Visitor #1" where 1 is the nth connection
(http-server::finish-http-response conn (format nil "<h1>Hello Visitor #~a</h1>"
# Test tornado first
nelson $ ab -n 10000 -c 25 http://127.0.0.1:8888/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
import os
import tornado.httpserver
import tornado.ioloop
import tornado.web
from tornado.options import define, options
# Define options that can be changed as we run this via the command line
define("port", default=8888, help="Run server on a specific port", type=int)
class MainHandler(tornado.web.RequestHandler):
(require "http-server.lisp" "../http-server.lisp")
(in-package :http-server)
;; handle the HTTP request
(defun handle-request (conn)
;; (print "hello")
;; show "Hello Visitor #1" where 1 is the nth connection
(finish-http-response conn (format nil "<h1>Hello Visitor #~a</h1>"
(slot-value conn 'id))))
# these files appear to be exactly the same.
# so why does only one of them open in Preview.app?
# is there a good app to inspect what may be wrong with an image?
/tmp $ md5 file1.png file2.png
MD5 (file1.png) = b7c8add5e521c963490b0bc960253676
MD5 (file2.png) = b7c8add5e521c963490b0bc960253676
/tmp $ shasum file1.png file2.png
blah = """V'z|ybbxvat sbe nabgure FZNYY tebhc
bs|crbcyr gb grpu erivrj zl B'Ervyyl obbx ba gur ernygvzr jro.
Vagrerfgrq|rznvy zr ng grqebqra+ernygvzr-grpu-erivrj@tznvy.pbz
...|Lbh'yy unir gb npghnyyl ybbx ng gur pbqr
naq|znxr fher vg qbrfa'g fgvax
gbb|onq (gubhtu lbh qba'g unir gb npghnyyl eha
gur|pbqr ba rirel rknzcyr). Vs lbh unir
gvzr|gb qb guvf va gur irel arne shgher. Cyrnfr uryc!"""
def l33t_cracker(s, n=13):
root@ip-xx-xx-xx-xxx:~/cloudera-for-hadoop-on-ec2-py-0.3.0-beta# ./hadoop-ec2 launch-cluster trending-test-etc 1
WARNING:boto:Error converting code (Client.UserInitiatedShutdown) to int
WARNING:boto:Error converting code (Client.UserInitiatedShutdown) to int
WARNING:boto:Error converting code (pending) to int
Waiting for master to start (Reservation:r-cc6d41a4)
................................................
WARNING:boto:Error converting code (Client.UserInitiatedShutdown) to int
WARNING:boto:Error converting code (Client.UserInitiatedShutdown) to int
master i-9ff84bf4 ami-ed59bf84 ec2-67-202-19-182.compute-1.amazonaws.com domU-12-31-38-00-C5-A4.compute-1.internal running tedroden-keypair c1.medium 2010-03-22T23:59:25.000Z us-east-1a
WARNING:boto:Error converting code (Client.UserInitiatedShutdown) to int
Ubuntu 10.04 LTS ip-10-202-99-175 tty1
ip-10-202-99-175 login: [1137402.938863] BUG: unable to handle kernel paging request at ffffffffc0c74b48
[1137402.938887] IP: [<ffffffff810b4437>] free_pcppages_bulk+0xf7/0x340
[1137402.938900] PGD 1002067 PUD 1004067 PMD 0
[1137402.938907] Oops: 0000 [#1] SMP
Train and trust your employees. Effective delegation will free you to improve your business.
or
Train and trust your minions to do the menial and mundane. Free your ass and your mind will follow!