Skip to content

Instantly share code, notes, and snippets.

@denji
denji / golang-tls.md
Last active March 29, 2024 03:03 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@reidransom
reidransom / gist:6042016
Created July 19, 2013 20:13
Auto-starting VirtualBox VMs on OS X

Auto-starting VirtualBox VMs on OS X

After finding a lot of other posts on the topic that didn't work out for me this one did the trick so I'm reposting for my own sense of self preservation.

Link to original article.

Copy the Virtualbox autostart plist template file to your system's LaunchDaemons folder.

sudo cp \

/Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.plist \

@tarcieri
tarcieri / gist:5483325
Last active December 16, 2015 19:10
The DHH Drinking Game

The @dhh Drinking Game

Take a drink whenever @dhh:

  1. Drops the f-bomb (or says "shit")
  2. Makes fun of Java (or Struts, Hibernate, etc)
  3. Mentions "frameworks should be extractions, not inventions"
  4. Mentions "constraints are liberating"
  5. Defends TurboLinks or the asset pipeline
  6. Mentions Basecamp
@mfojtik
mfojtik / sinatra_slices_example.rb
Created January 7, 2013 21:13
An example of 'slices' implementation in 37 lines of pure Sinatra.
require 'sinatra/base'
module Sinatra
module Slice
def self.prefix_routes(middleware)
prefix = prefix_from(middleware)
middleware.instance_eval {
@routes.each do |http_method, _|
@routes[http_method].each_with_index do |route, index|
@yaplik
yaplik / Gemfile
Created December 14, 2012 18:35
Example SMTP Server for PV249
source :rubygems
gem "eventmachine"
anonymous
anonymous / telnet.rb
Created December 14, 2012 18:09
require 'socket';s=TCPSocket.new(ARGV[0], Integer(ARGV[1]));begin loop {s.puts($stdin.gets)}; rescue Exception => e; end
@frbayart
frbayart / virt-manager_run.py
Created June 23, 2012 13:45
virt-manager on MACOSX
MBA-FBA:bin francois$ ./virt-manager
RuntimeWarning: tp_compare didn't return -1 or -2 for exception
RuntimeWarning: tp_compare didn't return -1 or -2 for exception
Traceback (most recent call last):
File "/Users/francois/bin/mybuild/share/virt-manager/virt-manager.py", line 393, in <module>
_show_startup_error(str(run_e), "".join(traceback.format_exc()))
File "/Users/francois/bin/mybuild/share/virt-manager/virt-manager.py", line 63, in _show_startup_error
from virtManager.error import vmmErrorDialog
File "/Users/francois/bin/mybuild/share/virt-manager/virtManager/error.py", line 173, in <module>
class _errorDialog (gtk.MessageDialog):
@tobyhede
tobyhede / postsql.sql
Created May 17, 2012 03:08
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--