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
#!/bin/sh | |
set -eux | |
INSTALL_DIR=/opt/nodejs | |
CURRENT=$(node -v || true) | |
VERSION=$(curl -L -s http://nodejs.org/dist/latest/ \ | |
| egrep -o '[0-9]+\.[0-9]+\.[0-9]+' \ | |
| tail -n1) | |
PLATFORM="$(uname | tr 'A-Z' 'a-z')" |
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
set -eux | |
INSTALLTO="${INSTALLTO:-/opt/mongodb}" | |
INSTALLED="$(mongo --version 2>/dev/null | sed -n '1{s/.*[^0-9.]\([0-9.]*\)/\1/g;p};q')" | |
LATEST="${LATEST:-$(curl -s 'http://www.mongodb.org/downloads' | sed -n 's/.*Production Release (\([0-9.]*\)).*/\1/g;ta;b;:a;p')}" | |
PLATFORM="${PLATFORM:-$(uname | tr A-Z a-z)}" | |
ARCH="${ARCH:-$(uname -m)}" | |
if [ "x$INSTALLED" = "x$LATEST" ] | |
then |
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
# Parse user@host:port into its constituent parts, with defaults. | |
# Explode if there are errors: | |
set -eu | |
# The parser with defaults: | |
parse() { | |
target="$1" |
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
hostssl replication replicator 5.6.7.8 md5 |
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
(( ( $(date +%s) - $(date -d"$(stat -c %y /var/lib/apt/lists)" +%s) ) < 36000 )) || apt-get update |
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
function setContentFromUrl(url, container, opt){ | |
console.log("loading", url, "into", container); | |
opt = opt || {}; | |
var data_filter = opt.filter; | |
var err_handler = opt.err_handler; | |
var xhr= new XMLHttpRequest(); | |
xhr.open('GET', url, true); | |
xhr.onreadystatechange= function() { | |
if (this.readyState!==4) return; | |
if (this.status!==200){ |
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
{"error": 42716.2954, "samples": 506, "value": [22.532806324110698], "label": "RM <= 6.94", "type": "split", "children": [{"error": 17317.3210, "samples": 430, "value": [19.93372093023257], "label": "LSTAT <= 14.40", "type": "split", "children": [{"error": 6632.2175, "samples": 255, "value": [23.349803921568636], "label": "DIS <= 1.38", "type": "split", "children": [{"error": 390.7280, "samples": 5, "value": [45.58], "label": "CRIM <= 10.59", "type": "split", "children": [{"error": 0.0000, "samples": 4, "value": [50.0], "label": "Leaf - 4", "type": "leaf"}, {"error": 0.0000, "samples": 1, "value": [27.9], "label": "Leaf - 5", "type": "leaf"}]}, {"error": 3721.1632, "samples": 250, "value": [22.90520000000001], "label": "RM <= 6.54", "type": "split", "children": [{"error": 1636.0675, "samples": 195, "value": [21.629743589743576], "label": "LSTAT <= 7.57", "type": "split", "children": [{"error": 129.6307, "samples": 43, "value": [23.969767441860473], "label": "TAX <= 222.50", "type": "split", "children": [{"err |
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
<VirtualHost *:80> | |
ServerName your.host.com | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> | |
# Rewrite links to 8086 on the way out: |
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
# start with your certificate: | |
cert=my.crt | |
# we will copy the individual certificates to 001.crt, 002.crt and so on: | |
counter=0 | |
# Now, for each certificate: | |
link="$(printf "%03d.crt" $((++counter)))" # 001.cert, 002.crt, ... | |
# Check that the certificate is in the human readable PEM format. | |
# If not it needs to be converted. Then copy into 001/2/3.crt | |
if openssl x509 -in "$cert" -text -noout &>/dev/null |
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
// Language constants. | |
var x = ' hen di tri tetra penta hexa hepta octa ennea deca hendeca dodeca triskaideca tetrakaideca pentakaideca hexakaideca heptakaideca octakaideca enneakaideca icosa'.split(' '); | |
var y = ' ,,icosa,conta ,hecato,diacosio,cosioi ,chilia,diachilia,chilia'.split(' ').map(function(s){return s.split(',')}); | |
var z = x.map(function(x){return x+(x[x.length-1]==='a'?'':'a')}); | |
// Convert any number - up to a few thousand, to a numeric prefix. | |
function grekify(n){ | |
n = String(n); // Greek numbers are deca-mal | |
return x[n] || n && [(n[0]>2?z[n[0]]:''),y[n.length][n[0]>2?3:n[0]],grekify(n.slice(1))].join(''); | |
} |
OlderNewer