- Some utilities:
sudo apt-get install vim tmux git
- Copy/paste from the command line:
sudo apt-get install xclip
// It is important to declare your variables. | |
(function() { | |
var foo = 'Hello, world!'; | |
print(foo); //=> Hello, world! | |
})(); | |
// Because if you don't, the become global variables. | |
(function() { |
There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.
From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?
/* sample aggregate command queries */ | |
// make sure we're using the right db; this is the same as "use mydb;" in shell | |
db = db.getSisterDB("aggdb"); | |
// just passing through fields | |
var p1 = db.runCommand( | |
{ aggregate : "article", pipeline : [ | |
{ $project : { | |
tags : 1, | |
pageViews : 1 |
var cluster = require('cluster'), | |
app = require('./app'); | |
var workers = {}, | |
count = require('os').cpus().length; | |
function spawn(){ | |
var worker = cluster.fork(); | |
workers[worker.pid] = worker; | |
return worker; |
echo "This script requires superuser access to install apt packages." | |
echo "You will be prompted for your password by sudo." | |
# clear any previous sudo permission | |
sudo -k | |
cd ~ | |
sudo sh <<SCRIPT | |
apt-get update | |
apt-get install openjdk-7-jre-headless -y |
sudo add-apt-repository ppa:webupd8team/sublime-text-2 && sudo apt-get update && sudo apt-get install sublime-text && sudo ln -s /usr/lib/sublime-text-2/sublime_text /usr/local/bin/sublime |
cd /usr/local/share | |
sudo wget https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linux-x86_64.tar.bz2 | |
sudo tar -xjf phantomjs-1.9.0-linux-x86_64.tar.bz2 | |
sudo ln -sf /usr/local/share/phantomjs-1.9.0-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs | |
sudo rm /usr/local/share/phantomjs-1.9.0-linux-x86_64.tar.bz2 | |
phantomjs --version |
# Run me with: | |
# | |
# $ nginx -p /path/to/this/file/ -c nginx.conf | |
# | |
# All requests are then routed to authenticated user's index, so | |
# | |
# GET http://user:password@localhost:8080/_search?q=* | |
# | |
# is rewritten to: | |
# |