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
var Client = require('mysql').Client, | |
client = new Client(); | |
client.user = 'user'; | |
client.password = 'password'; | |
client.host='127.0.0.1'; | |
client.port='3306'; | |
client.database='DB' | |
client.connect(); | |
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
DEFAULT_RUBY_VERSION="1.9.3-p125" | |
sudo apt-get update | |
sudo apt-get -y install curl git-core bzip2 build-essential zlib1g-dev libssl-dev autoconf libreadline6-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libgdbm-dev libncurses5-dev libtool bison pkg-config libffi-dev | |
if [ -x /usr/local/rvm/bin/rvm ]; then | |
echo "RVM Found..nothing to do"; | |
else | |
echo "Installing RVM"; | |
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
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -xvzf ruby-1.9.3-p194.tar.gz | |
cd ruby-1.9.3-p194/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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/bash | |
mkdir -p /tmp/aws | |
mkdir -p /opt/aws | |
curl --silent -o /tmp/aws/ec2-ami-tools.zip http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip | |
rm -fR /tmp/aws/ec2-ami-tools-* | |
unzip -d /tmp/aws /tmp/aws/ec2-ami-tools.zip | |
rm -fR /opt/aws/ec2-ami-tools | |
mv /tmp/aws/ec2-ami-tools-* /opt/aws/ec2-ami-tools | |
rm -f /tmp/aws/ec2-ami-tools.zip |
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
// base | |
var Padre = function(){ | |
// atributos de la clase padre | |
this.yo = "soy el padre", | |
this.nacionalidad = "Argentino", | |
// metodos de la clase padre | |
this.saludar = function(){ alert(this.yo) }, | |
this.donde = function(){ alert("soy "+ this.nacionalidad)} | |
} |
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
# | |
# based on: http://knowledgevoid.com/blog/2012/01/13/logging-the-correct-ip-address-using-apache-2-2-x-and-amazons-elastic-load-balancer/ | |
# mod_evasive based on | |
# https://www.linode.com/docs/websites/apache-tips-and-tricks/modevasive-on-apache | |
# update cloudflare download link | |
# make sure you're root | |
sudo -i |
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
git rm $(git ls-files --deleted) | |
This will ONLY remove the deleted files from the git. | |
It could be also be used for adding ONLY modified files also. | |
git add $(git ls-files --modified) |
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
sed ':a;N;$!ba;s/\n/\\n/g' my_key.pem | |
or in vi | |
:%s/\n/\\n/ | |
https://tickets.opscode.com/browse/CHEF-3540 |
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
// This script will boot app.js with the number of workers | |
// specified in WORKER_COUNT. | |
// | |
// The master will respond to SIGHUP, which will trigger | |
// restarting all the workers and reloading the app. | |
var cluster = require('cluster'); | |
var workerCount = process.env.WORKER_COUNT || 2; | |
// Defines what each worker needs to run |
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
from https://www.howtoforge.com/postgresql-ssl-certificates | |
This describes how to set up ssl certificates to enable encrypted connections from PgAdmin on some client machine to postgresql on a server machine. The assumption is that postgresql (compiled with ssl support) and openssl are already installed and functional on the server (Linux). PgAdmin is already installed on the client (either Windows or Linux). | |
On the server, three certificates are required in the data directory. CentOS default is /var/lib/pgsql/data/: | |
root.crt (trusted root certificate) | |
server.crt (server certificate) | |
server.key (private key) | |
Issue commands as root. |
OlderNewer