Skip to content

Instantly share code, notes, and snippets.

View pranavcode's full-sized avatar

Pranav Kulkarni pranavcode

View GitHub Profile
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@pranavcode
pranavcode / de.yml
Created July 17, 2016 19:47 — forked from smtm/de.yml
Parsing YAML in Rails i18n locale files to generate JSON for a javascript translation method
These are the code parts to grab related to this blog post.
Read more about it there
http://www.igumbi.com/en/blog/YAML-to-JSON-Rails-for-i18n-Language-Files
# The locale file structure de.yml
de:
obt:
@pranavcode
pranavcode / gzip_s3_and_json_py3.py
Created September 5, 2020 22:00 — forked from a-hisame/gzip_s3_and_json_py3.py
To use gzip file between python application and S3 directly for Python3
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''To use gzip file between python application and S3 directly for Python3.
Python 2 version - https://gist.github.com/a-hisame/f90815f4fae695ad3f16cb48a81ec06e
'''
import io
import gzip
import json
#!/bin/bash
# Specify the desired volume size in GiB as a command-line argument. If not specified, default to 20 GiB.
SIZE=${1:-20}
# Get the ID of the environment host Amazon EC2 instance.
INSTANCEID=$(curl http://169.254.169.254/latest/meta-data//instance-id)
# Get the ID of the Amazon EBS volume associated with the instance.
VOLUMEID=$(aws ec2 describe-instances \