Skip to content

Instantly share code, notes, and snippets.

View JasonGiedymin's full-sized avatar
🏠
Working from home

Jason Giedymin JasonGiedymin

🏠
Working from home
View GitHub Profile
@JasonGiedymin
JasonGiedymin / rancher_metadata_service_lookup.py
Last active November 2, 2016 05:16
Python Script that does a lookup for for a specific service and port mapping in a rancher stack returning a host ip or fqdn.
#!/usr/bin/python3
#
# script: rancher_metadata_service_lookup.py
# author: jason_g_at_apache_dot_org
# desc: does a lookup for for a specific service and port mapping in a rancher stack returning a host ip or fqdn.
# usage: python3 rancher_metadata_service_lookup.py --stack="MyApp" --service="MockBackend3" --port=80 --debug --fqdn
# notes: this script is dirty. Totally Usable but dirty. If you want to build on it clean up the cyclomatic complexity
# in some of the functions.
#
# Alpine:
@JasonGiedymin
JasonGiedymin / sensor.sh
Last active September 7, 2016 03:06
Quick ubuntu "sensor" readout
#!/bin/bash
sensors -f | grep "Core 0" | awk '{print $3}' | awk -F '°' '{ print $1 }'
@JasonGiedymin
JasonGiedymin / bitnami-jenkins-upgrade.sh
Last active August 5, 2020 02:14
An upgrade script to help do some minor upgrades to the bitnami jenkins image.
#!/bin/bash
#
# Script Name: bitnami-jenkins-upgrade.sh
# Version: v1.0.0
# Author: Jason Giedymin <jason_g_at_apache_dot_org>
# Usage: `bash bitnami-jenkins-upgrade.sh`
# Descr: An upgrade script to help do some minor upgrades
# to the bitnami jenkins image.
# Note: this script does reference sudo and will stop
# if any part of it fails.
@JasonGiedymin
JasonGiedymin / power_ball.py
Last active January 14, 2016 06:28
quick n dirty powerball app done in python
# quick n dirty powerball app done in python
# wrote this in 30min (just look at the globals, tuples, string interpolation everywhere)
# not even sure if it's correct, probably won't play again due to odds ;-)
#
# outputs:
# $4, powerball match on ticket #0 [44, 47, 51, 57, 57], list: ([44, 47, 51, 57, 61], 10)
# $4, powerball match + 1 ball match on ticket #1 [*4, 47, 51, 57, 57], list: ([4, 47, 51, 57, 61], 10)
# $7, powerball match + 2 ball matches on ticket #2 [61, 47, 51, *8, *8], list: ([61, 47, 51, 8, 4], 10)
# $100, powerball match + 3 ball matches on ticket #3 [61, 47, *19, *8, *8], list: ([61, 47, 19, 8, 4], 10)
# $10000, powerball match + 4 ball matches on ticket #4 [61, *27, *19, *8, *8], list: ([61, 27, 19, 8, 4], 10)
@JasonGiedymin
JasonGiedymin / actors.py
Last active July 13, 2023 12:43
Python actors using gevent libev.
# Python actors using gevent libev.
#
# [gevent](http://www.gevent.org/index.html)
# [libev](http://software.schmorp.de/pkg/libev.html)
#
# Jason Giedymin <jason g _at_ g mail dot com>
#
# This example serves as a simple play between four actors.
# - 2 Workers
# - 1 Supervisor
@JasonGiedymin
JasonGiedymin / boot2dockerp.sh
Last active August 29, 2015 14:27
Simple script to help drive the boot2docker docker with parallels without much change.
#!/bin/bash
# Author: Jason Giedymin <jason dot giedymin -at- gmail dot com>
# License: Apache2
# Desc: Simple script to help drive the boot2docker docker with
# parallels without much change.
set -e
BOOT2DOCKER_PARALLELS=~/boot2docker-parallels
@JasonGiedymin
JasonGiedymin / path_loading_on_mac.md
Created June 28, 2015 02:15
Path Loading on Mac

Paths to consider on a Mac

It's not just your profile running! See below for additional settings:

~/.bash_profile # recommended
~/.profile
~/.bashrc
/etc/paths.d/
/etc/paths
@JasonGiedymin
JasonGiedymin / kafka.js
Created May 21, 2015 05:39
High Level Kafka High Level Wrapper :-) )
'use strict';
// Imports
var bunyan = require('bunyan');
var Promise = require('bluebird');
var lodash = require('lodash');
var kafka = require('kafka-node');
// Vars
var Producer = kafka.Producer;
@JasonGiedymin
JasonGiedymin / bash_command_runner.sh
Created March 22, 2015 02:45
Bash Command Runner
# Bash Command Runner
# bash_command_runner.sh
# jason.giedymin@gmail.com
# ApacheV2
#
# Helpers
# -------
# f(x) runner
function run() {
@JasonGiedymin
JasonGiedymin / build.sh
Created March 9, 2015 03:48
Template bash Dockerfile runner
#!/bin/bash
DOCKERNAME="ansibleshipyard/ansible-????"
DOCKER_DIR="dockerfiles"
TAGS=(ubuntu centos ???)
CONTEXT=.
usage() {
local tag=$1