Skip to content

Instantly share code, notes, and snippets.

@iamsaso
iamsaso / gist:143692180c2a313eb5777a6152222445
Created October 8, 2018 17:45
Kubernetes delete evicted pods
kubectl get po -a --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete po \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c
@iamsaso
iamsaso / post-commit
Last active December 29, 2017 07:29
.git/hooks/post-commit
#!/usr/bin/env bash
branch_name=`git symbolic-ref --short HEAD`
retcode=$?
non_push_suffix="_local"
# Only push if branch_name was found (my be empty if in detached head state)
if [ $retcode = 0 ] ; then
#Only push if branch_name does not end with the non-push suffix
@iamsaso
iamsaso / index.html
Last active September 21, 2022 11:04
GraphiQL with JWT
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 100%;
margin: 0;
width: 100%;
overflow: hidden;
}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DelegateS3AccessForMigration",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::000000000000:root"
},
"Action": "s3:*",
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::saso-test-1/*",
➜ s3-sync git:(master) go run main.go sync --config config.prod.yaml
Using config file: config.prod.yaml
2017/05/30 15:20:05 Creating user(saso) policy
2017/05/30 15:20:06 Creating bucket(saso-test) policy
2017/05/30 15:20:07 Creating bucket(us-east-1-checkr-saso-test)
2017/05/30 15:20:08 Enabling bucket(us-east-1-checkr-saso-test) versioning
2017/05/30 15:20:09 Running bucket(saso-test) => bucket(us-east-1-checkr-saso-test) sync
copy: s3://saso-test/projects.csv to s3://us-east-1-checkr-saso-test/projects.csv
@iamsaso
iamsaso / s3-migration-sheet
Last active June 2, 2017 01:31
s3-migration-sheet
+------------------+----------+----------------------------+------------+---------------------+
| CURRENT NAME | SYNC | NEW NAME | PROJECT 1 | PROJECT 2 |
+------------------+----------+----------------------------+------------+---------------------+
| checkr-documents | YES | us-east-1-checkr-documents | checkr-api | checkr-microservice |
| checkr-test | NO | | | |
| checkr-unknown | ??? | | | |
+------------------+----------+----------------------------+------------+---------------------+
@iamsaso
iamsaso / .tmux.reset.conf
Created September 8, 2016 20:52 — forked from KushalP/.tmux.reset.conf
If someone's added their own tmux config in /etc/tmux.conf this will reset all key bindings to the default for tmux
# First remove *all* keybindings
unbind-key -a
# Now reinsert all the regular tmux keys
bind-key C-b send-prefix
bind-key C-o rotate-window
bind-key C-z suspend-client
bind-key Space next-layout
bind-key ! break-pane
bind-key \" split-window
# bash <(curl -s https://gist.githubusercontent.com/sasso/a240f9135e5c77ad460a5f2fd2c993be/raw/server-bootstrap.sh?$(date +"%T"))
# packages
sudo apt-get update
sudo apt-get install vim tmux telnet
# tmux
curl -s -o ~/.tmux.conf https://gist.githubusercontent.com/sasso/2750b5e3e8526651cdefda9d3f19fa77/raw/.tmux.conf
# bash
#unbind-key -a
set -g default-terminal "screen-256color"
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -