Skip to content

Instantly share code, notes, and snippets.

View sandeepkunkunuru's full-sized avatar

Sandeep Kunkunuru sandeepkunkunuru

View GitHub Profile
@nikhilw
nikhilw / createJenkinsContainer.sh
Last active October 15, 2018 18:38
docker Jenkins reusable container
#! /bin/bash
# When running for first time, have empty directories; skip the setup by unchecking all plugins, etc.
# then shutdown jenkins, add old files and restart.
# If it fails, make sure the directory docker-volumes/jenkins and all its children are owned by same user, owner of the docker process.
# Or just chown -R on the jenkins directory.
docker run -it --name jenkins --network="permanet" --ip="172.30.0.6" \
-v /home/nikhil/.m2:/var/jenkins_home/.m2 \
-v /home/nikhil/.gradle:/var/jenkins_home/.gradle \
-v /home/nikhil/.npm:/var/jenkins_home/.npm \
@singledigit
singledigit / cognito.yaml
Last active December 11, 2024 10:03
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@drorm
drorm / schemaspy.cfg
Last active July 10, 2024 21:53
schemaspy for redshift
# type of database. Run with -dbhelp for details
schemaspy.t=redshift
# optional path to alternative jdbc drivers.
schemaspy.dp=./RedshiftJDBC42-1.2.7.1003.jar
# database properties: host, port number, name user, password
schemaspy.host=xxxxx.yyyy.eu-west-1.redshift.amazonaws.com
schemaspy.port=5439
schemaspy.db=test
schemaspy.u=test
schemaspy.p=***************
@federicofazzeri
federicofazzeri / .babelrc
Last active February 7, 2022 14:45
Node Express-based REST API (CRUD) using Firebase cloud Functions and FireStore cloud database + Babel config (The current Node version running in Cloud Functions is 6.10)
{
"presets": [
["env", {
"targets": {
"node": "6.10"
}
}]
]
}
@evanderkoogh
evanderkoogh / example.csv
Created November 20, 2017 13:29
Import CSV into DynamoDB
whateverId attribute1 someotherattribute
foo bar baz
hello erwin world
@headius
headius / meltdown_in_a_nutshell.md
Last active July 27, 2018 13:43
How Meltdown Works

Algorithm

  1. A secret byte you want to read is stored at inaccessible memory location priv_mem.
  2. The sender triggers an access exception by attempting to read priv_mem.
  3. Due to CPU optimization (out-of-order execution), the load of secret from priv_mem and the use of its value in (4) and (5) below may execute before the exception is triggered.
  4. Calculate an offset into a known array probe by multiplying secret by the width of a cache line (or whatever block size the CPU typically fetches, like a 4096-byte page). This guarantees each of those 256 possible offsets will cache separately.
  5. Load probe[offset], which causes the CPU to cache exactly one chunk of of our array, populating one cache line.
  6. The exception finally triggers, clearing the modified registers...but cached data is not excised.
  7. Iterate over all 256 offsets into probe to find out which one loads fast. You've determined the value of secret.
hbase(main):017:0> scan 'personalnew',{VERSIONS=>4}
ROW COLUMN+CELL
1 column=personal_data:age, timestamp=1518070847422, value=25
1 column=personal_data:age, timestamp=1517381138957, value=25
1 column=personal_data:city, timestamp=1518070871233, value=USA
1 column=personal_data:city, timestamp=1517381134473, value=Bengaluru
1 column=personal_data:name, timestamp=1518070904715, value=Ram
1 column=personal_data:name, timestamp=1517381128393, value=Ram
1 row(s) in 0.0110 seconds
@adrianhall
adrianhall / AppSyncAPI.yaml
Last active September 25, 2024 01:43
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
---
Description: AWS AppSync Notes API
Parameters:
APIName:
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
# Unzip
unzip protoc-3.5.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@paulmelnikow
paulmelnikow / excel_to_json.py
Last active June 1, 2022 07:25
Convert Excel to JSON using pandas
#!/usr/bin/env python3
'''
MIT License
Copyright (c) 2018 Paul Melnikow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell