Skip to content

Instantly share code, notes, and snippets.

View theothermattm's full-sized avatar

Matt M. theothermattm

View GitHub Profile
@theothermattm
theothermattm / visualvm-tomcat7.sh
Last active August 29, 2015 14:04
Get Java 7 visualvm working on remote Tomcat server
# Tomcat setup
# add the following to the JVM_OPTS for the given tomcat instance
VISUAL_VM_SETTINGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.port=8086 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Xverify:none"
# note that on os x, some StackOverflow posts have discussed the need for an additiona "-Xshare:off" setting.
# To run jstatd
# create a file called jstatd.all.policy
# see http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstatd.html
@theothermattm
theothermattm / .tmux.conf
Last active August 29, 2015 14:05
My Tmux Conf file
#Below configs from
# https://wiki.archlinux.org/index.php/Tmux#Vim_friendly_configuration
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
@theothermattm
theothermattm / gist:ff8d689cf2405a504b28
Created September 16, 2014 17:15
Cut a section of lines using sed
sed -n 16224,16482p filename > newfile
@theothermattm
theothermattm / attachto.sh
Created February 25, 2015 16:32
Attach to a docker image by image name
# attaches to the first running docker container containing the name passed
# in as the first argument to the command
# example: attachto projects
function attachto () {
echo "Attaching to first running docker container with name: $1 You might need to press ctrl+c to start entering commands..."
docker attach $( docker ps | grep $1 | head -n 1 | cut -d' ' -f1)
}
@theothermattm
theothermattm / .matt_profile
Last active September 30, 2015 12:36
My Bash/Zsh Common Dotfile
# for homebrew, make sure homebrew stuff is last in path
export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH
function mi() { mvim "$@" ;}
# git
alias gs='clear; git status'
alias sstatus='clear; svn status'
function gadd() { git add "$@" ;}
@theothermattm
theothermattm / an-event-apart-austin-2015-notes.md
Created October 7, 2015 21:28
An Event Apart - Austin, TX 2015 - Notes

Follow ups:

  • stand up webpage test internally: https://sites.google.com/a/webpagetest.org/docs/private-instances
    • docker image?
    • convert AMI to an VMware image?
    • need windows machines for agents
  • sign up for thewebahead.net podcast - @jensimmons
  • responsive design podcast - ethan marcotte and karen mcgrane
  • mailtoself.com
  • hipmunk.com - for travel
@theothermattm
theothermattm / gist:4583395
Last active December 11, 2015 09:58
Well, it looks like Apple uses Spring MVC :) Got this on an email verification page.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
@theothermattm
theothermattm / oracle-to-date.sql
Created March 8, 2013 21:28
Oracle to_date with hour and minutes
select * from my_table where my_date_time > to_date('08-03-2013 16:00','dd-MM-yyyy HH24:MI') order by my_date_time;
@theothermattm
theothermattm / public-ip.sh
Created March 8, 2013 21:33
Find the *public* IP of a host (got this from a handy StackExchange post)
wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
@theothermattm
theothermattm / convert-crt-to-pem.sh
Created July 20, 2016 15:32
Convert .crt to .pem for CA's
# from https://github.com/nodejs/node/issues/3742#issuecomment-225939382
openssl x509 -inform der -in /Path/to/the.crt -out /Path/to/the/file.pem