Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
sudo -H pip install awscli --ignore-installed six
Collecting awscli [..]
Installing collected packages: pyasn1, rsa, futures, jmespath, six, python-dateutil, docutils, botocore, s3transfer, colorama, awscli Successfully installed awscli-1.10.19 botocore-1.4.10 colorama-0.3.3 docutils-0.12 futures-3.0.5 jmespath-0.9.0 pyasn1-0.1.9 python-dateutil-1.5 rsa-3.3 s3transfer-0.0.1 six-1.4.1
# This file should be placed at /etc/logrotate.d/ | |
/srv/*/shared/log/*.log { | |
daily | |
missingok | |
dateext | |
rotate 30 # amount of days to keep compressed logs (you should backup it up externally) | |
compress | |
delaycompress | |
notifempty |
fromNow = (d) -> | |
unless d instanceof Date | |
d = new Date(d) | |
difference = d - new Date() | |
# string, limit, divider | |
limits = [ | |
["momentos", 1000, 1] | |
["%d segundos", 1000*60, 1000] |
Install and register the FreeTDS driver for unixODBC.
apt-get install tdsodbc
odbcinst -i -d -f /usr/share/tdsodbc/odbcinst.ini
(Optional) Test the DSN-less connection with pyodbc.
apt-get install python-pyodbc
>>> import pyodbc
from scene import * | |
from PIL import Image | |
import sound | |
import random | |
GAME_READY = 0 | |
GAME_PLAY = 1 | |
GAME_DYING = 2 | |
GAME_DEAD = 3 |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
require 'function' | |
# A fibonacci function. | |
fib = Function.new | |
fib[0] = 0 | |
fib[1] = 1 | |
fib[Integer] = ->(i) { fib[i - 2] + fib[i - 1] } | |
p fib[0] # => 0 |