Skip to content

Instantly share code, notes, and snippets.

@greenantdotcom
greenantdotcom / gist:2208964
Created March 26, 2012 19:29
How to detect which processes are running on a disk you are trying to eject
[root@scratch1 exthd]# fuser -mv /media/exthd/
USER PID ACCESS COMMAND
/media/exthd/: root 29787 ..c.. bash
root 29846 ..c.. bash
root 29898 ..c.. man
root 29901 ..c.. sh
@greenantdotcom
greenantdotcom / gist:2208971
Created March 26, 2012 19:30
How to inspect SSL certificate related info
### View a key's information
openssl rsa -in key -noout -text
### View a CSR's information
openssl req -in csr -noout -text
### View a certificate's information
@greenantdotcom
greenantdotcom / gist:2208996
Created March 26, 2012 19:34
How to unf*@# a git push
###
### DO NOT DO THIS IF YOU ARE NOT COMFORTABLE WITH WHAT YOU ARE DOING.
###
### ONCE YOU START MAKING FORCIBLE CHANGES ON YOUR LOCAL OR HOSTED REPOS, YOU MAY NOT BE ABLE TO UNDO YOUR UNDOs SO GO SLOWLY AND MAKE URE YOU DO THE RIGHT THING
###
### ------------------------------------------------------------------
### Reference: http://stackoverflow.com/questions/1270514/undoing-a-git-push#1270608
@greenantdotcom
greenantdotcom / s3.markdown
Created March 28, 2012 21:55
Setting public read-only ACL for uploaded files

Alternatively, in the Amazon interface, you can select a directory or file, and click on the action "Mark as public"

@greenantdotcom
greenantdotcom / gist:2312141
Created April 5, 2012 15:59
Reading and writing to plists from the command line

Why?

When working on a remote machine, or a machine that doesn't have a GUI plist editor on it, the command line may be your only or best option.

There are two options present on OS X to help you.

default

Using the default command on OS X can help you get around.

@greenantdotcom
greenantdotcom / gist:3085766
Created July 10, 2012 19:45
Confirm key, CSR, and certificates all have the same modulus (which should confirm that they all share the same key)
### View a key's information
openssl rsa -in key -noout -modulus
### View a CSR's information
openssl req -in csr -noout -modulus
### View a certificate's information
@greenantdotcom
greenantdotcom / gist:3261017
Created August 5, 2012 01:29
How to test SNI on a server using openssl and s_client
openssl s_client -connect antbox:8401 -servername zoodeals.com
@greenantdotcom
greenantdotcom / gist:3350269
Created August 14, 2012 15:27
Renaming a git branch

Say you're on a branch named BEFOURE-310 and you want to fix the typo. Renaming the branch is this simple:

git br --move BEFOUR-310

@greenantdotcom
greenantdotcom / README.markdown
Created October 7, 2012 21:31 — forked from lukemorton/README.markdown
init.d file for statsd and carbon on rhel
Fork of https://gist.github.com/1071989
Further CentOS 5.x instructions customized by MJH

Ideally do this as SUDO

yum install -y git gcc gcc-c++ zlib-devel curl curl-devel openssl

Install node

TK - replace with nodejs-stable YUM instructions
input {
file {
type => syslog
path => "/var/log/messages"
}
}
filter {
grok {
type => syslog