Skip to content

Instantly share code, notes, and snippets.

@pandeybk
pandeybk / build.sh
Last active August 29, 2015 14:14 — forked from jonah-williams/build.sh
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
@pandeybk
pandeybk / move_to_rds.rb
Last active September 8, 2015 13:50 — forked from guenter/move_to_rds.rb
A quick and dirty script to move a database into Amazon RDS (or any other database). Can transfer part of the data beforehand.
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'
@pandeybk
pandeybk / README.md
Created November 4, 2015 10:05 — forked from lusis/README.md
A sample recipe to install my erlang tarballs with the maximum amount of idempotence

Notes

While I call s3_file and use my databag_decrypt helpers, you can point to the downloads in my github repo here: https://github.com/lusis/erlang-and-centos/

The sha256 is in the filename so the checksum operator should work.

This is about as idempotent as I can get the cookbook. I've tested multiple scenarios:

  • missing symlink
  • missing installed product
  • from scratch with neither symlink or installed product
@pandeybk
pandeybk / password.py
Created April 5, 2016 20:26 — forked from henkjanverkerk/password.py
Simple password generator
import random
def main():
length = int(raw_input('How long should your password be?\n'))
print("Here's the password I generated: " + "".join(random.sample('QWERTYUIOPASDFGHJKLZXCVBNM1234567890abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()_+', length)))
main()
import ansible.module_utils.one
import kitchen.text, ansible.module_utils.two, docutils, ansible.module_utils.three, distutils.sysconfig
import ansible.module_utils.four.parse
from ansible.module_utils.five import *
from ansible.module_utils.six import parse
from ansible.module_utils import seven
from ansible.module_utils import eight, nine
from ansible.module_utils.ten.foo import parse
b = 1 ; import ansible.module_utils.eleven
@pandeybk
pandeybk / get_links.js
Last active April 5, 2016 20:46
get all links and post to console
@pandeybk
pandeybk / hello-revinate.pl
Last active April 5, 2016 21:24
Hello Revinate
use re 'eval';
'?'
=~( '('
.'?'. '{'.
('`'| '%').
('[' ^'-'
).''. ('`'|
'!') .''.
('`'| ',').
(( '"')) . ( ('[')^
@pandeybk
pandeybk / SimpleAuthServer.py
Created July 28, 2016 18:40 — forked from fxsjy/SimpleAuthServer.py
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
@pandeybk
pandeybk / countries.sql
Created July 30, 2016 02:51 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@pandeybk
pandeybk / clean-docker-for-mac.sh
Created November 30, 2016 18:20 — forked from MrTrustor/clean-docker-for-mac.sh
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
IMAGES=$@
echo "This will remove all your current containers and images except for:"
echo ${IMAGES}
read -p "Are you sure? [yes/NO] " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then