start new:
tmux
start new with session name:
tmux new -s myname
# Install ARCH Linux with encrypted file-system and UEFI | |
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
# Download the archiso image from https://www.archlinux.org/ | |
# Copy to a usb-drive | |
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
# Set swedish keymap |
from nonlocal_ import nonlocal_ | |
def foo(): | |
a = 1 | |
def bar(): | |
nonlocal_('a') | |
a = 2 | |
bar() | |
return a |
# -*- coding: utf-8 -*- | |
""" | |
proxy.py | |
~~~~~~~~ | |
get proxy list from http://pachong.com | |
""" | |
from bs4 import BeautifulSoup | |
import requests |
import gevent | |
from gevent import monkey, queue | |
monkey.patch_all() | |
import urllib2 | |
from time import sleep | |
import traceback | |
import logging |
import gevent | |
from gevent import monkey, queue | |
monkey.patch_all() | |
import urllib2 | |
from time import sleep | |
import traceback | |
import logging |
from gcrawler import GCrawler, Downloader | |
import unittest | |
import urllib2 | |
import logging | |
import traceback | |
from datetime import datetime | |
import re | |
logging.basicConfig(level=logging.DEBUG) |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Simple async crawler/callback queue based on gevent.""" | |
import traceback | |
import logging | |
import httplib2 | |
import gevent |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
function JSON_stringify(s, emit_unicode) | |
{ | |
var json = JSON.stringify(s); | |
return emit_unicode ? json : json.replace(/[\u007f-\uffff]/g, | |
function(c) { | |
return '\\u'+('0000'+c.charCodeAt(0).toString(16)).slice(-4); | |
} | |
); | |
} |