Skip to content

Instantly share code, notes, and snippets.

GITHUB_PROJECT = “https://github.com/zagadishreddy/game-of-life.git”
GITHUB_CREDENTIALS_ID = “Telcel” //maps to a Jenkins Credentials Vault ID
APPLICATION_NAME = “Telcel”
GITHUB_BRANCH = ‘${env.BRANCH_NAME}’
node{
// Stages
stage (“Listing Branches”) {
echo “Initializing workflow”
//checkout code
echo GITHUB_PROJECT
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
ruby -v
var http = require('http');
var crypto = require("crypto");
module.exports = function(method, path, bucket, accesskey, secretkey){
var now = new Date().toUTCString();
var returnChar = '\n';
var strToSign = unescape(encodeURIComponent(method + returnChar +
returnChar + returnChar + returnChar + 'x-amz-date:' + now +
returnChar + path+bucket));
@rajesh-gonuguntla
rajesh-gonuguntla / clean_tmp_files_after_x_minutes_or_seconds.txt
Last active September 5, 2015 03:06
How to clear tmp folder every x seconds or minutes
// Step 1 Install tmpreaper
sudo apt-get install tmpreaper
/**
tmpreaper recursively searches for and removes files and empty
directories which haven’t been accessed for a given number of seconds.
Normally, it’s used to clean up directories which are used for
temporary holding space, such as "/tmp". Please read the WARNINGS
section of this manual.
@rajesh-gonuguntla
rajesh-gonuguntla / gist:35552934c0e024d2956c
Last active September 5, 2015 03:09
Delete_files_from_folder
find /tmp/ -name "*.JPG" -print0 | xargs -0 rm
@rajesh-gonuguntla
rajesh-gonuguntla / gist:21aa8acf65b2cbe4e47c
Created May 8, 2014 03:48
Where do you find mongodb start up logs on Ubuntu
/var/log/mongodb/mongodb.log
@rajesh-gonuguntla
rajesh-gonuguntla / mongodb installation
Created February 20, 2014 11:13
Install mongodb on ubuntu
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
sudo touch -c /etc/apt/sources.list.d/mongodb.list
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen
@rajesh-gonuguntla
rajesh-gonuguntla / gist:5926685
Created July 4, 2013 10:39
Changing indexes in mongodb
To change indexes in mongodb, first of all you may need to drop current index and then ensure to index on the attributes you want the index.
How to drop an index:
db.things.dropIndex("field/attributename");
How to add index of the new fields :
db.things.ensureIndex({field1:1, field2:1},{unique:true});