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 / find_iam_users_and_groups.py
Last active August 9, 2021 19:40
Find all IAM Users and assigned groups boto3
import boto3
iam = boto3.client('iam')
def find_user_and_groups():
for userlist in iam.list_users()['Users']:
userGroups = iam.list_groups_for_user(UserName=userlist['UserName'])
print("Username: " + userlist['UserName'])
print("Assigned groups: ")
for groupName in userGroups['Groups']:
@pandeybk
pandeybk / find_user_list_and_last_access_key_used_date.py
Created January 4, 2016 19:29
Find user key and last access key used date
import boto3
iam = boto3.client('iam')
def find_user_list_and_last_access_key_used_date():
for userlist in iam.list_users()['Users']:
print("Username: " + userlist['UserName'])
for accessKey in iam.list_access_keys(UserName=userlist['UserName'])['AccessKeyMetadata']:
print(accessKey['AccessKeyId'])
@pandeybk
pandeybk / jenkins-nginx.conf
Last active October 15, 2020 13:40
Jenkins behind nginx reverse proxy with https
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name build.domain.tld;
@pandeybk
pandeybk / Change UID of user
Created January 18, 2016 21:59
Change UID of user
usermod -u NEW_UID your_username
@pandeybk
pandeybk / aws_security_group_alert.py
Last active December 5, 2017 11:49
Lambda function, trigger email using SES and alert publicly open security group
import boto3
ec2 = boto3.client('ec2')
ses = boto3.client('ses')
def email_service(email_title, email_body):
fromaddr = 'sesverified@email.address'
toaddr = 'email@addresses.com'
bcc = 'email@addresses.com'
@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