Skip to content

Instantly share code, notes, and snippets.

View kennedyj's full-sized avatar

Josh Kennedy kennedyj

View GitHub Profile
@kennedyj
kennedyj / nxfetch.sh
Created January 30, 2012 22:32
Fetch artifacts from nexus.
#!/bin/bash
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging -r repository
#shopt -o -s xtrace
# Define Nexus Configuration
NEXUS_BASE=http://repository.example.com:8081/nexus
REST_PATH=/service/local
ART_REDIR=/artifact/maven/redirect
@kennedyj
kennedyj / hex2bin
Created January 30, 2012 23:31
Convert Hex to Bin in bash
#!/bin/bash
if [ ! -n $1 ]; then
echo "Must specify a value"
exit 1
fi
for var in "$@"
do
code=`echo $var | tr 'a-z' 'A-Z'`
@kennedyj
kennedyj / parse-pom.py
Created February 23, 2012 22:10
quick maven pom parser for group, artifact, and version
#!/usr/bin/python
from xml.etree import ElementTree as et
import sys
if __name__ == "__main__":
ns = "http://maven.apache.org/POM/4.0.0"
for filename in sys.argv[1:len(sys.argv)]:
@kennedyj
kennedyj / gist:2369656
Created April 12, 2012 17:55
Japanese and Javascript
var 氷 = "ice";
function 雪() {
document.write("It's snowing! 雪 and it's " + 氷);
}
window.onload(雪());
@kennedyj
kennedyj / check_ssl_certificate.pl
Created May 21, 2012 22:44
nagios ssl certificate check
#!/usr/bin/perl -w
#
# check_ssl_certificate
# Nagios script to check ssl certificate expirations
#
# Copyright (c) 2006-2008 David Alden <alden@math.ohio-state.edu>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
@kennedyj
kennedyj / check_domain.sh
Created May 22, 2012 19:16
nagios domain check
#!/bin/bash
####################################################
# script to check domain name experation time.
# it works only on UNIX system
# you need to install whois on system
# yum install whois - for centos OS
#
#
#
####################################################
@kennedyj
kennedyj / Default (Linux).sublime-keymap
Created September 5, 2012 18:52 — forked from coldnebo/Default (Linux).sublime-keymap
simple scripts to prettify your xml and json in sublime text 2
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
@kennedyj
kennedyj / github-backup.py
Created December 5, 2012 21:51
clone or pull all repos for an organization on github
#!/usr/bin/env python
import argparse, ConfigParser
import os, sys, subprocess
import yaml
from pygithub3 import Github
from datetime import datetime, date, time
import smtplib
from email.MIMEText import MIMEText
@kennedyj
kennedyj / sticky.js
Created December 7, 2012 21:29
JQuery Sticky Plugin
/*
Copyright (c) 2012 Josh Kennedy <josh@vsso.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
@kennedyj
kennedyj / parse-apache-access.sh
Created May 7, 2013 15:44
Parse through an apache access log (default format) for requests from a given date, that optionally match a path and or method. Usage: $0 [OPTIONS...] COMMAND FILENAME -d, --date date time from the log 22/Apr/2013 22/Apr/2013:14: -p, --path escaped relative url path -m, --method HTTP method [GET,POST,DELETE...] COMMANDS links show the unique ip …
#!/bin/bash
function display_help {
cat <<EOF
Usage: $0 [OPTIONS...] COMMAND FILENAME
-d, --date date time from the log
22/Apr/2013
22/Apr/2013:14:
-p, --path escaped relative url path