Skip to content

Instantly share code, notes, and snippets.

View denzuko's full-sized avatar
💬
linkedin.com/in/denzuko

Dwight Spencer denzuko

💬
linkedin.com/in/denzuko
View GitHub Profile
@denzuko
denzuko / notify.sh
Last active January 3, 2016 01:49 — forked from apraga/notify.sh
#!/bin/bash
# popup a small notification with 'notify-send'
dis=`formail -X From: -X Subject:`
#TODO: replace the following with sed/read
from=`echo "$dis" | formail -X From:`
sub=`echo "$dis" | formail -X Subject:`
# tweaks < > are special
from=${from//</\(}
from=${from//>/\)}
@denzuko
denzuko / vimrc
Created January 12, 2014 22:44 — forked from apraga/vimrc
" Do you want bepo configuration ? 0 if not
let want_bepo = 1
" Set 'nocompatible' to ward off unexpected things that your distro might
" have made, as well as sanely reset options when re-sourcing .vimrc
set nocompatible
" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
@denzuko
denzuko / fh-ticket
Last active January 3, 2016 10:29
Added documentation and finalized release version on 1.0
#!/bin/sh
###############################################################################
# $Id$
# elvis: IMS tickets -- Search for a ticket within IMS
# version 0.1 by Dwight Spencer (@denzuko) <[email protected]>
# version 0.2 by Dwight Spencer (@denzuko) <[email protected]>
# - Fixes some param issues
# version 0.3 by Dwight Spencer (@denzuko) <[email protected]>
# - Replaced google in the param check to ims
# version 1.0 by Dwight Spencer (@denzuko) <[email protected]>
require 'rubygems'
require 'openssl'
require 'digest'
require 'sinatra'
require 'rack/ssl'
use Rack::SSL
use Rack::Auth::Basic, "Restricted Area" do |username, password|
[username, password] == ['admin', 'password']
end
require 'digest'
# Get SHA256 Hash of a file
puts Digest::SHA256.hexdigest File.read "data.dat"
# Get MD5 Hash of a file
puts Digest::MD5.hexdigest File.read "data.dat"
# Get MD5 Hash of a string
puts Digest::SHA256.hexdigest "Hello World"
# Get SHA256 Hash of a string using update
import csv
from time import *
#tr < openurlgource.csv -d '\000' > openurlgourcenonulls.csv ???deletes
#sed 's/\x0/ /g' openurlgource.csv > openurlgourcenonulls.csv
f=open('openurlgourcenonulls.csv', 'rb')
reader = csv.reader(f, delimiter='\t')
writer = csv.writer(open('openurlgource.txt','wb'),delimiter='|')
@denzuko
denzuko / gist:9756334
Created March 25, 2014 06:44
ldbd brew breaks on Mountian Lion
chmod a+x m_palm
chmod a+x m_ldap
llvm-gcc -g -O2 -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_GETOPT_H=1 -DHAVE_ICONV=1 -DICONV_CONST= -c dotlock.c
cat tac.awk > tac
Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path.
llvm-gcc -g -O2 -liconv fetchaddr.o rfc822.o helpers.o rfc2047.o -o fetchaddr
chmod a+x tac
llvm-gcc -g -O2 -liconv qpto8bit.o rfc822.o helpers.o rfc2047.o -o qpto8bit
ABQuery/pbxbuild.sh
cp: ABQuery/build/ABQuery: No such file or directory
#!/bin/bash
#
# Initialize new virtual server using LXC and set up networking and HTTP proxy
#
# Written by: Deni Bertovic <[email protected]>
#
# Released into Public Domain. You may use, modify and distribute it as you
# see fit.
#
# This script will:

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
###############################################################################
# Author: @BrockTibert
# Purpose: Collect Historical NHL Skater Stats 1960 - 2011 (in progress)
# Date: February 2011
#
# Used: R Version 2.12.1, Windows 7 Pro, StatET Plugin for Eclipse
#
# # Copyright (c) 2011, under the Simplified BSD License.
# For more information on FreeBSD see: http://www.opensource.org/licenses/bsd-license.php
# All rights reserved.