Skip to content

Instantly share code, notes, and snippets.

View vcastellm's full-sized avatar

Victor Castell vcastellm

View GitHub Profile
@vcastellm
vcastellm / git_deploy.sh
Created August 31, 2010 11:59
Git auto update hook for web deployment
echo "Enter an existing repository name:"
read REPONAME
cd /home/git/repositories/$REPONAME.git
echo "Configuring bare git repo..."
git --bare update-server-info
git config core.bare false
git config receive.denycurrentbranch ignore
git config core.worktree /var/www/$REPONAME
mkdir /var/www/$REPONAME
Rails CMS alternatives
======================
Note: project activity was checked on 11/26/09 for most of these projects, and the "last update" field has not been kept up to date since then.
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
@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/*
@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 / 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
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 / 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,
[ 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 / 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:

@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: