Skip to content

Instantly share code, notes, and snippets.

@caiusb
caiusb / aws-utils.sh
Last active May 5, 2023 05:42
AWS Utils
# used in ~/.profile to make life easier when working with AWS services
# To assume a role run `assume <role-arn> <ext-id>`. The <ext-id> is optional and will default to `$USER`.
# To un-assume, run `unassume`.
# Role can be assumed sequentially, and credentials are "stacked". `unassume` will move you down that stack.
alias awswho='aws sts get-caller-identity'
alias assume='assume-role'
alias unassume='unassume-role'
@caiusb
caiusb / game.js
Created October 8, 2018 11:55
Front-end fix.
var isSetup = true;
var placedShips = 0;
var game;
var shipType;
var vertical;
function makeGrid(table, isPlayer) {
for (i=0; i<10; i++) {
let row = document.createElement('tr');
for (j=0; j<10; j++) {
@caiusb
caiusb / keybase.md
Created October 9, 2016 19:07
keybase.md

Keybase proof

I hereby claim:

  • I am caiusb on github.
  • I am caiusb (https://keybase.io/caiusb) on keybase.
  • I have a public key whose fingerprint is BEE8 3841 166F 4FF0 9FC9 8B87 1CC3 946F BC77 9040

To claim this, I am signing this object:

@caiusb
caiusb / delete-archives.py
Last active January 27, 2016 01:36
Deleting all archives from a Glacier vault
#!/opt/local/bin/python
# This gist assumes that the AWS CLI client has been installed
# and configured. To configure, run `aws configure`.
import boto3
import json
#TODO: Fill these in to match your case
vaultName = ""
@caiusb
caiusb / gist:24f693de84f76df58dcc
Created June 30, 2015 05:44
Excel hyperlink trick
=HYPERLINK(CONCATENATE("http://server.brindescu.com/mergeviz/data/",AF2,"/",A2,"/",B2),"View")
package bla;
import java.util.ArrayList;
import java.util.List;
class Coordinates {
private char x;
private int y;
public Coordinates(char x, int y) {
@caiusb
caiusb / mails_from_git
Last active December 10, 2015 13:08
Get a list of mails from a git repo
git log --format="%aE" | sort | uniq | grep -E '[A-Za-z0-9._-]+@[A-Za-z0-9._-]+.[A-Za-z]+'