Skip to content

Instantly share code, notes, and snippets.

$ traceroute google.com
traceroute: Warning: google.com has multiple addresses; using 74.125.226.200
traceroute to google.com (74.125.226.200), 64 hops max, 52 byte packets
1 10.0.1.1 (10.0.1.1) 2.055 ms 0.698 ms 0.580 ms
2 192.168.1.1 (192.168.1.1) 1.998 ms 0.954 ms 0.818 ms
3 74.108.111.1 (74.108.111.1) 5.601 ms 5.420 ms 4.968 ms
4 g0-14-1-5.nycmny-lcr-21.verizon-gni.net (130.81.177.80) 6.173 ms 5.833 ms 5.347 ms
5 130.81.151.228 (130.81.151.228) 6.291 ms 6.501 ms 7.297 ms
6 0.so-3-2-0.xt2.nyc4.alter.net (152.63.9.249) 5.849 ms 6.507 ms 6.479 ms
7 tengige0-7-2-0.gw8.nyc4.alter.net (152.63.21.129) 7.606 ms
My traceroute [v0.71]
mbp-2.local (0.0.0.0) Wed Apr 25 09:49:48 2012
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. 10.0.1.1 0.0% 1517 0.7 0.7 0.6 35.4 1.4
2. 192.168.1.1 0.0% 1516 1.0 1.0 0.8 9.2 0.6
3. 74.108.111.1 1.8% 1516 4.6 6.4 4.3 117.2 5.6
4. G0-14-1-5.NYCMNY-LCR-21.verizon-gni.net 2.0% 1516 6.3 7.5 5.0 69.4 5.8
5. 130.81.151.228
Sublime Text Cheat Sheet:
Cmd-F to search, Alt-Enter to multiselect
Cmd-Ctrl-G: "Find_all_under"
Ctrl+Shift+Up/Down: multiselect line
Windows:
Cmd+Shift+#: Changes number of windows
Ctrl+Shift+#: Move window to group #
>>> def foo(arg, optional='bar'): pass
...
>>> foo(optional='baz')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: foo() takes at least 1 argument (1 given)
@TimothyFitz
TimothyFitz / gist:3418485
Created August 21, 2012 19:20
ctypes slow
import ctypes, time, array
count = 64 ** 2 * 24
t0 = time.time()
for x in range(100):
v = [0] * count
t1 = time.time()
print "python list", (t1-t0)*10, 'ms'
#!/cygdrive/c/Users/timothy/Packages/pypy-1.9/pypy.exe
#!/cygdrive/c/Python27/python.exe
import platform
print "Running on", platform.python_implementation()
import pyglet
pyglet.options['debug_gl'] = False
[http://timothyfitz.wordpress.com/feed/]
name = Timothy Fitz
[http://progrium.com/blog/atom.xml]
name = Jeff Lindsay
[http://jf.posterous.com/rss.xml]
name = Joël Franusic
[http://feeds.feedburner.com/andymoore/mainfeed]
results = [
(foo, bar*2)
for (foo, bar)
in thing.container.items()
if foo not in ("exclusion", "list") and
bar > 100
]
@TimothyFitz
TimothyFitz / gist:5250201
Last active December 15, 2015 10:59
pysubl
#!/usr/bin/env python
import sys, os, os.path
sys.path.append('.')
# Weird hack, __import__("a.b.c") returns module a unless fromlist is non-empty, then it returns module c
filename = __import__(sys.argv[1], fromlist=["whatever"]).__file__
os.system('subl ' + os.path.dirname(filename))
>>> class Foo(object):
... mylist = []
...
>>> Foo.mylist.append("foo")
>>> f = Foo()
>>> f.mylist.append("bar")
>>> f.mylist
['foo', 'bar']
>>>