- 2 GB of RAM
- 2 GB of swap
- 2 processor cores
With 2 GB of memory and dual cores, you can run two instances of the thin server (NUM_WEBS=2
), and easily host anything but the largest of forums.
import time | |
def check_file(filename): | |
try: | |
with open(filename): pass | |
return True | |
except IOError: | |
return False | |
def monitor_file(): |
diff --git a/Makefile b/Makefile | |
index 0496238..18c68b2 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -64,7 +64,7 @@ build/go: | |
$(GOBIN): build/go | |
cd build/go/src && \ | |
- PATH="$(BIN):$(HERE)/pythonVE/bin:$(PATH)" ./all.bash | |
+ GO_EXTLINK_ENABLED=0 PATH="$(BIN):$(HERE)/pythonVE/bin:$(PATH)" ./all.bash |
#create & deploy lamp droplet | |
#login via ssh as root | |
#initial setup (ref: http://library.linode.com/getting-started#sph_logging-in-for-the-first-time) | |
# update /etc/hosts (to "thalassophobia.surrealroad.com") | |
nano /etc/hosts | |
# |
#!/usr/bin/python | |
import socket | |
import time | |
FACILITY = { | |
'kern': 0, 'user': 1, 'mail': 2, 'daemon': 3, | |
'auth': 4, 'syslog': 5, 'lpr': 6, 'news': 7, | |
'uucp': 8, 'cron': 9, 'authpriv': 10, 'ftp': 11, | |
'local0': 16, 'local1': 17, 'local2': 18, 'local3': 19, |
[UdpInput] | |
address = "127.0.0.1:2514" | |
parser_type = "packet" | |
decoder = "syslog_sandbox" | |
[syslog_sandbox] | |
type = "SandboxDecoder" | |
script_type = "lua" | |
filename = "/tmp/syslog_decoder.lua" | |
timestamp_field = "syslog_ts" |
-- This Source Code Form is subject to the terms of the Mozilla Public | |
-- License, v. 2.0. If a copy of the MPL was not distributed with this | |
-- file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
-- Original grok filters | |
-- POSINT \b(?:[0-9]+)\b | |
-- GREEDYDATA .* | |
-- HOUR (?:2[0123]|[01][0-9]) | |
-- MINUTE (?:[0-5][0-9]) | |
-- SECOND (?:(?:[0-5][0-9]|60)(?:[.,][0-9]+)?) |
Save books out of Safari Books Online
From http://objectivesea.tumblr.com/post/9033067018/safaribooks
This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack... probably useful to no one else, but here it is.
Requirements:
#!/bin/sh | |
sudo apt-get -qqy update | |
sudo apt-get install -y unzip git make openjdk-7-jdk | |
# Everybody loves that android needs x86 stuff | |
sudo dpkg --add-architecture i386 | |
sudo apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386 |
# Building static nginx for teh lulz | |
# | |
# basic dependencies | |
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev | |
# download nginx and openssl | |
wget http://nginx.org/download/nginx-1.5.6.tar.gz | |
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6 |