Skip to content

Instantly share code, notes, and snippets.

View avanderberg's full-sized avatar

Alexander van der Berg avanderberg

View GitHub Profile
@avanderberg
avanderberg / a.md
Created June 29, 2012 20:55 — forked from rkh/a.md
Video streaming services outside of the US from your Mac

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Netflix
  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
@avanderberg
avanderberg / customs.txt
Created May 4, 2012 14:36 — forked from felixge/customs.txt
"Postverzollung" is a magic word that makes the difference between a 3 hour journey to the customs office or a simple E-Mail to it.
When you get a card from the customs office (because a package you've been sent has no invoice on the outside), you just e-mail them the nr. that is on the card, tell them what is inside the packet, and ask them for "Postverzollung". This usually means they just give the packet back to DHL and it's delivered to you. No need to pick it up from their location and waste time with that.
http://twitter.com/#!/felixge/status/198382135915200512
@avanderberg
avanderberg / command.sh
Created October 29, 2011 16:32 — forked from felixge/command.sh
Bash stuff for fighting a weak DOS attack
# Here a few bash one-liners that helped me analyze / fight a weak DOS attack against debuggable.com. Mostly for future reference.
# The attacker was opening lots of tcp connections without sending data, I believe it's called a SYN flood, see: http://tools.ietf.org/html/rfc4987#section-3.2
# Step 0: Check what is going on at port 80
$ netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c
# Step 1: Increase the number of available fds
$ ulimit -n 32000
# Step 2: Restart your webserver, for me:
@avanderberg
avanderberg / Felixge_Faves.md
Created April 7, 2011 17:27 — forked from billdawson/Felixge_Faves.md
Felix Geisendörfer's (@felixge) faves, and what he said about them in his tweets of 07 April 2011

Felix Geisendörfer's (@felixge) faves, and what he said about them in his tweets of 07 April 2011:

I really wonder how I was able to use Terminal app all this time. iTerm2 is so much better, it hurts. (#)

If you find yourself arranging windows with your mouse on osx,

@avanderberg
avanderberg / capybara_helper.rb
Created March 1, 2011 11:16 — forked from testobsessed/capybara_helper.rb
Check if element is invisible with Capybara
def element_visible?(element_id)
# does the element exist?
exists = page.has_css?(element_id)
# is the element itself hidden with the .ui-helper-hidden class?
self_hidden = page.has_css?("#{element_id}.ui-helper-hidden")
# is the parent of the element hidden, thus hiding the element?
parent_hidden = page.has_css?(".ui-helper-hidden > #{element_id}")
@avanderberg
avanderberg / custom_steps.rb
Created June 11, 2010 19:10 — forked from thilo/custom_steps.rb
Capybara and subdomains
Given /^I visit subdomain "(.+)"$/ do |sub|
#host! "#{sub}.example.com" #for webrat
Capybara.default_host = "#{sub}.example.com" #for Rack::Test
Capybara.app_host = "http://#{sub}.example.com:9887" if Capybara.current_driver == :culerity
################################################################################
# As far as I know, you have to put all the {sub}.example.com entries that you're
# using in your /etc/hosts file for the Culerity tests. This didn't seem to be
# required for Rack::Test
################################################################################
@avanderberg
avanderberg / patiently.rb
Created June 11, 2010 18:59 — forked from langalex/patiently.rb
retry wrapper for cucumber steps
def patiently(&block)
cycles = 0
begin
yield
rescue => e
cycles += 1
sleep 0.1
if cycles < 10
retry
else