-
Check version of Ubuntu:
lsb_release --all
-
Use version to follow instructions on https://www.torproject.org/docs/debian.html.en
-
Install polipo:
sudo aptitude install polipo
-
Add the following lines to
/etc/polipo/config
:
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
user www-data; | |
worker_processes 1; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
sendfile on; |
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
class InterruptableRegion(object): | |
def __init__(self, signum_list=None): | |
if signum_list is None: | |
signum_list = [signal.SIGINT] | |
self.signum_list = signum_list | |
self.reset() | |
def __enter__(self): | |
self.reset() |
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
<wunderlist-2015062-17-18-11.json jq '.data.tasks | .[] | select(.list_id == 143399535) | select(.completed == false) | .title' --raw-output |
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 Data.Char (digitToInt) | |
import System.IO | |
main :: IO () | |
main = do | |
hSetBuffering stdout NoBuffering | |
putStrLn $ concatMap toFancy $ sumOfDigits fib | |
toFancy :: Integer -> String | |
toFancy x |
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
lower = [chr(x) for x in range(ord('a'), ord('z') + 1)] | |
# >>> lower | |
# ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', | |
# 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] | |
digits = [str(x) for x in range(10)] | |
# >>> digits | |
# ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] | |
characters = lower + digits + ['_'] |
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
from __future__ import division | |
import itertools | |
import json | |
import tweepy | |
# Configuration. | |
USERNAME_LENGTH = 3 | |
SAVE_FNAME = 'twitter_usernames.txt' |
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
{- | |
The origin of this puzzle if from #codingame chat. Ideas for the high | |
level approach come from TheNinja. | |
Write a program that outputs all possibilities to put + or - or nothing | |
between the numbers 1,2,...,9 (in this order) such that the result is | |
equal to stdin. For an example: 1 + 2 + 3 - 4 + 5 + 6 + 78 + 9 = 100. | |
Usage: |
OlderNewer