Skip to content

Instantly share code, notes, and snippets.

View beathyate's full-sized avatar

Gustavo Beathyate beathyate

View GitHub Profile
@septerr
septerr / Rails Base64 encoded HMAC-SHA1
Last active June 17, 2016 06:31
Base64 encoded HMAC-SHA1 in iOS and Rails
secret = "xxx"
data = "http://someurl?someparams"
hmac = OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), secret.encode("ASCII"), data.encode("ASCII"))
signature = Base64.encode64(hmac).chomp
@jeffjohnson9046
jeffjohnson9046 / ruby-ldap-sample.rb
Last active January 5, 2024 07:11
Some VERY basic LDAP interaction in Ruby using Net::LDAP.
#######################################################################################################################
# This Gist is some crib notes/tests/practice/whatever for talking to Active Directory via LDAP. The (surprisingly
# helpful) documentation for Net::LDAP can be found here: http://net-ldap.rubyforge.org/Net/LDAP.html
#######################################################################################################################
require 'rubygems'
require 'net/ldap'
#######################################################################################################################
# HELPER/UTILITY METHOD