Skip to content

Instantly share code, notes, and snippets.

View taqtiqa-mark's full-sized avatar

Mark Van de Vyver taqtiqa-mark

View GitHub Profile
@taqtiqa-mark
taqtiqa-mark / happy-birthday-taqtiqa.txt
Created April 11, 2012 04:50
Happy birthday TAQTIQA!
Happy Birthday to you.
Happy Birthday to you.
Happy Birthday dear TAQTIQA.
Happy Birthday to you!
@taqtiqa-mark
taqtiqa-mark / failing_any_instance_spec.rb
Created November 25, 2012 03:07
rspec-mocks issue #198
class ::Cli
def start
::Api.new(self)
end
end
class ::Api
end
describe ::Cli do
@taqtiqa-mark
taqtiqa-mark / temporary_dsl.rb
Created December 2, 2012 07:48 — forked from sparkertime/temporary_dsl.rb
A Ruby 1.9 DSL strategy
# An unintrusive, temporary DSL strategy.
#
# Why discusses Ruby DSLs and instance_eval vs. block arguments:
# http://hackety.org/2008/10/06/mixingOurWayOutOfInstanceEval.html
#
# This takes advantage of some Ruby 1.9 features to implement a DSL mixin that
# is temporary and doesn't override locally defined methods.
class DslInstance
attr_accessor :script
# This is a code example for the Ruby HTTP library Typhoeus
# here's an example for twitter search
# Including Typhoeus adds http methods like get, put, post, and delete.
# What's more interesting though is the stuff to build up what I call
# remote_methods.
class Twitter
include Typhoeus
remote_defaults :on_success => lambda {|response| JSON.parse(response.body)},
:on_failure => lambda {|response| puts "error code: #{response.code}"},
BUNDLE_BIN: .bundle/bin
BUNDLE_SHEBANG: ruby-local-exec
BUNDLE_DISABLE_SHARED_GEMS: '1'
BUNDLE_PATH: vendor
@taqtiqa-mark
taqtiqa-mark / traceroute.txt
Created January 4, 2013 01:50
traceroute when AWS CF distribution is inaccessible.
Every 0.1s: traceroute www.cookbooks.io. Fri Jan 4 12:45:35 2013
traceroute to www.cookbooks.io. (54.240.176.220), 30 hops max, 60 byte packets
1 192.168.1.1 (192.168.1.1) 2.170 ms 2.693 ms 3.721 ms
2 10.1.1.1 (10.1.1.1) 3.922 ms 4.627 ms 4.852 ms
3 nexthop.nsw.iinet.net.au (203.215.19.247) 19.622 ms 19.895 ms 21.551 ms
4 te1-1.syd-mas-bdr2.iinet.net.au (203.215.18.20) 22.949 ms te1-1.syd-mas-bdr1.iinet.net.au (203.215.18.18) 27.372 ms 27.608 ms
5 xe-1-1-0-0.syd-mas-core1.iinet.net.au (203.215.20.94) 28.053 ms 29.516 ms te1-2.syd-mas-bdr1.iinet.net.au (203.215.20.153) 31.803 ms
6 xe-1-1-0-0.syd-mas-core1.iinet.net.au (203.215.20.94) 32.698 ms te7-0-0.bdr1.syd4.internode.on.net (150.101.197.189) 19.010 ms xe-1-1-0-0.syd-mas-core1.iinet.net.au (203.215.20.94) 71.439 ms
7 gi7-0-0-100.bdr1.syd4.internode.on.net (150.101.197.153) 18.504 ms 21.391 ms 22.368 ms
@taqtiqa-mark
taqtiqa-mark / install.sh
Last active December 11, 2015 06:48 — forked from kysnm/install.sh
ubuntu lucid: install tmux 1.7
#!/usr/bin/env bash
export TMUX_INSTALL_VERSION=1.6
wget -q -O - "https://gist.github.com/raw/4561674/install_tmux_${TMUX_INSTALL_VERSION}_on_ubuntu_10.04.sh" | sudo bash
@taqtiqa-mark
taqtiqa-mark / ...headless.rb
Last active December 11, 2015 23:29
Config DSL example use case (Vagrant)
vm.customize do |cvm|
cvm.memory_size = 1024
cvm.vram_size = 12
cvm.cpu_count = 2
cvm.accelerate_3d_enabled = false
cvm.accelerate_2d_video_enabled = false
cvm.monitor_count = 1
cvm.bios.acpi_enabled = true
cvm.bios.io_apic_enabled = false
@taqtiqa-mark
taqtiqa-mark / gist:9bb2f807f2f607bdb2e1402a59370eeb
Created January 29, 2020 20:25 — forked from so0k/gist:cdd24d0a4ad92014a1bc
droplet discovery over digitalocean private networks

Digital Ocean recently released private networking support in their NYC2 Data center.

They also published a blog post on how to setup a new droplet with private networking. But one thing the post doesn't do is tell you how to scale your private network for many boxes. One approach is obviously to edit /etc/hosts (but this gets annoying when you add a new box). A better way is to create an internal DNS zone (via the digital ocean web interface) and have your droplets use it:

Steps

setup the internal DNS zone file

  1. Login to digital ocean
  2. Click "DNS" on the right hand menu
@taqtiqa-mark
taqtiqa-mark / gist:7d301f7ab6fcef1987dd6b34f8803819
Created January 29, 2020 20:26
droplet discovery over digitalocean private networks

Digital Ocean recently released private networking support in their NYC2 Data center.

They also published a blog post on how to setup a new droplet with private networking. But one thing the post doesn't do is tell you how to scale your private network for many boxes. One approach is obviously to edit /etc/hosts (but this gets annoying when you add a new box). A better way is to create an internal DNS zone (via the digital ocean web interface) and have your droplets use it:

Steps

setup the internal DNS zone file

  1. Login to digital ocean
  2. Click "DNS" on the right hand menu