start new:
tmux
start new with session name:
tmux new -s myname
<?php | |
function _isCurl() { | |
return function_exists('curl_version'); | |
} | |
if ( _isCurl() ) { | |
echo 'cURL is installed on this server :-)'; | |
} else { | |
echo 'You\'ll need cURL for this...'; |
delete all lines from nw.txt containing snatch | |
perl -pi -e 'if(/snatch/){undef $_}' nw.txt |
/************************************************************************* | |
* Compilation: javac HelloWorld.java | |
* Execution: java HelloWorld | |
* | |
* Prints "Hello, World". By tradition, this is everyone's first program. | |
* | |
* % java HelloWorld | |
* Hello, World | |
* | |
* These 17 lines of text are comments. They are not part of the program; |
<?xml version="1.0" encoding="UTF-8"?> | |
<yahoo-weather-codes> | |
<code number="0" description="tornado"/> | |
<code number="1" description="tropical storm"/> | |
<code number="2" description="hurricane"/> | |
<code number="3" description="severe thunderstorms"/> | |
<code number="4" description="thunderstorms"/> | |
<code number="5" description="mixed rain and snow"/> | |
<code number="6" description="mixed rain and sleet"/> | |
<code number="7" description="mixed snow and sleet"/> |
#!/usr/bin/env python | |
import tornado.auth | |
import tornado.escape | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options | |
import tornado.web | |
class BaseHandler(tornado.web.RequestHandler): | |
def get_current_user(self): |
#!/bin/bash | |
if [ -e /usr/bin/python ] | |
then | |
echo "Python found!" | |
else | |
echo "Python missing!" | |
fi |
chmod cheat sheet | |
PERMISSION COMMAND | |
U G W | |
_____________________________________ | |
|rwx rwx rwx chmod 777 <filename> | | |
|_____________________________________| | |
|rwx rwx r-x chmod 775 <filename> | | |
|_____________________________________| |
import locale | |
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') | |
def pp(num): | |
return locale.format("%d", num, grouping=True) | |
# test print | |
print pp(10000) |
wget -m -np http://project.googlecode.com/svn/project/trunk/ |