Skip to content

Instantly share code, notes, and snippets.

View shobhitsinghal624's full-sized avatar

Shobhit Singhal shobhitsinghal624

View GitHub Profile
#!/bin/bash
# node.js using PPA (for statsd)
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
# Install git to get statsd
sudo apt-get install git
sudo apt-get install python-cairo python-memcache python-sqlite memcached python-django-tagging python-django libapache2-mod-python apache2 libapache2-mod-wsgi git-core python-pyparsing python-tz libdbd-mysql-perl libmysqlclient-dev libmysqlclient18 mysql-client-5.5 mysql-client-core-5.5 mysql-common python-mysqldb
mkdir -p /var/tmp/software
cd /var/tmp/software
git clone https://github.com/graphite-project/graphite-web.git
git clone https://github.com/graphite-project/carbon.git
git clone https://github.com/graphite-project/whisper.git
for i in whisper carbon graphite-web; do
var RTBkit = require('./build/x86_64/bin/rtb.node');
var services = require('./build/x86_64/bin/services.node');
var zookeeperUri = "localhost:2181"; // must point to same Zookeeper as routers
var services = new services.ServiceProxies();
services.useZookeeper(zookeeperUri);
services.logToCarbon('localhost:2003');
var agent = new RTBkit.BiddingAgent("myAgent", services);
var RTBkit = require('../build/x86_64/bin/rtb.node');
var services = require('../build/x86_64/bin/services.node');
var zookeeperUri = "localhost:2181"; //must point to same Zookeeper as routers
var services = new services.ServiceProxies();
services.bootstrap('bootstrap.json');
var agent = new RTBkit.BiddingAgent('myAgent', services);
#################
# Update packages
#################
DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes update
DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes upgrade
########################
# Install the Oracle JDK
########################
#################
# Update packages
#################
DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes update
DEBIAN_FRONTEND="noninteractive" sudo apt-get --assume-yes upgrade
########################
# Install the Oracle JDK
########################
/**
* api/models/User.js
*
* The user model contains the instance method for validating the password.
*/
var bcrypt = require('bcrypt');
function hashPassword(values, next) {
bcrypt.hash(values.password, 10, function(err, hash) {
var SailsOrm = require([path to sails]'/lib/hooks/orm');
var _ = require( 'lodash' );
var async = require('async');
function orm ()
{
/**
* Start the ORM layer
*
// add the filter to your application module
angular.module('yourAppName', ['filters']);
/**
* Truncate Filter
* @Param string
* @Param int, default = 10
* @Param string, default = "..."
* @return string
*/
@shobhitsinghal624
shobhitsinghal624 / .gitconfig
Last active November 15, 2016 05:56
Scripts to initialize a new ubuntu instance (apt-get installs; .screenrc; .vimrc)
[user]
name = Shobhit Singhal
email = shobhitsinghal624@gmail.com
[color]
ui = auto
[push]
default = current
[pull]
default = current
[diff]