Skip to content

Instantly share code, notes, and snippets.

View sanketplus's full-sized avatar
:shipit:
Gotta ship 'em all!

Sanket Patel sanketplus

:shipit:
Gotta ship 'em all!
View GitHub Profile
@sanketplus
sanketplus / vaccine.py
Last active May 3, 2021 12:49
`pip install twilio`
import os
import datetime
import requests
import time
from twilio.rest import Client
account_sid = <SID>
auth_token = <AUTH>
PIN = <PINCODE>
#!/bin/bash
modprobe -r ec_sys
modprobe ec_sys write_support=1
on="\x8a"
off="\x0a"
led(){
echo -n -e $1 | dd of="/sys/kernel/debug/ec/ec0/io" bs=1 seek=12 count=1 conv=notrunc 2> /dev/null
ambari-server stop
ambari-agent stop
pkill -9 java
#################################
# Remove Packages
################################
yum -y remove ambari-\*
yum -y remove hcatalog\*
yum -y remove hive\*
@pmp
pmp / envelope_encryption_kms_boto_pycrypto.md
Last active November 17, 2021 16:35
Envelope Encryption using AWS KMS, Python Boto, and PyCrypto.

If you use Amazon AWS for nearly anything, then you are probably familiar with KMS, the Amazon Key Management Service.

KMS is a service which allows API-level access to cryptographic primitives without the expense and complexity of a full-fledged HSM or CloudHSM implementation. There are trade-offs in that the key material does reside on servers rather than tamper-proof devices, but these risks should be acceptable to a wide range of customers based on the care Amazon has put into the product. You should perform your own diligence on whether KMS is appropriate for your environment. If the security profile is not adequate, you should consider a stronger product such as CloudHSM or managing your own HSM solutions.

The goal here is to provide some introductory code on how to perform envelope encrypt a message using the AWS KMS API.

KMS allows you to encrypt messages of up to 4kb in size directly using the encrypt()/decrypt() API. To exceed these limitations, you must use a technique called "envelope encryptio

@magnetikonline
magnetikonline / README.md
Last active February 25, 2018 07:15
Transfer MySQL databases between AWS RDS instances.

Transfer MySQL databases between AWS RDS instances

The situation

  • Two AWS RDS MySQL databases - moving databases from source to destination.
  • Both databases are not publicly accessible, only via an EC2 instance(s) - e.g. you have setup your security groups.
  • Can SSH to a target EC2 instance (but of course).

What it does

  • Sets up two SSH port forwards on local machine - one to source database, another to target.
  • Via calls to transferDatabase():
@17twenty
17twenty / Makefile
Created August 22, 2013 22:24
Simple Misc Driver Example
# Simple Makefile to build a simple misc driver
# Nick Glynn <Nick.Glynn@feabhas.com>
#
obj-m += misc_example.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
CC := $(CROSS_COMPILE)gcc