Skip to content

Instantly share code, notes, and snippets.

View cnelson's full-sized avatar

Chris Nelson cnelson

View GitHub Profile
@cnelson
cnelson / bif.go
Created January 28, 2023 01:10
Golang packer / unpacker for the Roku BIF format
package main
import (
"encoding/binary"
"fmt"
"io"
"io/fs"
"os"
"path/filepath"
"strings"
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "USAGE: $0 <APP_NAME> <PORT>"
echo "Replicate the behaivor of cf ssh on a port not advertised by /v2/info"
echo "https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html#other-ssh-access"
exit 99
fi
set -eu
#!/usr/bin/env python3
import datetime
import json
import os
import subprocess
import yaml
import marshmallow as ma
import requests
package main
import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"os/exec"
#!/usr/bin/env python3
import re
import requests
import subprocess
import yaml
buildpacks = {}
bpack_info = subprocess.check_output(['cf', 'buildpacks'])
for item in bpack_info.decode('utf-8').split("\n"):
#!/usr/bin/env python
import re
import subprocess
import yaml
import datetime
since=datetime.datetime(2017, 2, 28, 0, 0, 0)
#!/usr/bin/env python
import json
import sys
import subprocess
# To use this script: `uaac` and `cf` must be in your PATH
#
# Use `uaac target` and `uaac token client get` to ensure uaac can perform operations
#
@cnelson
cnelson / manifest-check.py
Created November 25, 2016 18:38
Sanity check riemann settings
#!/usr/bin/env python
import glob
import yaml
import argparse
# extract all manifests to a directory with:
# for d in `bosh deployments |grep trusty | cut -d" " -f2`; do bosh download manifest $d > $d.yml; done
# then run this script in that directory
@cnelson
cnelson / Dockerfile
Created May 29, 2016 18:36
Android SDK container
FROM ubuntu:16.04
RUN apt-get update -qq
# Dependencies to execute android
RUN apt-get install -y --no-install-recommends openjdk-8-jdk wget git ant
# Main Android SDK
RUN cd /opt && wget -q https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz && tar xzf *.tgz && rm -f *.tgz
@cnelson
cnelson / demo.sh
Created May 15, 2016 02:35
CloudFormation vs Terraform
#!/bin/bash
# make sure we have what we need
if [ -z "$AWS_ACCESS_KEY_ID" ] || \
[ -z "$AWS_SECRET_ACCESS_KEY" ] || \
[ -z "$AWS_DEFAULT_REGION" ] || \
[ -z "$(which aws)" ] || \
[ -z "$(which terraform)" ]
then