Skip to content

Instantly share code, notes, and snippets.

1 jweatherly@jweatherly-Precision-T5610 ~/Code/sergeant % python client.py :(
('127.0.0.1', 12345)
('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1/SSLv3', 256)
{'issuer': ((('countryName', u'US'),),
(('stateOrProvinceName', u'South Carolina'),),
(('localityName', u'Charleston'),),
(('organizationName', u'Internet Widgits Pty Ltd'),)),
'notAfter': 'Jul 18 18:11:30 2016 GMT',
'notBefore': u'Jul 19 18:11:30 2015 GMT',
'serialNumber': u'CF9728D544401B7A',
@JamesTheBard
JamesTheBard / priv.pl
Last active August 29, 2015 14:23
Privilege users parsing script
#!/bin/perl
use strict;
use warnings;
use File::Spec;
our %file_path = (
"PASSWD" => "etc/passwd",
"GROUP" => "etc/group",
"SUDOERS" => "etc/sudoers",
Starting from '10'...
5: 0.722471690979458
10: 0.7071067811865475
15: 0.7071067811865475
20: 0.7071067811865475
Starting from '100,000'...
5: 3125.00005328125
10: 97.65795665907389
20: 0.7071072944225515
@JamesTheBard
JamesTheBard / md5sum.py
Created March 17, 2015 17:07
Python md5sum quickie
from __future__ import print_function
import hashlib
import sys
def md5Checksum(filePath):
with open(filePath, 'rb') as fh:
m = hashlib.md5()
while True:
data = fh.read(8192)
if not data:

Keybase proof

I hereby claim:

  • I am jamesthebard on github.
  • I am jamesthebard (https://keybase.io/jamesthebard) on keybase.
  • I have a public key whose fingerprint is DE0D 383B F8C7 656E 6926 A19F 17FB EA43 AF75 23D5

To claim this, I am signing this object:

@JamesTheBard
JamesTheBard / .vimrc
Created December 5, 2014 05:54 — forked from anonymous/.vimrc
set modeline
set ts=4
set sts=4
set et
set sw=4
set ruler
set number
set nofoldenable
set scrolloff=10
#!/bin/bash
# Variable assignment for legibility. The file content should be
# in the form of:
# username, password
filename=$1
# If the file exists, loop through it and start making accounts
# else just quit and display the help.
if [ -e $filename ]
@JamesTheBard
JamesTheBard / download_tags.py
Created July 18, 2013 12:53
A quick update...
from django import template
from cms_downloads.models import FileRevisions
import os
register = template.Library()
def get_latest_download_by_name(file_name):
download_query = FileRevisions.objects.filter(name__name__startswith=filename).order_by('-version')[0]
if download_query.count == 0: download_query = None
return {'cms_download': download_query}
@JamesTheBard
JamesTheBard / eventcmd
Created June 10, 2013 06:21
mcabber notification script
#!/bin/sh
echo "$1 $2 $3 $4" >> ~/test.mcabber.log
EVENT_TYPE=$1
EVENT_SUBTYPE=$2
JID=$3
FILE=$4
TITLE="Google Hangouts"
SOUND_FILE="$HOME/.mcabber/sounds/alert_47.wav"
ICON="$HOME/.mcabber/images/chat.png"
TIMEOUT=10000
@JamesTheBard
JamesTheBard / clipcp
Last active December 18, 2015 05:39
Clipboard copy script for files.
#!/bin/bash
# Display some help text
usage() {
echo "clipcp - Copy the contents of a text file to the clipboard";
echo "Usage: clipcp FILE";
}
# 'Cat' the file and pipe it into the xsel program which throws whatever
# it gets onto the clipboard.