Skip to content

Instantly share code, notes, and snippets.

@glennschler
glennschler / ora-ec2hosts
Created June 10, 2012 18:53
Removes old entries of local hostname from the hosts file since the REH EC2 image inserts a new entry every reboot
#! /bin/sh -x
#
# chkconfig: 2345 96 99
# description: removes old entries for this server name from the host file
# add then adds the correct hosts entry
#
hname=`hostname`
lev=`who -r`
echo "Called with ${1} hostname=${hname} ${lev}" | logger -t 'ora-ec2hosts'
@glennschler
glennschler / MyHTTPService.java
Created June 11, 2012 17:40
I use this OATS OpenScript technique for several advanced script control needs. This example only shows how to stop the "content length is zero" error, though this can be used as a template for any advanced control of virtual users.
package yourcompanyname.oats.scripting.modules.http.api;
import oracle.oats.scripting.modules.basic.api.exceptions.AbstractScriptException;
import oracle.oats.scripting.modules.http.api.HTTPService;
import oracle.oats.scripting.modules.http.api.HTTPService.EncodeOptions;
public class MyHTTPService extends HTTPService
{
private IteratingVUser m_vu = null;
@glennschler
glennschler / lsof
Last active December 11, 2015 16:58
format lsof output
lsof -i | grep -E "(LISTEN|ESTABLISHED)" | awk '{printf "%-15s\t%-6s\t%s\n", $1, $8, $9}'
i.e.:
Notes TCP 192.168.2.12:50482->17.158.8.77:imaps
firefox-b TCP 192.168.2.12:61090->gist.github.com:https
@glennschler
glennschler / nexus date fix.md
Last active December 19, 2015 09:49
Various Android Nexus command line
# redefine the tmux cmd to always prompt and re-attach to an old session,
# if no explicit session name given
tmux() {
  # if no arguments then check if there is any old sessions
  if [ $# -eq 0 ]; then
    t=$(which tmux)
    results=$($t list-sessions 2> /dev/null)
    if [[ -z $results ]]; then
 # start normal as the first session

Keybase proof

I hereby claim:

  • I am glennschler on github.
  • I am glennms (https://keybase.io/glennms) on keybase.
  • I have a public key ASCQudVJeM81fGROtlqJcLQ7ds0sw2pThp-0USTdj3vmcQo

To claim this, I am signing this object:

@glennschler
glennschler / readme.md
Created March 14, 2017 22:00
VirtualBox on OSX

For the Mac [some possible needed tools? try without]

brew update
brew install wget
brew install curl

Setup some directory structure

mkdir minecraft
@glennschler
glennschler / Dockerfile
Last active January 23, 2018 09:12
node-inspector debug node app running in docker container
FROM node:onbuild
ADD ./package.json /tmp/package.json
RUN npm install -g node-inspector
RUN cd /tmp && npm install
RUN mkdir -p /opt/app/node
RUN if [ -d /tmp/node_modules ] ; then cp -a /tmp/node_modules /opt/app/node; fi
WORKDIR /opt/app/node
ADD . /opt/app/node
@glennschler
glennschler / aws-algo-vpn-readme.md
Last active April 20, 2019 23:20
Algo VPN with enhancements

ALGO VPN running in an AWS Spot instance

Given the highlights from the Alestic blog Feb-2018, now enhance the Algo VPN Ansible script to start a spot instance vs on demand instance.

Alestic blog highlights reason to enhance algo script

  • Can run an instance like you normally do for on-demand instances. One new parameter can make it a Spot instance
  • Spot price volatility has been significantly reduced
  • No longer have to specify a bid price
  • CloudWatch Events can now send a two-minute warning before a Spot instance is interrupted