Skip to content

Instantly share code, notes, and snippets.

View alchen99's full-sized avatar

Alice Chen alchen99

View GitHub Profile
@alchen99
alchen99 / debugAwsLambda.txt
Last active October 13, 2018 00:38
Debugging AWS Lambda Python scripts
import json
logger.info('Event: %s' % json.dumps(event, indent=2))
See https://gist.github.com/gene1wood/24e431859c7590c8c834
time aws lambda invoke --invocation-type RequestResponse --function-name reportUntaggedInstances --region us-west-2 --log-type Tail --payload '{"region": "us-west-2"}' lambda.log
awslogs groups
awslogs get /aws/lambda/reportUntaggedInstances --no-group --no-stream -s '15 min ago'
@alchen99
alchen99 / aws-hourly-instance-cost.txt
Last active February 8, 2017 06:58
Easily parseable list of the cost/hr of each type of AWS instance
t1.micro=0.020
t2.nano=0.0059
t2.micro=0.012
t2.small=0.023
t2.medium=0.047
t2.large=0.094
t2.xlarge=0.188
t2.2xlarge=0.376
m1.small=0.044
m1.medium=0.087
"{\"Add\":[{\"UserId\":\"ACCOUNTNUMBER\"}]}"
@alchen99
alchen99 / awsAddLaunchPermission.json
Last active February 16, 2018 05:36
JSON to grant another AWS account Launch Permissions
{"Add":[{"UserId":"ACCOUNTNUMBER"}]}

Keybase proof

I hereby claim:

  • I am alchen99 on github.
  • I am alchen99 (https://keybase.io/alchen99) on keybase.
  • I have a public key ASD8OU5MTvF7eFV9cIT5-moxprq3A008_9aSxPTDd93bLwo

To claim this, I am signing this object:

@alchen99
alchen99 / .screenrc
Created July 28, 2020 00:17
Screen rc file
shell -${SHELL}
# kill startup message
startup_message off
# define bigger scrollback, default is 100 lines
defscrollback 10000
# Prefer an audible bell to the visual one
vbell off
@alchen99
alchen99 / .tmux.conf
Last active July 16, 2021 18:13
Tmux configuration
# make CTRL+a the 'prefix' ala screen.
bind C-a send-prefix
set -g prefix C-a
# get rid of the tmux standard of CTRL+b
unbind C-b
set -s escape-time 1
set -g base-index 1
setw -g pane-base-index 1
set -g history-limit 50000
@alchen99
alchen99 / .vimrc
Last active December 20, 2023 23:08
VIM conf
set nocompatible
set autoindent
set showcmd
set shiftwidth=4
set softtabstop=4
set tabstop=4
set expandtab
set showmatch
set nohlsearch
set expandtab
@alchen99
alchen99 / .bashrc-ext
Last active December 20, 2023 23:00
Bashrc extended config
# additional setup for remote VM
set -o vi
alias screendr='/usr/bin/screen -DR'
alias tmuxdr='/usr/bin/tmux attach-session -d'
# Terminal colors
export COLOR_NC='\e[0m' # No Color
export COLOR_BLACK='\e[0;30m'
export COLOR_GRAY='\e[1;30m'
export COLOR_RED='\e[0;31m'
@alchen99
alchen99 / .bashrc-append
Created July 28, 2020 01:00
Append to .bashrc
# enable custom bash stuff
if [ -f ~/.bashrc-ext ]; then
source ~/.bashrc-ext
fi