Can check if you're using swap with sudo swapon --show
and free -h
.
Useful for t2.micro and other instances with no access to instance store. Use this if you prefer not to mess with the root volume.
- Create the EBS volume e.g., 1 GB.
{- | |
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: |
from __future__ import division | |
import itertools | |
import json | |
import tweepy | |
# Configuration. | |
USERNAME_LENGTH = 3 | |
SAVE_FNAME = 'twitter_usernames.txt' |
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 + ['_'] |
import Data.Char (digitToInt) | |
import System.IO | |
main :: IO () | |
main = do | |
hSetBuffering stdout NoBuffering | |
putStrLn $ concatMap toFancy $ sumOfDigits fib | |
toFancy :: Integer -> String | |
toFancy x |
<wunderlist-2015062-17-18-11.json jq '.data.tasks | .[] | select(.list_id == 143399535) | select(.completed == false) | .title' --raw-output |
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() |
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
:
user www-data; | |
worker_processes 1; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
sendfile on; |