Skip to content

Instantly share code, notes, and snippets.

View jorke's full-sized avatar
💭
is typing..

Jorke Odolphi jorke

💭
is typing..
View GitHub Profile
@jorke
jorke / ses.ps1
Created October 8, 2013 03:53
Send email via AWS SES using powershell one liner.
Send-MailMessage -From <from> -to <to> -subject <subject> -SmtpServer email-smtp.us-east-1.amazonaws.com -Credential
$(New-Object System.Management.Automation.PSCredential -argumentlist <AWS_ACCESS_KEY>,
$(ConvertTo-SecureString -AsPlainText -String <AWS_SECRET_KEY> -Force)
)
-UseSsl -Port 587
@jorke
jorke / thecleaner.sh
Created November 4, 2015 06:22
delete ec2 resources
#!/bin/bash
for s in $(aws ec2 describe-snapshots --owner-id self --output text | egrep SNAPSHOTS | cut -f6 -d$'\t'); do aws ec2 delete-snapshot --snapshot-id $s; done;
for i in $(aws ec2 describe-images --owners self --output text | egrep IMAGES | cut -f6 -d$'\t'); do aws ec2 deregister-image --image-id $i; done;
#! /bin/sh
# /etc/init.d/foobar
# The following part always gets executed.
echo "This part always gets executed"
# The following part carries out specific functions depending on arguments.
case "$1" in
start)
echo "Starting foobar"
@jorke
jorke / gfclean.sh
Created October 20, 2016 14:00
cleans up merged remote branches
git push origin $(git branch -r --merged origin/master | sed "s/origin\\//:/" | egrep -v "HEAD|master|dev")
@jorke
jorke / gitbashprompt-bashrc.sh
Created October 20, 2016 19:56
bash prompt
function confirm () {
# call with a prompt string or use a default
read -r -p "${1:-Are you sure? [y/N]} " response
case $response in
[yY][eE][sS]|[yY])
true
;;
*)
false
;;
#cloud-config
apt_update: true
apt_upgrade: false
apt_preserve_sources_list: true
packages:
- openjdk-7-jre-headless
- awscli
- git
@jorke
jorke / rpi-install-chef
Last active March 25, 2017 11:13
installs ruby then pulls chef
apt-get install gcc make libssl-dev
cd /usr/src
wget https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.6.tar.gz
tar -xvzf ruby-2.2.6.tar.gz
cd ruby-2.2.6
@jorke
jorke / iamreset.sh
Created February 15, 2019 00:25
force iam user to reset password
for x in $(aws iam list-users --output text --query 'Users[*].UserName');
do
echo "$x?"
read choice
case "$choice" in
y|Y ) echo $(aws iam update-login-profile --user-name $x --password-reset-required);;
n|N ) echo "no";;
* ) echo "invalid";;
esac
;
@jorke
jorke / acm_dns.tf
Created October 11, 2019 04:40
create acm cert with DNS validation
terraform {
required_version = ">= 0.12"
}
# default region required.
provider "aws" {
region = "us-east-1"
}
provider "aws" {
@jorke
jorke / notebook.ipynb
Last active May 3, 2021 03:54
rekognition-testing.ipnyb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.