Skip to content

Instantly share code, notes, and snippets.

BEGIN MESSAGE.
MowtrE0TEzcJUA2 gDzj5E16YhRa58G 2CBD7pDNbVK82XM zQ1G3gvScim5S7W
tHxW7Nczr74V67T nFcpLu8mCTNTCKq 6Xr2MZHgg6jbS63 r6WL9bSJklybxpq
0wqSz9tZFCQ6fqu AyuLKsFesbwkdVw RT93pR3ORF6M8GW BTy5T0w6ZPSF12r
l5J4qWp9uc3gukk svGmJ68YaWwk0ko bhRF.
END MESSAGE.
@sl4m
sl4m / ffmpeg.md
Created October 11, 2019 18:48 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@sl4m
sl4m / saml.md
Created December 13, 2016 09:44 — forked from perigee/saml.md

Top references

SAML2 Notes


SAML2.0 is an XML based portocol using security tokens containing assertions to pass information about a principal (ex. end user) between a SAML authority (Idp-Identity provider, for planet labs, it is MS ADFS 2012 R2), and a SAML consumer (SP-service provider, for example, plotly On-Prem side authentication). The standrad was ratified as an OASIS standard in 03/2005, which eventually may be replaced by Oauth2 based OpenID.

@sl4m
sl4m / Readme.md
Created December 30, 2015 08:39 — forked from JoshCheek/Readme.md
Typing game 2

Keybase proof

I hereby claim:

  • I am sl4m on github.
  • I am skim (https://keybase.io/skim) on keybase.
  • I have a public key whose fingerprint is EA0E 259C B4B4 A1F4 A959 E839 2574 4DCC 3A0C EF66

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am sl4m on github.
  • I am skim (https://keybase.io/skim) on keybase.
  • I have a public key whose fingerprint is 1969 1388 9423 B407 6EFD ED76 731A 9DF5 5732 A0C8

To claim this, I am signing this object:

The reason why you might get certificate errors in Ruby 2.0 when talking HTTPS is because there isn't a default certificate bundle that OpenSSL (which was used when building Ruby) trusts.

Update: this problem is solved in edge versions of rbenv and RVM.

$ ruby -rnet/https -e "Net::HTTP.get URI('https://github.com')"
net/http.rb:917:in `connect': SSL_connect returned=1 errno=0 state=SSLv3
  read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

You can work around the issue by installing a certificate bundle that you trust. I trust Mozilla and curl.

# define a method to run rake tasks
def run_rake(task, options={}, &block)
rake = fetch(:rake, 'rake')
rails_env = fetch(:rails_env, 'production')
command = "cd #{current_path} && #{rake} #{task} RAILS_ENV=#{rails_env}"
run(command, options, &block)
end
#
# Halftoneapp.com Sample Bluepill Configuration File
# Read more at: http://blog.halftoneapp.com
#
# Set paths
home_dir = "/home/railsapp"
rails_shared = "#{home_dir}/app/shared"
unicorn_path = "/path/to/unicorn_rails"
@sl4m
sl4m / gist:5091803
Created March 5, 2013 16:57 — forked from trcarden/gist:3295935
create self-signed certificate for localhost
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key