Skip to content

Instantly share code, notes, and snippets.

View mcg's full-sized avatar

Matthew Gregg mcg

  • Modern Message
  • Summerville SC
View GitHub Profile
@jannikolai
jannikolai / convert_enpass_to_keepass.rb
Created July 16, 2014 09:52
Ruby script to migrate Enpass to KeePass
# Converts the Export of Enpass to a format readable by KeePass
#
# This file is not heavily tested but worked for me in most cases. Of course
# some manual steps to regroup and edit the entries had to be done afterwards
#
# Exported with Enpass 4.0.1: File > Export > TXT
# ruby convert_enpass_to_keepass.rb FILENAME.txt > OUTPUT.xml
# Imported with KeePassX 0.4.3: File > Import from ... > KeePassX XML (*.xml)
require 'set'
@tadast
tadast / ssl_puma.sh
Last active January 29, 2024 04:41 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@prwhite
prwhite / Makefile
Last active May 16, 2024 05:50
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@mmrobins
mmrobins / gist:7089011
Created October 21, 2013 18:56
Finding graphite stats abuse
% curl http://graphite.livingsocial.net/metrics/index.json > graphite_stats_names.json
% irb
1.9.3-p448 :001 > require 'json'
=> true
1.9.3-p448 :002 > pp JSON.parse(File.read("graphite_stats_names.json")).group_by {|g| g.match(/[^\.]+\.[^\.]+\.[^\.]+/).to_s}.map {|k, v| [k, v.size]}.sort_by {|s| s[1]}[-30..-1]
[["stats.timers.browse", 714],
["stats.pipeline.mark_live", 804],
["stats_counts.pipeline.mark_live", 804],
["livingsocial.mailing.pmta", 837],
["stats.timers.canopy", 897],
@teohm
teohm / sshd_config
Created August 15, 2013 09:18
to prevent long running capistrano from ssh connection timeout
# sudo vi /etc/ssh/sshd_config
ClientAliveInterval 18
ClientAliveCountMax 100
# sudo service ssh restart
# exit
@jeekl
jeekl / gist:5083506
Created March 4, 2013 16:30
git update-hook script for checking versions of cookbooks and rejecting on non version bump
#!/usr/bin/env ruby
# Compares semantic versions of cookbooks, by looking at the metadata.rb file and
# rejects pushes if the cookbook version has not been bumped. If running this
# script from another script, remeber to pass along the parameters to this
# script.
#
# Requires a gem install semantic.
require 'rubygems'
require 'semantic'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@protocool
protocool / caveatPatchor.js
Created February 14, 2011 02:29
Sample caveatPatchor.js file for use in Propane 1.1.2 and above
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@dabrahams
dabrahams / gravatar.el
Created October 12, 2010 14:49 — forked from znz/gnus-gravatar.el
Improved gravatar handling for wanderlust (maybe should push some of it up to gravatar.el?)
;;; gravatar.el --- Get Gravatars
;; Copyright (C) 2010 Free Software Foundation, Inc.
;; Author: Julien Danjou <julien@danjou.info>
;; Keywords: news
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify