Skip to content

Instantly share code, notes, and snippets.

View outman's full-sized avatar
💭
I may be slow to respond.

outman

💭
I may be slow to respond.
  • Beijing, China
View GitHub Profile
@neomantra
neomantra / gethostbyname.lua
Created September 25, 2013 20:25
Exercising gethostbyname with LuaJIT FFI
#!/usr/bin/luajit
local ffi = require 'ffi'
ffi.cdef([[
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)