Skip to content

Instantly share code, notes, and snippets.

View b1zantine's full-sized avatar
🌏
Stuck on a giant wet rock

Sudar S b1zantine

🌏
Stuck on a giant wet rock
View GitHub Profile
@b1zantine
b1zantine / apigw-iam-sign-role-ec2.py
Created March 22, 2018 05:17
Signing AWS API requests using temp credentials obtained using the role attached to an EC2 instance
import sys, os, base64, datetime, hashlib, hmac, json
import requests # pip install requests
# ************* REQUEST VALUES *************
method = 'GET'
service = 'execute-api'
host = 'api.example.com
region = 'us-east-1'
endpoint = 'https://api.example.com/user/hello'
request_parameters = ''
@b1zantine
b1zantine / base.yml
Last active March 21, 2018 12:30
Combining multiple Swagger+APIGW using jq
---
swagger: 2.0
basePath: /prod
info:
title: AwsSamExample
bschemes:
- https
paths:
/:
x-amazon-apigateway-any-method:
@b1zantine
b1zantine / schedule-lambda-asl.json
Created February 25, 2018 06:06
Amazon State Language (ASL) for created a state machine to schedule a one-time invocation of a Lambda function.
{
"Comment": "Invoking Lambda at arbitrary time.",
"StartAt": "CountDownTimer",
"States": {
"CountDownTimer": {
"Type": "Wait",
"TimestampPath": "$.invocationTime",
"Next": "InvokeLambda"
},
"InvokeLambda": {
0x7d53C149154Ffb8D9b3825EaA566E977C434D061
@b1zantine
b1zantine / CustomGenesis.json
Created July 8, 2017 09:01
Custom Genesis file to initialize ethereum using geth init
{
"config": {
"chainId": 13,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"difficulty": "200000000",
"gasLimit": "2100000",
"alloc": {
@b1zantine
b1zantine / 51-android.rules
Created January 27, 2016 09:07
udev rules for android device
# udev rule to detect android devices
# These rules refer to http://developer.android.com/tools/device.html
# Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev"
# Archos
SUBSYSTEM=="usb", ATTR{idVendor}=="0e79", MODE="0666", GROUP="plugdev"
# Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev"
# Azpen Onda
@b1zantine
b1zantine / px
Last active March 10, 2022 07:11
Shell Script to set proxy in Ubuntu
#!/bin/sh
_DOMAIN="proxy.ssn.net"
_PORT=8080
_IGNORE_PROXY="'*.ssn.net'"
_ENV_FILE_PATH="/etc/environment"
_APT_FILE_PATH="/etc/apt/apt.conf"
_MODE_MANUAL="manual"
_MODE_NONE="none"