Skip to content

Instantly share code, notes, and snippets.

View solarmicrobe's full-sized avatar

Russell Parks solarmicrobe

View GitHub Profile
@ma11hew28
ma11hew28 / find-duplicate-files.rb
Last active January 25, 2022 18:48
Ruby script that finds identical (md5) files in all subdirectories (recursive)
# This Ruby script (regardless of where it's located on the file system) recur-
# sively lists all duplicate files in the direcotry in which it's executed.
require 'digest/md5'
hash = {}
Dir.glob('**/*', File::FNM_DOTMATCH).each do |f|
next if File.directory?(f)
key = Digest::MD5.hexdigest(IO.read(f)).to_sym
@MicahElliott
MicahElliott / .gitignore
Created November 29, 2010 07:14
Python Autotest - Automatically run tests upon detecting writes to source(s).
vids
@noomerikal
noomerikal / cellcounter.rb
Created July 28, 2011 00:11
CellCounter for HBase Scan with TimeRange
=begin
Usage: /bin/hbase shell cellcounter.rb
=end
import java.text.SimpleDateFormat
import java.text.ParsePosition
import java.util.Date
import org.apache.hadoop.hbase.client.HTable
import org.apache.hadoop.hbase.client.Scan
@jtimberman
jtimberman / knife.rb
Created February 1, 2012 19:33
Commented knife.rb for all the things
# Knife Configuration File.
#
# This is a Ruby DSL to set configuration parameters for Knife's
# general options. The default location for this file is
# ~/.chef/knife.rb. If multiple Chef repositories are used,
# per-repository configuration files can be created. A per repository
# configuration file must be .chef/knife.rb in the base directory of
# the Chef repository. For example,
#
# ~/Development/chef-repo/.chef/knife.rb
@wedtm
wedtm / mcquery.rb
Created February 29, 2012 11:04
MCQuery - Minecraft Query Implementation in Ruby
require 'socket'
require 'timeout'
class MCQuery
MAGIC_PREFIX = "\xFE\xFD"
PACKET_TYPE_CHALLENGE = "\x09"
PACKET_TYPE_QUERY = "\x00"
ID = "\x00\x00\x00\x00"
DEFAULTS = {
host: "localhost",
@l15n
l15n / git-branches-by-commit-date.sh
Created July 13, 2012 08:47 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit's author and author date for each branch. Sort by most recent commit's author date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r
@mguymon
mguymon / Gemfile
Created February 28, 2013 17:27
MRI and JRuby friendly Rails Gemfile
source 'https://rubygems.org'
gem 'rails', '~> 3.2.12'
gem "figaro", '~> 0.5.3'
gem 'inherited_resources'
# Upload
gem "paperclip" , '~> 3.4.0'
gem 'paperclip-ffmpeg', '~> 0.9.4'
gem 'aws-sdk', '~> 1.8.2'
@brianteachman
brianteachman / python-nmap_example.py
Created March 7, 2013 18:57
Quick port scan script in python using python-nmap.
# http://xael.org/norman/python/python-nmap
# lets check for common ports using nmap
import nmap
nmScan = nmap.PortScanner()
nmScan.scan('127.0.0.1', '0-1023')
for port in nmScan['127.0.0.1']['tcp']:
thisDict = nmScan['127.0.0.1']['tcp'][port]
print 'Port ' + str(port) + ': ' + thisDict['product'] + ', v' + thisDict['version']
@relaxdiego
relaxdiego / graphite.md
Last active January 5, 2022 09:07 — forked from surjikal/graphite.md
Installing Graphite in OS X Mavericks

Follow these steps to install graphite on OS X Mavericks.

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Install dependencies

Install Cairo and friends

@glinton
glinton / smart-pub.md
Last active September 1, 2023 04:34
SmartOS zone manipulation. Snapshot, image, rollback, and migrate.

SmartOS Zone Manipulation

Notes on snapshots, images, and migrations

Create Zone/KVM

# Create zone
vmadm create <<EOL
{
 "brand": "joyent",
 .