Skip to content

Instantly share code, notes, and snippets.

@pandeybk
pandeybk / Change UID of user
Created January 18, 2016 21:59
Change UID of user
usermod -u NEW_UID your_username
@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 / 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 / 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 / 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 / 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 / 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