Skip to content

Instantly share code, notes, and snippets.

View bortels's full-sized avatar

Tom Bortels bortels

  • Simi Valley, CA, USA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bortels on github.
  • I am tbortels (https://keybase.io/tbortels) on keybase.
  • I have a public key ASAUnHiD-G0g6ue8r_9avYDaMu6idftEYxq08_XH5gWl-wo

To claim this, I am signing this object:

@bortels
bortels / Base64.lua
Created December 6, 2011 05:56
Base64 encode/decode for Codea (Lua)
-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <alexthkloss@web.de>
-- licensed under the terms of the LGPL2
-- character table string
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-- encoding
function enc(data)
return ((data:gsub('.', function(x)
local r,b='',x:byte()
#!/usr/bin/env python3
"""Update pod inventory pages"""
import requests
from requests.auth import HTTPBasicAuth
import json
from pprint import pprint
import datetime
import gzip
@bortels
bortels / mvc
Created October 2, 2012 17:02
minecraft control script using screen
#! /bin/sh
### BEGIN INIT INFO
# Provides: minecraft_server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Minecraft Server control script.
# Description: Minecraft Server control script.
# Options
@bortels
bortels / decodea.pl
Created December 2, 2011 07:57
Decode a .codea rtfd file
#!/usr/bin/perl
# Tom's nasty and ugly .codea (rtfd) decoder
# I release this bad boy to the public domain, you can't stop me!
$debug=1;
$f = shift @ARGV || "Font.codea";
open ($fh, $f);
@bortels
bortels / gist:1f047f3e7877d5566988492d69171f30
Created May 20, 2019 17:50
Session policies explained
Create fine-grained session permissions using AWS Identity and Access Management (IAM) managed policies -
I've read this three times and I still don't understand what it does. Help?
Sure, I'd be happy to help you with that.
You use AWS STS (Simple Token Service) to assume a role and it's associated policies. So - you might call STS to assume
a role with "AdministratorAccess" policy in another account.
When you do this, you have an option to also add a "session role" on the fly - think of it as an addendum to the role.
Example, you might assume that "AdministratorAccess" role, but add in "No IAM access, please". This is handy because it
@bortels
bortels / dkjson
Created March 25, 2012 22:40
json encode/decode in lua
--[==[
David Kolf's JSON module for Lua 5.1/5.2
========================================
*Version 2.1*
This module writes no global values, not even the module table.
Import it using
#!/usr/bin/env python3
# export the AWS environment for a given profile
import boto3
import argparse
parser = argparse.ArgumentParser(prog="exportaws",
description="Extract AWS credentials for a profile as env variables.")
parser.add_argument("profile", help="profile name in ~/.aws/config.")
-- Use this function to perform your initial setup
function setup()
fontinfo={}
fontinfo["#"] = { points=11, width=21, ascii=35,
data={ 11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6 } }
end
-- This function gets called once every frame
function draw()
@bortels
bortels / addip.pl
Created January 27, 2014 20:55
Add Host Record (A and PTR) to infoblox via WAPI
#!/usr/bin/perl
# Add an IP to infoblox
# Note a valid login is required. You can use your own for testing, but for
# long term use, please request a svc_ service account for your script.
use LWP::UserAgent;
use JSON;
# We expect a fully-qualified DNS name and IP on the command line