Skip to content

Instantly share code, notes, and snippets.

@mrowe
mrowe / debug.md
Created May 17, 2020
Debugging weird prod problem
View debug.md

We were in the final push towards a major release of a large public-facing J2EE application when I was assigned The Defect. The application, which had been working quite well in functional test environments (all things considered), suddenly stopped when deployed to SIT. Well, it started up ok, but if you tried to log in, you were faced with a long wait. Very long.

It was exactly the same code that had been working in other environments, but the difference in SIT, of course, was that debug logging was turned off.

After a day of changing logging levels, bouncing WebSphere servers and tracing debug logging code, I stumbled across this gem:

    Iterator i = formBean.getKeys();
    while (i.hasNext()) {
        if (LOG.isDebugEnabled()) {
View example.csv
Title Notes Username Password URL Type
AirBNB p4ssw0rd Password
Airbnb user p4ssw0rd https://login.airbnb.com Login
PayPal user p4ssw0rd https://www.paypal.com Login
Bendigo Bank user p4ssw0rd Login
Quantium PSeeker Replica (read only) quantium p4ssw0rd Database
irc mrowe p4ssw0rd Server
Disney user p4ssw0rd Login
Zoho user p4ssw0rd https://accounts.zoho.com Login
Bookbaby user p4ssw0rd https://www.bookbaby.com/myaccount/login.aspx Login
@mrowe
mrowe / .xmobarrc
Created Jun 10, 2017
Xmonad/Xmobar config
View .xmobarrc
Config { font = "-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*"
, borderColor = "black"
, border = TopB
, bgColor = "black"
, fgColor = "grey"
, alpha = 255
, position = TopW L 100
, allDesktops = True
, overrideRedirect = True
, commands = [
@mrowe
mrowe / garmin-restore.sh
Last active May 7, 2017
Restore my Garmin Edge 510 from a local backup
View garmin-restore.sh
#!/bin/bash
set -e
DISK="disk2"
VOLUME="GARMIN"
BACKUP="${HOME}/Desktop/Garmin"
FILELIST="Sports/*.fit Settings/Settings.fit Device.fit"
@mrowe
mrowe / unused-security-groups.rb
Last active Aug 29, 2015
Find unused security groups
View unused-security-groups.rb
#!/usr/bin/env ruby
require 'aws-sdk'
ec2 = AWS::EC2.new
elb = AWS::ELB.new
rds = AWS::RDS.new.client # shrug
security_groups = ec2.security_groups.map { |sg| sg.id }.sort
instance_sgs = ec2.instances.map { |i| i.security_groups.map { |sg| sg.id } }.flatten.sort
@mrowe
mrowe / robots.java
Last active Aug 29, 2015
Toy Robot in Java 7
View robots.java
package com.mikerowecode.robot;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Robots {
public static void main(String[] args) {
Robot robot = new Robot(-1, -1, Direction.WEST);
@mrowe
mrowe / robots.java
Created Jan 8, 2015
Toy Robot in Java 8
View robots.java
package com.mikerowecode.robot8;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.function.Function;
public class Robots {
public static void main(String[] args) {
Robot robot = new Robot(-1, -1, Direction.WEST);
Scanner in = new Scanner(System.in);
@mrowe
mrowe / muttrc
Created Oct 9, 2014
Viewing GitHub pull request diffs
View muttrc
folder-hook REA 'macro pager \Cd '<pipe-message>~/dotfiles/mutt/view_git_patch.sh^M'
@mrowe
mrowe / gist:e7ef918461a57e66a7ec
Created Aug 21, 2014
Installing npm on a new Ubuntu box
View gist:e7ef918461a57e66a7ec
vagrant@ubuntu-14:~$ sudo apt-get install npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
build-essential g++ g++-4.8 gyp javascript-common libc-ares-dev libc-ares2 libjs-node-uuid libssl-dev libssl-doc libstdc++-4.8-dev
libv8-3.14-dev libv8-3.14.5 node-abbrev node-ansi node-archy node-async node-block-stream node-combined-stream node-cookie-jar
node-delayed-stream node-forever-agent node-form-data node-fstream node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs
node-gyp node-inherits node-ini node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream
node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-qs node-read node-read-package-json node-request
@mrowe
mrowe / skeleton
Created Jul 16, 2014
init.d skeleton
View skeleton
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
You can’t perform that action at this time.