Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sbower on github.
  • I am sbower (https://keybase.io/sbower) on keybase.
  • I have a public key ASCbY7bY0K8KJRg-NFMrprNRVPiPhFQEt9dMMwOzo3buEAo

To claim this, I am signing this object:

@sbower
sbower / dpush.rb
Last active June 26, 2016 21:39
Script to auto create DTR repository before pushing an image
#!/usr/bin/env ruby
require 'json'
require 'net/http'
require 'net/https'
def rest_call (registry, path, verb = "get", post_data = "")
http = Net::HTTP.new(registry, 443)
client = Savon::Client.new do
# This can be a URL also
wsdl.document = "/Path/to/your.wsdl"
# These are optional, only if your WSDL sucks :)
wsdl.endpoint = "https://your_endpoint"
wsdl.namespace = "http://your_namespace"
certs = Akami::WSSE::Certs.new :cert_file => "/path/to/cert.crt", :private_key_file => "/path/to/private/key.pem", :private_key_password => "password"
wsse.sign_with = Akami::WSSE::Signature.new certs
@sbower
sbower / mysql2sqlite.sh
Last active February 18, 2019 09:35 — forked from esperlu/mysql2sqlite.sh
Quick edit to account for cases with lines after KEY statements, for examples constraints.
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@sbower
sbower / gist:1387861
Created November 23, 2011 04:06
wiked_pdf initializer
WickedPdf.config = {
:exe_path => "#{Rails.root}/bin/wkhtmltopdf-amd64"
}