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
# Disable crontab -r | |
function crontab () | |
{ | |
# Replace -r with -e | |
/usr/bin/crontab "${@/-r/-e}" | |
} |
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
$ cat /proc/cpuinfo | grep "model name" | uniq | |
model name : Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz | |
$ uname -a | |
Linux Q8400 3.5.0-37-generic #58-Ubuntu SMP Mon Jul 8 22:07:55 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux | |
$ python --version | |
Python 2.7.3 | |
$ python -m timeit '"-".join(str(n) for n in range(100))' | |
10000 loops, best of 3: 24.4 usec per loop |
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 os | |
from autobahn.resource import WebSocketResource, WSGIRootResource | |
from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol | |
from flask import Flask, render_template | |
from twisted.application import internet, service | |
from twisted.internet import reactor | |
from twisted.python.threadpool import ThreadPool | |
from twisted.web.server import Site |
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
#install node.js on ubuntu | |
sudo add-apt-repository ppa:chris-lea/node.js -y | |
sudo apt-get update | |
sudo apt-get install nodejs |
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
# http://stackoverflow.com/questions/748324/python-convert-those-tinyurl-bit-ly-tinyurl-ow-ly-to-full-urls | |
############# | |
# urllib2 | |
import urllib2 | |
fp = urllib2.urlopen('http://bit.ly/rgCbf') | |
fp.geturl() | |
# ==> 'http://webdesignledger.com/freebies/the-best-social-media-icons-all-in-one-place' |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/> | |
<script src="http://cmx.io/v/0.1/cmx.js"></script> | |
<body> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> | |
<tspan x="0" y="0em">Comix Sample</tspan> | |
</label> | |
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|-1,59"> |