Skip to content

Instantly share code, notes, and snippets.

View jeefy's full-sized avatar
😏
#honkernetes

Jeffrey Sica jeefy

😏
#honkernetes
View GitHub Profile
@jeefy
jeefy / kubernetes_add_service_account_kubeconfig.sh
Last active April 13, 2020 23:12 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@jeefy
jeefy / honkctl-jan
Last active January 18, 2020 14:18
!honkctl does what you think
disabled: avada, cat, ls
enabled: ungoose
full on oprah, everyone gets a cluster. first command spins it up. takes ~3min. if that's too long for you, bother bentheelder.
there is a challenge. that's all we'll say.
points are not awarded for breaking your cluster. if you break it, ungoose it.
-----BEGIN CERTIFICATE-----
MIIHGjCCBgKgAwIBAgIQEAhc1aJA93W3qr8cXSRiyzANBgkqhkiG9w0BAQsFADB2
MQswCQYDVQQGEwJVUzELMAkGA1UECBMCTUkxEjAQBgNVBAcTCUFubiBBcmJvcjES
MBAGA1UEChMJSW50ZXJuZXQyMREwDwYDVQQLEwhJbkNvbW1vbjEfMB0GA1UEAxMW
SW5Db21tb24gUlNBIFNlcnZlciBDQTAeFw0xOTA1MzAwMDAwMDBaFw0yMTA1Mjky
MzU5NTlaMIHIMQswCQYDVQQGEwJVUzEOMAwGA1UEERMFNDgxMDkxCzAJBgNVBAgT
Ak1JMRIwEAYDVQQHEwlBbm4gQXJib3IxGTAXBgNVBAkTEDUzMCBTLiBTdGF0ZSBT
dC4xHzAdBgNVBAoTFlVuaXZlcnNpdHkgb2YgTWljaGlnYW4xKDAmBgNVBAsTH0lu
Zm9ybWF0aW9uIFRlY2hub2xvZ3kgU2VydmljZXMxIjAgBgNVBAMTGXJlZ2lzdHJ5
LmFyYy10cy51bWljaC5lZHUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
@jeefy
jeefy / Vagrantfile
Last active July 4, 2018 00:38
Vagrantfile for Kubernetes development / testing
$script = <<-SCRIPT
export DEBIAN_FRONTEND=noninteractive
export HOME=/root
apt-get update && apt-get install -y apt-transport-https
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-get install -y docker-ce gcc make build-essential tzdata
{
"ignition": {
"config": {},
"security": {
"tls": {}
},
"timeouts": {},
"version": "2.2.0"
},
"networkd": {},
@jeefy
jeefy / mongo_backup.sh
Last active May 2, 2018 15:51
hateful but sane mongo container backup cron
#!/bin/bash
containers=$(sudo docker ps | grep mongo | awk '{if(NR>1) print $NF}')
timestamp=$(date +%Y-%m-%d_%H-%M-%S)
backup_command="mongodump --gzip --archive=/data/db/$timestamp.tar.gz"
prune_command="find /data/db/ -type f -mtime +7 -name '*.gz' -execdir rm -- '{}' \;"
for container in $containers
do
echo $container
echo $backup_command
docker exec $container /bin/sh -c "$backup_command"

Keybase proof

I hereby claim:

  • I am jeefy on github.
  • I am jeefy (https://keybase.io/jeefy) on keybase.
  • I have a public key whose fingerprint is 4BA1 F0DB 154A 7A60 D8ED AFCF 9A36 B60D DC72 2C87

To claim this, I am signing this object:

@jeefy
jeefy / install-rancher-compose.sh
Last active January 25, 2021 11:14
Rancher Compose Install Script
#!/bin/bash
# To run locally: ` curl -s https://gist.githubusercontent.com/jeefy/7fed19a335d5caae24639e7ee7be1b71/raw/install-rancher-compose.sh | sh `
VERSION_NUM="0.9.2"
wget https://github.com/rancher/rancher-compose/releases/download/v${VERSION_NUM}/rancher-compose-linux-amd64-v${VERSION_NUM}.tar.gz
tar zxf rancher-compose-linux-amd64-v${VERSION_NUM}.tar.gz
rm rancher-compose-linux-amd64-v${VERSION_NUM}.tar.gz
sudo mv rancher-compose-v${VERSION_NUM}/rancher-compose /usr/local/bin/rancher-compose
@jeefy
jeefy / phonegap_orm.js
Last active December 19, 2023 21:26
Rough ORM on top of PhoneGap's Storage API.
/*
I wasn't happy with PhoneGap's Storage API and made it cleaner (in my eyes anyway)
Example:
db.query("someTable", ['id', 'column1', 'column2'], false, function(tx, results){ .. });
db.query("someTable", ['*'], {'column1':'val', 'column2':'val'}, function(tx, results){ .. });
db.save("someTable", IterableObject, function(){ ... });
Doing more testing and validation later, but getting it out there now. :)
*/