Inspired on this other gist
function hook(callback){
var oldWrite = process.stdout.write;
var output = { str : '' };
return {
restore : function(){| namespace :mongo do | |
| def db_name | |
| Mongoid.database.name | |
| end | |
| def db_connection_options | |
| host, port = Mongoid.database.connection.host_to_try | |
| auths = Mongoid.database.connection.auths |
| #!/bin/bash | |
| set -e | |
| cd ~/ | |
| wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.65.tar.gz | |
| tar -zxf mysql-5.1.65.tar.gz | |
| cd mysql-5.1.65 | |
| ./configure '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-system-type=debian-linux-gnu' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-fast-mutexes' '--with-big-tables' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-libwrap' '--without-readline' '--with-ssl' '--without-docs' '--with-extra-charsets=all' '--with-plugins=max' '--with-embedded-server' '--with-embedded-privilege-control' | |
| make |
| var util = require('util') | |
| function hook_stdout(callback) { | |
| var old_write = process.stdout.write | |
| process.stdout.write = (function(write) { | |
| return function(string, encoding, fd) { | |
| write.apply(process.stdout, arguments) | |
| callback(string, encoding, fd) | |
| } |
Inspired on this other gist
function hook(callback){
var oldWrite = process.stdout.write;
var output = { str : '' };
return {
restore : function(){| #!/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 |
Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN server on a Ubuntu or Debian instance. Tested with Ubuntu 14.04 & 12.04 and Debian 8 (Jessie).
With minor modifications, this script can also be used on dedicated servers or any KVM- or XEN- based Virtual Private Server (VPS) from other providers.
Alternative VPN script for CentOS/RHEL
Original post by Thomas Sarlandie
Reference
https://jira.appcelerator.org/browse/NODEJS-2685
https://jira.appcelerator.org/browse/CLI-1138
https://wiki.appcelerator.org/display/PartnerDocs/Registry+and+Security+Server
| /** | |
| * MongoDB NodeJS Driver Production Connection Example | |
| * | |
| * Copyright (c) 2015 ObjectLabs Corporation | |
| * Distributed under the MIT license - http://opensource.org/licenses/MIT | |
| */ | |
| var MongoClient = require('mongodb').MongoClient; | |
| /** |
| #!/bin/bash | |
| bucket=$1 | |
| set -e | |
| echo "Removing all versions from $bucket" | |
| versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'` | |
| markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'` |