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 / jquery.ba-tinypubsub.js
Created October 18, 2012 10:35 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@denzuko
denzuko / README.md
Created October 18, 2012 12:56 — forked from MauroJr/README.md
Pub/sub with MongoDB, jQuery, and Node.js

Pub/sub with MongoDB and Node.js

Setup:

$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
@denzuko
denzuko / catt.sh
Last active December 13, 2015 22:49
cat a file without comments (usefull for ini and rc files)
catt() { sed "s/^[#|;]\+.*$//g" $1 | grep -v "^$"; }
<!-- IMAGE BEGINS HERE -->
<font size="1">
<pre><font color=black>1111111010101101000110001110000000110111000100000110110110001110001110011101100101101000010000100110110011000000110000100000100110</font><br><font color=black>1000010010100100111011001101100111100011001111011101110101101011100100111110100011010100001100010111110000111001101111011001111011</font><br><font color=black>0011000001110000110000101000111000110111110110101100100101111001100010110001010011000000010001110110100100010000100110001001100001</font><br><font color=black>1110100010001110111111111011010010010110001100101011010110100010110001111110110000000000011110101000011011010101110011111011100000</font><br><font color=black>1111001000111010110011001001100000010100111111111010110100110101000010011101000001111110010100100100001001011111001000101000001001</font><br><font color=black>1010010010001110101010110100010110101100100110101000000101100000011001101001101101101110111100110110100000010111110000011101110110</font><br><font color=black>1010

Introduction

ssh-srv-wrapper is bash shell script which tries to find a SSH SRV record for the first host and uses what is found rather than what was passed (if a valid record is found).

Install

Run the script directly or feel free to rename or symlink to the name ssh. It will look for another ssh in your path to execute.

@denzuko
denzuko / Xmodmap
Created March 16, 2013 13:00
Here's a great Unix keyboard mappings on Xorg for that classic SysV feel in Linux.
! ~/.Xmodmap
! xmodmap -pke | egrep '(Control|Super|Alt|Menu)'
! Use to set keycodes correctly below. List reordered to match
! keys from left to right.
! First clear all modifiers, caps lock & control
clear lock
clear control
clear mod1
@denzuko
denzuko / 5min - post #form
Last active December 19, 2015 17:29
Post #form to a restful api
var isPulse=true;
function heartbeat(){
if(isPulse){
var hb = setTimeout(heartbeat, seconds*1000);
//process stuff here
//isPulse can be whatever you want.
//It just needs to be something that will stop the recursive loop--an error condition, perhaps.
@denzuko
denzuko / renamemp3
Last active December 24, 2015 18:59 — forked from anonymous/renamemp3
#!/bin/bash
###############################################################################
#
# renamemp3 - Version 1.0
# Copyrighted (c)2013 Dwight Spencer (@denzuko) <[email protected]>
# All Rights Reserved. Licenced under OSI MIT licence.
#
# renames files in a directory given by parameters to append '.mp3'
#
###############################################################################
gem 'coderay', require: false
gem 'slop', require: false
gem 'method_source', require: false
gem 'pry', require: false
gem 'yard', require: false
gem 'pry-doc', require: false
gem 'columnize', require: false
gem 'debugger-ruby_core_source', require: false
gem 'debugger-linecache', require: false
gem 'debugger', require: false
@denzuko
denzuko / secscanner-v1.1b.py
Created January 6, 2014 05:33
Security scanner
#!/usr/bin/env python
import re
import hashlib
import Queue
from random import choice
import threading
import time
import urllib2
import sys
import socket