Skip to content

Instantly share code, notes, and snippets.

View bewie's full-sized avatar
:shipit:

laurent apollis bewie

:shipit:
  • Montpellier, France
View GitHub Profile
#!/bin/sh
OPTIONS=`vagrant ssh-config | awk -v ORS=' ' '{print "-o " $1 "=" $2}'`
scp ${OPTIONS} "$@" || echo "Transfer failed. Did you use 'default:' as the target?"
@bewie
bewie / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@bewie
bewie / convert_hash_to_ini.erb
Last active August 29, 2015 14:15
simple def to convert hash into ini file with pupet erb.
<%-
# Function to make a structured and sorted .ini representation out of a hash
def recursive_hash_to_ini(hash, depth=0)
hash.keys.sort.each do |sorted_key|
if hash[sorted_key].is_a?(Array)
@ini_string += "\n"
hash[sorted_key].each do |item|
@ini_string += sorted_key + '=' + item +"\n"
end

Keybase proof

I hereby claim:

  • I am bewie on github.
  • I am bewie (https://keybase.io/bewie) on keybase.
  • I have a public key whose fingerprint is EF37 DE64 AAB1 3651 78CC D3AF 56C0 9287 86BD 03F5

To claim this, I am signing this object:

-module(elasticsearch).
-export([autocomplete/1, autocomplete/0,
search/1, search/0,
start/0,
stop/0,
loop/1]).
-on_load(start/0).
%% Return an autocomplete request
autocomplete() ->