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 / case_study.md
Last active March 5, 2024 07:21
Case Study

Case Study

A windows case study.

The details of what I would do for Linux would be different, but the premise would remain.

Table Of Contents

@JasonGiedymin
JasonGiedymin / jvm_tuning_64bit
Created April 17, 2012 17:42
JVM Performance Tuning
# Jason Giedymin
# jasong _-@-_ apache _dot_ org
# Try these options for your 64bit JVM.
# Aggressive collection, Large-ish Memory footprint
-Xss1024k -Xms512m -Xmx1408m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=1024m -XX:+AggressiveOpts -XX:ParallelGCThreads=16 -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+UseCompressedOops
# Aggressive collection but use memory if needed
-Xss1024k -Xms128m -Xmx1408m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=1024m -XX:+AggressiveOpts -XX:ParallelGCThreads=4 -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+UseCompressedOops
@JasonGiedymin
JasonGiedymin / azv
Last active October 11, 2023 19:38
Azure Vault CLI Helper script
#!/usr/bin/env zsh
# Script: azv
# Author: Jason Giedymin <jason.giedymin@gmail.com>
# Name: azv
# Version: 1.0.4
# Description: Azure Vault Helper Script
# License: MIT
#
# Exit Codes:
@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 / gist:90f701e603ee9a93eef5c9ac748d1b24
Created July 20, 2022 17:26
Quick sorting of elasticsearch indices by size
# simple sort
curl --no-progress-meter --stderr - -X GET --user "<username>:<password>" "https://<host>:<port>/_cat/indices" | sort -g -k 7
# if you want do do some formatting in between or what have you
curl --no-progress-meter --stderr - -X GET --user "<username>:<password>" "https://<host>:<port>/_cat/indices" | tr -s '[:blank:]' ',' | sort -g --field-separator=',' -k 7 | column -t -s ','
@JasonGiedymin
JasonGiedymin / entrypoint
Last active May 27, 2022 16:14
Bash trap a nodejs application - useful for docker
#!/usr/bin/env bash
set -e
sig_handler() {
exit_status=$? # Eg 130 for SIGINT, 128 + (2 == SIGINT)
if [[ exit_status -gt 0 ]]; then
cat <<EOF
!!!
WARN: signal [$exit_status] recieved by entrypoint ... returning it"
@JasonGiedymin
JasonGiedymin / cherry-pick-sample.sh
Created May 28, 2017 03:10
Git cherry pick out files into another directory with full paths retained.
#!/usr/bin/env bash
#
# Author: _j_a_s_o_n_g_at_a_p_a_c_h_e_dot_org
# License: GNU GPLv3
#
set -e
if [ -z "$1" ]; then
echo "Please supply param 1 as the git hash which to cheery pick. Now exiting..."
@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 / fast_inv_square.coffee
Created June 20, 2011 20:43
CoffeeScript Javascript Fast Inverse Square with Typed Arrays
###
Author: Jason Giedymin <jasong _a_t_ apache -dot- org>
http://www.jasongiedymin.com
https://github.com/JasonGiedymin
Appearing in the Quake III Arena source code[1], this strange algorithm uses
integer operations along with a 'magic number' to calculate floating point
approximation values of inverse square roots[5].
@JasonGiedymin
JasonGiedymin / rabbitmq.rake
Created November 19, 2011 21:34
Easy RabbitMQ Start/Stop Rake tasks for OSX
#
# Don't want to run PostgreSQL as a service? Want to manually start and stop it?
# >> bundle exec rake rabbitmq:mac:start
# >> bundle exec rake rabbitmq:mac:stop
#
namespace :rabbitmq do
namespace :mac do
desc "Starts a Mac brew installed RabbitMQ server."