I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis onto
the box and here's how I did it and some things to look
out for.
To install:
| def chop(matrix, box, direction, results=None): | |
| if results is None: | |
| results = [] | |
| x1, y1, x2, y2 = box | |
| w = x2 - x1 + 1 | |
| h = y2 - y1 + 1 | |
| if w <= 0 or h <= 0: | |
| return results | |
| else: | |
| if direction == 0: |
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: redis-server | |
| # Required-Start: $syslog | |
| # Required-Stop: $syslog | |
| # Should-Start: $local_fs | |
| # Should-Stop: $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: redis-server - Persistent key-value db |
| # ElasticSearch Service | |
| description "ElasticSearch" | |
| start on (net-device-up | |
| and local-filesystems | |
| and runlevel [2345]) | |
| stop on runlevel [016] | |
| respawn |
| /* | |
| Pretty Date script modified from John Resig here http://ejohn.org/blog/javascript-pretty-date | |
| */ | |
| function relativeDateTime (tdate) { | |
| var system_date; | |
| if (typeof (tdate) === "number") { | |
| tdate = new Date(tdate).toString(); | |
| } | |
| if (navigator.userAgent.match(/MSIE\s([^;]*)/)) { |
| #!/usr/bin/env python | |
| import gevent.monkey | |
| gevent.monkey.patch_all() | |
| import boto | |
| import config | |
| import gevent | |
| import gevent.pool | |
| import os |
| import sys | |
| from gevent import server | |
| from gevent.baseserver import _tcp_listener | |
| from gevent.monkey import patch_all; patch_all() | |
| from multiprocessing import Process, current_process, cpu_count | |
| def note(format, *args): | |
| sys.stderr.write('[%s]\t%s\n' % (current_process().name, format%args)) |
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |