Skip to content

Instantly share code, notes, and snippets.

View fdv's full-sized avatar
🚀
Taking over the world

Fred de Villamil fdv

🚀
Taking over the world
View GitHub Profile
@fdv
fdv / gist:8088746
Created December 22, 2013 21:39
Late 80's groove / hip hop / RnB sound that turning to awesome hip house / and even some acid house. This is the kind of music I started to listen to when I was ~ 10 that took me to the electro / house path. I never left it. Will mix everything together later on

Groovy / hip hop

  1. Joyce Sims - Come Into My Life
  2. Mantronix – got to have your love
  3. Inner City – good life
  4. Krush – house arrest
  5. Monie Love - It's a shame
  6. Inner City - Big Fun
  7. SOS Band - The Finest
  8. Patrice Rushen - Forget Me Nots
extension=apc.so
apc.enabled=1
apc.shm_size=512M
apc.rfc1867 = on
apc.max_file_size = 512m
apc.stat = 0
apc.filters = "-/path/vers/les/trucs/a/exclure/*.*"
@fdv
fdv / gist:6783032
Created October 1, 2013 18:39
Cookie clicker... sigh
repeat
tell application "Google Chrome" to tell active tab of window 1
execute javascript "document.getElementById('bigCookie').click()"
end tell
end repeat
@fdv
fdv / twitter_counter.rb
Created March 20, 2013 18:51
A quick way to get your Twitter followers counter in Ruby (designed for Rails application), with cache system and error handling.
require 'open-uri'
require 'json'
def get_twitter_counter
url = 'http://api.twitter.com/1/users/show.json?screen_name=fdevillamil'
cache = File.join(Rails.root, "tmp", "twitter_counter")
return File.read(cache) if File.exists?(cache) && (Time.now - File.mtime(cache)).to_i < 7200
begin
@fdv
fdv / gist:1591412
Created January 10, 2012 21:49
Setup ElasticSearch with 3 networks and an IPVS configuration
We had to deploy ElasticSearch in a particular environment, where our hosts would be connected to Internet and access 2 different subnets, but with some restrictions. This makes our setup somehow tricky as we need the following:
eth0: external IP, listening on the Internet. There are iptables rules blocking every connection there on ports 9200 and 9300.
eth1: RFC1918 IP address.
lo:0: a single RFC1918 address used on every node for IPVS / IPFail for load balancing and fail over purpose.
Why is this setup tricky?
1. By default, ElasticSearch will listen on eth0 if it exists and is up. Shutting down eth0 and setting it up will just break your setup. Add iptables rules and you'll really be in trouble. Using unicast and a list of IPs won't be enough to solve the issue.