Skip to content

Instantly share code, notes, and snippets.

View ShukujiNeel13's full-sized avatar
🙂

Indroneel Mukherjee ShukujiNeel13

🙂
View GitHub Profile
@ravikiranj
ravikiranj / postman-hmac-sha512-preq-request.js
Created April 27, 2017 18:05
HMAC SHA512 Authentication Pre-request script for Postman
/* Pre-requisite
==================
1) Create an Environment (if you don't already have on) and enable it for your request
2) Add a new Header with key as "Authorization" and value as "{{hmacAuthHeader}}"
3) Add the following Pre-request Script that computes the hmacAuthHeader variable and adds it to the environment
4) Fill your CLIENT_KEY and SECRET_KEY with valid values
*/
function getPath(url) {
var pathRegex = /.+?\:\/\/.+?(\/.+?)(?:#|\?|$)/;
@josegonzalez
josegonzalez / redis_migrate.py
Last active April 25, 2024 02:34 — forked from iserko/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
@jairamc
jairamc / set-aws-credentials.py
Last active December 21, 2021 02:45
Simple python script to set AWS Credentials in your environment variables
#! /usr/bin/env python
###############################################################
# In your .bashrc/.zshrc add `eval $(python <path to script>)`
# Or simply run `eval $(python <path to script>)`
# This avoids adding your aws credentials to bash/zsh history
###############################################################
import os, sys
from ConfigParser import ConfigParser
@JonCole
JonCole / Redis-DebuggingKeyspaceMisses.md
Last active February 22, 2024 09:49
Redis Debugging Tips

Debugging Redis Keyspace Misses

Simply put, a keyspace "MISS" means some piece of data you tried to retrieve from Redis was not there. This usually means that one of the following things happened:

  1. The key expired
  2. They key was renamed
  3. The key was deleted
  4. The key was evicted due to memory pressure
  5. The entire database was flushed
  6. The key was never actually inserted
@JonCole
JonCole / Redis-BestPractices-General.md
Last active April 27, 2024 12:50
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@reedobrien
reedobrien / create_dynamo_indexes.py
Created June 15, 2015 15:13
Create indexes on DynamoDB table with boto3
import boto3
from boto3.dynamodb.types import STRING
table = boto3.resource("dynamodb", region_name="us-east-1").Table("availdev-JobStateDB-1UIJ881212TPX")
## Attrs for GSI
attrdef = [
{"AttributeName": "state", "AttributeType": STRING},
{"AttributeName": "userId", "AttributeType": STRING},
{"AttributeName": "assetId", "AttributeType": STRING}
@JesseBuesking
JesseBuesking / logging.yaml
Created April 14, 2014 18:54
Testing MultiProcessingLog on both Windows 7 Enterprise and Ubuntu Developers Version 10.04_20121120.
---
version: 1
disable_existing_loggers: False
formatters:
simple:
format: "%(name)-20s%(levelname)-8s%(message)s"
handlers:
console:
class: logging.StreamHandler
level: DEBUG
@sloria
sloria / bobp-python.md
Last active May 1, 2024 08:37
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens