Skip to content

Instantly share code, notes, and snippets.

View linux-oneliners
sha256 of all running executables
for f in `ps -eo comm` ; do shasum5.28 -a 256 "$f" ; done
View encrypt string with openssl to send via email or chat
openssl genrsa -out key.pem
openssl rsa -in key.pem -pubout -out key.pub
Now you'll have pub + private keys
You can send the pub key to supplying user, who can then encrypt with it, and you can decrypt
To encrypt:
echo "xxxxxxxx" | openssl rsautl -encrypt -inkey ./key.pub -pubin | base64
View aws-web-console-service-menu-customize.js
// ==UserScript==
// @name Whitelist AWS Console Service list
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Show only selected services in the AWS Web Console Services menu
// @author rdkls
// @match https://*console.aws.amazon.com/*
// @match https://*.console.aws.amazon.com/*
// @grant none
// ==/UserScript==
View get-all-rds-instances.py
#!/usr/bin/env python3
import argparse
import boto3
import botocore
import sys
import csv
from itertools import repeat as r
import concurrent.futures
View slim_python_lambda_build.sh
#!/bin/bash
#
# Compiles a Python package into a zip deployable on AWS Lambda
#
# - Builds Python dependencies into the package, using a Docker image to correctly build native extensions
# - Strip shared object files for smaller size ca. 20% reduction
# - Remove .py and use .pyc's = faster lambda and ca. 20% reduction
# - Remove tests, info (minor reduction, but why not)
# - Remove packages that will be available in AWS lambda env anyway (boto et al) ca. 50mb (uncompressed) reduction
# - Able to be used with the terraform-aws-lambda module
View aws-ssm-ec2-proxy-command.sh
#!/usr/bin/env bash
#
# Description
# Bootstrap SSH Session to an SSM-managed instance
# by temporarily adding a public SSH key available on the local machine (ssh-agent or in ~/.ssh)
#
#
# Installation
#
# First run your eye over this script to check for malicious code
View gist:e071f8ff7810fb2be5a94ef33ba8a492
HTTP -> HTTPS
socat -v TCP4-LISTEN:443,reuseaddr,fork OPENSSL-CONNECT:20.190.142.66:443,verify=0
View aws_extend_switch_roles_config_generator.py
#!/usr/bin/env python
# Generate config file for chrome extension "aws-extend-switch-roles"
# https://github.com/tilfin/aws-extend-switch-roles
import boto3
import argparse
import hashlib
from pprint import pprint
parser = argparse.ArgumentParser()
View jessfraz-vim.sh
(cd ~/; git clone --recursive https://github.com/jessfraz/.vim.git .vim; ln -sf $HOME/.vim/vimrc $HOME/.vimrc; cd $HOME/.vim; git submodule update --init)
You can’t perform that action at this time.