Skip to content

Instantly share code, notes, and snippets.

View vcastellm's full-sized avatar

Victor Castell vcastellm

View GitHub Profile
### Keybase proof
I hereby claim:
* I am vcastellm on github.
* I am victorcastell (https://keybase.io/victorcastell) on keybase.
* I have a public key ASBxju6ytZGthBfN-zEZImvR9FEANVxqY9I840B6JHYtFAo
To claim this, I am signing this object:
@vcastellm
vcastellm / docker-compose.yml
Last active December 6, 2017 17:12
docker compose for ecs-cli
version: '2'
services:
memcached:
image: memcached
app:
image: user/app
environment:
RAILS_ENV: development
@vcastellm
vcastellm / ecs-run
Last active April 15, 2024 17:55
Run task and wait for result in AWS ECS
#!/usr/bin/env bash
set -e
function usage() {
set -e
cat <<EOM
##### ecs-run #####
Simple script for running tasks on Amazon Elastic Container Service
One of the following is required:
Required arguments:
@vcastellm
vcastellm / keybase.md
Last active September 20, 2019 13:59

Keybase proof

I hereby claim:

  • I am victorcoder on github.
  • I am victorcastell (https://keybase.io/victorcastell) on keybase.
  • I have a public key whose fingerprint is 5532 3F21 68BE AE47 9DDD A628 43D8 05C6 C07F 0AF5

To claim this, I am signing this object:

[ 2.722856] [00003603] libusb: debug [handle_events] caught a fish on the event pipe
[ 2.722859] [00003603] libusb: debug [darwin_handle_transfer_completion] handling isoc completion with kernel status -536870165
[ 2.722863] [00003603] libusb: debug [usbi_handle_transfer_completion] transfer 0x7fdd0c05fec8 has callback 0x10a74f5f9
Got cancelled transfer, but we didn't request it - device disconnected?
[ 2.722869] [00003603] libusb: debug [darwin_handle_transfer_completion] handling isoc completion with kernel status -536870165
[ 2.722873] [00003603] libusb: debug [usbi_handle_transfer_completion] transfer 0x7fdd0c0606c8 has callback 0x10a74f5f9
[ 2.723184] [00003603] libusb: debug [darwin_handle_transfer_completion] handling isoc completion with kernel status -536870165
[ 2.723203] [00003603] libusb: debug [usbi_handle_transfer_completion] transfer 0x7fdd0a84fcc8 has callback 0x10a74f5f9
[ 2.723209] [00003603] libusb: debug [darwin_handle_transfer_completion] handling isoc completion with kernel status -53687
@vcastellm
vcastellm / haproxy.lua
Last active January 8, 2022 17:22
Heka haproxy lua decoder
local dt = require "date_time"
local ip = require "ip_address"
local l = require 'lpeg'
local syslog = require "syslog"
l.locale(l)
local msg = {
Timestamp = nil,
Hostname = nil,
Payload = nil,
set :unicorn_binary, "/usr/local/bin/unicorn"
set(:unicorn_config) { "#{current_path}/config/unicorn.rb" }
set(:unicorn_pid) { "#{deploy_to}/shared/pids/unicorn.pid" }
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{default_stage} -D"
end
task :stop, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} kill `cat #{unicorn_pid}`"
@vcastellm
vcastellm / fib.go
Created October 3, 2011 15:30
Fibonacci Go
package main
import (
"fmt"
"net/http"
"log"
)
func fibonacci(n int) int {
var result int
@vcastellm
vcastellm / post-receive
Created September 8, 2011 10:45
Simple production git deploy
#!/bin/bash
cd ..
GIT_DIR='.git'
umask 002 && git reset --hard
@vcastellm
vcastellm / gitignore
Created March 18, 2011 12:32
Ignore defaults for Drupal
sites/default/tmp/*
sites/default/files/tmp/*
sites/default/files/*
sites/default/files/js/*
sites/default/files/css/*
sites/default/files/languages/*
sites/default/files/imagecache/*
sites/default/files/imagefield_thumbs/*
sites/default/files/imagefield_default_images/*