This file contains hidden or 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 | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
This file contains hidden or 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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "precise64" |
This file contains hidden or 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/bash | |
JAVA_FILE_SOURCE="jdk-7u45-linux-x64.tar.gz" | |
REMOTE_JAVA_SDK="http://download.oracle.com/otn-pub/java/jdk/7u45-b18/${JAVA_FILE_SOURCE}" | |
wget --header "Cookie:oraclelicensejdk-7u5-oth-JPR=accept-securebackup-cookie;gpw_e24=http://edelivery.oracle.com" $REMOTE_JAVA_SDK --no-check-certificate |
This file contains hidden or 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
object Money { | |
// Equation: x = 1*foo + 7*bar + 11*qix + 21*bar | |
val FOO = 1; val BAR = 7; val QIX = 11; val BAZ = 21; | |
def change(cents: Int): List[Map[String, Int]] = { | |
lazy val tuple = for ( | |
foo <- 0 to cents; bar <- 0 to (cents - FOO * foo) / BAR; | |
qix <- 0 to (cents - FOO * foo - BAR * bar) / QIX; | |
baz <- 0 to (cents - FOO * foo - BAR * bar - QIX * qix) / BAZ | |
) yield (foo, bar, qix, baz) | |
Stream(tuple: _*) |
This file contains hidden or 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 graphite | |
DocumentRoot "/opt/graphite/webapp" | |
ErrorLog /opt/graphite/storage/log/webapp/error.log | |
CustomLog /opt/graphite/storage/log/webapp/access.log common | |
<Location "/"> | |
SetHandler python-program | |
PythonPath "['/opt/graphite/webapp'] + sys.path" | |
PythonHandler django.core.handlers.modpython |
This file contains hidden or 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/bash | |
for vm in `VBoxManage list runningvms | awk '{ print $1 }' | sed "s/\"//g"`; do | |
VBoxManage controlvm "$vm" poweroff | |
done | |
for vm in `VBoxManage list vms | awk '{ print $1 }' | sed "s/\"//g"`; do | |
VBoxManage unregistervm --delete "$vm" | |
done |
This file contains hidden or 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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("flowdock.com") { | |
.chat-message, .comment-message, .action-message, .line-message, .status-message, .file-message, .error-message { | |
padding-top: 0 !important; | |
padding-bottom: 0 !important; | |
font-family: Ubuntu,Tahoma,sans-serif !important; | |
font-size: 10px !important; | |
} | |
} |
This file contains hidden or 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
# TO_FOLDER=/something | |
# FROM=/your-es-installation | |
DATE=`date +%Y-%m-%d_%H-%M` | |
TO=$TO_FOLDER/$DATE/ | |
echo "rsync from $FROM to $TO" | |
# the first times rsync can take a bit long - do not disable flusing | |
rsync -a $FROM $TO | |
# now disable flushing and do one manual flushing |
This file contains hidden or 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
var config = { | |
"database": { | |
"connection": "mongodb://localhost/scrapService" | |
}, | |
"cookieSecret": "EhAIj3NmtJ1sem5StHXV0Mk" | |
}; | |
require("./user") | |
var express = require('express') | |
, mongoose = require('mongoose') | |
, User = mongoose.models["User"] |
OlderNewer