Skip to content

Instantly share code, notes, and snippets.

View abhishekkr's full-sized avatar
:octocat:
update your licenses

AbhishekKr abhishekkr

:octocat:
update your licenses
View GitHub Profile
@abhishekkr
abhishekkr / get-python-pip-venv.sh
Created February 8, 2014 11:22
get-python-pip-venv.sh
#!/usr/bin/env bash
export LANGUAGE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="UTF-8"
export LANG="en_US.UTF-8"
##### Var
PIP='pip'
@abhishekkr
abhishekkr / just-delay.js
Created May 30, 2014 15:38
some quick replicated javascript functions for light offline tryouts
// dumb non-jquery delay for quick offline tryouts
function delay(milliseconds) {
var _start = new Date().getTime();
for (;;) {
var _now = new Date().getTime();
if ((_now - _start) > milliseconds){
break;
}
}
@abhishekkr
abhishekkr / mdbm.quicksetup.rhel6BaseDistros.sh
Created December 27, 2014 05:09
MDBM workspace quick-setup helper
#!/usr/bin/env bash
set -e
#####
# MDBM workspace quick-setup helper
#####
GARAGE_BASEDIR="/tmp/mdbm-garage"
MDBM_BASEDIRNAME="github-yahoo-mdbm"
MDBM_GITURI="https://github.com/yahoo/mdbm"
@abhishekkr
abhishekkr / gist:2479100
Created April 24, 2012 11:59
just a quick PuppetMaster Service Script for gem installed puppet set-up
#!/usr/bin/env ruby
module PuppetMaster
def self.puppetmaster_cmd
'puppet master --debug --verbose'
end
def self.start
puts "Starting Puppet Master in Debug+Verbose+Daemon mode logging to /var/log/puppet/a.log"
puts "Started." if system("#{puppetmaster_cmd} >> /var/log/puppet/a.log")
@abhishekkr
abhishekkr / puppet-module-sample.rb
Created July 8, 2012 12:33
Puppet Module ~ Code Sample Describing usage of manifests, templates, files, lib, specs, tests
http://justfewtuts.blogspot.com/2012/07/puppet-beginners-concept-guide-part-2.html
<tomcat-module>/manifests/install.pp
class <tomcat-module>::install {
package { 'tomcat6': ensure => 'installed', }
}
<tomcat-module>/manifests/configure.pp
class <tomcat-module>::configure {
<tomcat-module>::configure::war {
@abhishekkr
abhishekkr / term_color.rb
Created September 3, 2012 15:46
Making Terminal Ruby Apps ~ have a colored terminal output adding to verbosity
# get colored terminal output using these String methods
class String
def colortxt(txt, term_color_code)
"\e[#{term_color_code}m#{txt}\e[0m"
end
def bold; colortxt(self, 1); end
def thin; colortxt(self, 2); end
@abhishekkr
abhishekkr / git.pp
Created September 9, 2012 11:49
Puppet Module : No Code In Data ~ Externalize into Params Manifest
# $MODULEPATH/httpd/manifests/git.pp
class httpd::git {
include httpd::params
$is_cgi = $httpd::params::is_cgi
$path = $httpd::params::path
$url = $httpd::params::url
file {
@abhishekkr
abhishekkr / common.csv
Created September 9, 2012 12:07
Puppet Module : No Code In Data ~ Externalize Data into separately managed CSV files
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2. in line 1.
# $MANIFESTPATH/extdatadir/common.csv
httpd_conf_dir,/etc/httpd/conf.d
httpd_is_cgi,true
httpd_git_path,/var/www/git
httpd_git_url,/mygit
@abhishekkr
abhishekkr / git.pp
Created September 9, 2012 15:16
Puppet Module : No Code In Data ~ create Facts using URL, File or any System Computation
# $MODULEPATH/httpd/manifests/git.pp
class httpd::git {
file {
"${::conf_dir}/git.conf":
ensure => 'present',
content => template('httpd/mynode.conf.erb'),
}
}
@abhishekkr
abhishekkr / gist:3881708
Created October 12, 2012 21:44
linux service script for resque-scheduler
#!/bin/sh
#
# chkconfig: - 85 15
# description: resque-scheduler service script
#
app_name=$MY_APP_NAME
pidfile_sched="/var/run/$MY_APP_NAME-resque-sched.pid"
app_dir="/opt/$MY_APP_NAME"