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 / gist:4078239
Created November 15, 2012 11:44
foodcritic RakeTask that worked for me
require 'bundler/setup'
require 'foodcritic'
task :default => [:foodcritic]
task :foodcritic do
cookbooks = File.absolute_path(File.join File.dirname(__FILE__), 'cookbooks')
puts 'FoodCritic running...
would criticize if finds anything, not cycnical to blabber otherwise.'
@abhishekkr
abhishekkr / gist:4137843
Created November 24, 2012 00:39
shell.func-download-all-videos-of-any-event-on-CONFREAKS
# Usage Example: $ ddl-confreaks rubyconf2012 ~/Downloads/
# save it as /etc/profiles/ddl.confreaks.sh
##
## currently it checks for lowest resolution video mostly {640x360} and downloads it
function ddl-confreaks(){
if [ $# -ne 2 ];
then
echo 'Failed. Syntax: $> ddl-confreaks EVENT_NAME DOWNLOAD_PATH'
return
@abhishekkr
abhishekkr / gist:4156364
Last active October 13, 2015 06:48
shell.func-download-all-media-from-RSS
#####
## $ ddl-rss-media https://www.defcon.org/podcast/defcon-20-slides.rss
#####
ddl-rss-media(){
# ddl-rss-media RSS_LINK {would download all media enclosed at current dir}
enclosures=`curl -k -s -L $@ | cat | grep enclosure | sed 's/.*enclosure\s*url="//' | sed 's/".*//'`
for url in `echo $enclosures | xargs -L1`;
do
if [ ! -z $url ];
@abhishekkr
abhishekkr / a.wallpaper.sh
Created January 1, 2013 19:24
shell.func to download the latest entry in reddit/r/wallpapers (for now)
#!/bin/bash
# Usage Example: $ ddl-wally
# would download the latest entry in reddit/r/wallpapers (for now) at current location
# save it as /etc/profiles/a.wallpaper.sh
##
function ddl-wally(){
curl -skL http://www.reddit.com/r/wallpaper/new/\?sort\=new | sed 's/.*<a class="title " href="//im' | sed 's/".*//' | tail -1 | xargs wget -c
}
@abhishekkr
abhishekkr / virtualhost01.conf
Created January 13, 2013 21:59
Apache HTTPD VirtualHost ~ story of default route opted
# Multiple VirtualHosts Entry can be made to handle different internal servers serving via single external node
# Since it picks up first VirtualHost as default route... all unhandled requests served by first VirtualHost
NameVirtualHost *:80
ServerName servernode
<VirtualHost *:80>
ServerName www.about.server.node
ServerAlias about.server.node
@abhishekkr
abhishekkr / decorated_sample01.py
Created May 16, 2013 15:21
pycallgraph examples
#!/usr/bin/env python
"""
require 'pycallgraph' library to be installed with graphviz,
and the attached "pycallgraph_decorator.py" file to be present as well
to provide the decorator used
"""
from pycallgraph_decorator import callgraph
@abhishekkr
abhishekkr / $conf_dir hiera.yaml
Last active December 20, 2015 12:39
Puppet Module : No Code In Data ~ using Hiera with multiple backends
:backends:
- http
- redis
- yaml
- json
:http:
:host: testnode.testenv.abk
:port: 5984
:output: json
@abhishekkr
abhishekkr / raguel_eg_01.sh
Last active December 20, 2015 23:19
RAGUEL ~ usage examples
## usage example for RAGUEL : https://github.com/abhishekkr
RAGUEL_URL="https://github.com/abhishekkr/raguel/archive/master.tar.gz"
RAGUEL_TGZ="raguel.tgz"
RAGUEL_SRC="./raguel-master/src/raguel.sh"
curl -kL -o $RAGUEL_TGZ $RAGUEL_URL
tar -zxf raguel.tgz
cat > ./install_htop << EOF
@abhishekkr
abhishekkr / routing-10Head.sh
Created October 28, 2013 15:56
patched service scripts for FreeBSD v9.2; and v10HEAD
#!/bin/sh
#
# Configure routing and miscellaneous network tunables; edited by github.com/abhishekkr
#
# $FreeBSD$
#
# PROVIDE: routing
# REQUIRE: faith netif ppp stf
# KEYWORD: nojailvnet
@abhishekkr
abhishekkr / devstack_neutron_migration.patch
Last active January 4, 2016 06:18
[openstack] devstack setup with Neutron and Docker virtualization support
diff --git a/lib/neutron b/lib/neutron
index 465b57c..4a8863f 100644
--- a/lib/neutron
+++ b/lib/neutron
@@ -427,6 +427,10 @@ function init_neutron() {
# install_neutron() - Collect source and prepare
function install_neutron() {
git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH
+ _TMP_PWD=$PWD
+ cd $NEUTRON_DIR