Skip to content

Instantly share code, notes, and snippets.

@dehli
dehli / .gitignore
Last active November 14, 2020 22:38
.cpcache/
.shadow-cljs/
dev/
node_modules/
test/
@dehli
dehli / aws_aliases
Created October 10, 2019 14:51
AWS Aliases
alias cfversion="curl -s https://d1uauaxba7bl26.cloudfront.net/latest/CloudFormationResourceSpecification.json | jq '.ResourceSpecificationVersion' -r"
@dehli
dehli / clear_cognito_pool
Last active October 2, 2019 19:57
clear_cognito_pool
#!/usr/bin/env node
const { USER_POOL_ID } = process.env;
if (!USER_POOL_ID) throw new Error("Missing USER_POOL_ID");
const AWS = require("aws-sdk");
const cognito = new AWS.CognitoIdentityServiceProvider();
const attribute => ({ Attributes }, name) =>
Attributes.filter(a => a.Name === name)[0].Value;
@dehli
dehli / clean_log_groups.sh
Created September 9, 2019 18:11
clean_log_groups.sh
#!/usr/bin/env bash
echo "Which log groups would you like to remove?"
read LOG_GROUP
echo
LOG_GROUPS=$(aws logs describe-log-groups --query "logGroups[*].logGroupName" --output text)
LOG_GROUPS=($LOG_GROUPS)
for i in "${LOG_GROUPS[@]}"
{
"Working Directory" : "\/Users\/dehli",
"Prompt Before Closing 2" : 2,
"Selected Text Color" : {
"Green Component" : 0,
"Blue Component" : 0,
"Red Component" : 0
},
"Rows" : 25,
"Ansi 11 Color" : {
@dehli
dehli / backup.md
Last active November 28, 2017 15:46
S3 Backup
  1. Turn on versioning for the source bucket.
  2. Turn on cross-region replication and point it to a newly created backup.
  3. Copy existing s3 contents using the following command:
aws s3 sync s3://source s3://source-backup

Keybase proof

I hereby claim:

  • I am dehli on github.
  • I am dehli (https://keybase.io/dehli) on keybase.
  • I have a public key ASB3qt6zc3I_vDZ_M9w52M5hcaS3UD1ZBosKlITaiPJNGQo

To claim this, I am signing this object:

@dehli
dehli / setup.sh
Last active October 4, 2017 14:01
#!/bin/bash
# Check if xcode command line tools are installed
if ! [ "$(xcode-select -p)" ]; then
xcode-select --install
exit 1
fi
# Install brew
if ! [ -x "$(command -v brew)" ]; then
@dehli
dehli / .bashrc
Last active April 12, 2017 01:03
My Ubuntu .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@dehli
dehli / profiles.clj
Created February 5, 2017 16:13
Located in ~/.lein
{:user {:plugins [[cider/cider-nrepl "0.13.0"]]
:dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}