2014-09-06

Vagrantfile (this is just a bookmark)

This is my (thank you Abel) current Vagrantfile to quickly create a number of servers with two extra disks and three extra network cards:

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
 config.vm.provider :virtualbox do |vb|
  vb.customize ["storagectl", :id, "--add", "sata", "--name", "SATA" , "--portcount", 2, "--hostiocache", "on"]
 end
 (1..3).each do |i|
  config.vm.define "server#{i}" do |node|
   node.vm.hostname = "server#{i}"
   node.vm.box = "hfm4/centos7"
   config.vm.box_check_update = true
   node.vm.network :public_network, ip: "10.1.1.#{i}", netmask: '255.255.255.0'
   node.vm.network :public_network, ip: "10.1.2.#{i}", netmask: '255.255.255.0'
   node.vm.network :public_network, ip: "10.1.3.#{i}", netmask: '255.255.255.0'
   config.vm.provider "virtualbox" do |v|
    v.name = "server#{i}"
    v.memory = 512
    v.cpus = 1
    v.customize ['createhd', '--filename', "server_#{i}a.vdi", '--size', 8192 ]
    v.customize ['createhd', '--filename', "server_#{i}b.vdi", '--size', 8192 ]
    v.customize ['storageattach', :id, '--storagectl', 'SATA', '--port', 1, '--device', 0, \
'--type', 'hdd', '--medium', "./server_#{i}a.vdi"]
    v.customize ['storageattach', :id, '--storagectl', 'SATA', '--port', 2, '--device', 0, \
'--type', 'hdd', '--medium', "./server_#{i}b.vdi"]
   end
  end
 end
end


2014-05-19

Reserved DNS TLD's .invalid ?

I (wrongly) assumed that using a .local domain would never bother the root dns servers. It does (about 1500 q/sec).

So I read the relevant rfc's (2606 and 6761) where it clearly states:

...caching DNS servers SHOULD, by
default, generate immediate negative responses for all such
queries.  This is to avoid unnecessary load on the root name
servers and other name servers...
 
So I did a small test with the most recent bind9 in Debian as a caching only server, and it turns out it sends .local .localhost .example and .invalid to the root name servers ?! Only .test has an immediate response.


root@debian7:~# tcpdump port 53 -l | grep NX &
[1] 5699
root@debian7:~# tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes

root@debian7:~# nslookup
> server 127.0.0.1
Default server: 127.0.0.1
Address: 127.0.0.1#53
> linux-training.local
09:22:15.932194 IP f.root-servers.net.domain > 10.0.2.15.46669: 49328 NXDomain*- 0/6/1 (656)
09:22:15.997731 IP j.root-servers.net.domain > 10.0.2.15.47262: 43556 NXDomain*- 0/6/1 (669)
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find linux-training.local: NXDOMAIN
> linux-training.localhost
09:22:23.099452 IP e.root-servers.net.domain > 10.0.2.15.60696: 22464 NXDomain*- 0/6/1 (673)
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find linux-training.localhost: NXDOMAIN
> linux-training.test
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find linux-training.test: NXDOMAIN
> linux-training.example
09:22:42.124036 IP e.root-servers.net.domain > 10.0.2.15.7293: 8476 NXDomain*- 0/6/1 (661)
09:22:42.141847 IP e.root-servers.net.domain > 10.0.2.15.15481: 31139 NXDomain*- 0/6/1 (671)
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find linux-training.example: NXDOMAIN
> linux-training.invalid
09:22:49.660427 IP e.root-servers.net.domain > 10.0.2.15.60321: 15655 NXDomain*- 0/6/1 (671)
09:22:49.753120 IP l.root-servers.net.domain > 10.0.2.15.63563: 48281 NXDomain*- 0/6/1 (671)
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find linux-training.invalid: NXDOMAIN


So I visit the root dns server stats and notice the top queries (in queries/second):

1 .com 3500
2 .net 2500
3 .local 1400
4 . 1100
5 .home 1100
6. (.com base 64)
7 .org 400
8. .belkin 300

The top five queries for BRU01 (a Belgian root name server) are a surprise:

1 .home 240
2 .localhost 53
3 .local 50
4 .com 19
5 .ru 12

(.be is negligible with 0.4 queries/second)


cheers,
paul

2014-05-16

Coffee or Tea ? Yes!

When people ask me:
"Do you want coffee or tea?" (*)
Then I answer:
"Yes."

... and most assume that I want to be funny, but I don't. I just don't care which of the two (coffee or tea) you give me, I am happy with both.

Turns out I am a hacker.

(*) Do you want spaghetti or rice ? Yes!
(*) Leffe or Chimay ? Yes!
(*) Can I see you tonight or tomorrow ? Yes!


It gets worse when questions contain all possible actions:
(*) Should I stay or should I go?
(*) Can I keep the book or do you want it back ?
(*) With or without sugar ?
 You just gave me all possible options ?! What kind of trickery questions are these ?!

;-)

2014-04-19

Vagrant: Creating 10 vm's with 6 disks each

Hello lazyweb,

the Vagrantfile below works fine, but can probably be written simpler. I've been struggling to create variables like "servers=10" and "disks=6" to automate creation of 10 servers with 6 disks each.

Drop me a hint if you feel like creating those two loops.


paul@retinad:~/vagrant$ cat Vagrantfile
hosts = [ { name: 'server1', disk1: './server1disk1.vdi', disk2: 'server1disk2.vdi' },
          { name: 'server2', disk1: './server2disk1.vdi', disk2: 'server2disk2.vdi' },
          { name: 'server3', disk1: './server3disk1.vdi', disk2: 'server3disk2.vdi' }]

Vagrant.configure("2") do |config|

  config.vm.provider :virtualbox do |vb|
   vb.customize ["storagectl", :id, "--add", "sata", "--name", "SATA" , "--portcount", 2, "--hostiocache", "on"]
  end

  hosts.each do |host|

    config.vm.define host[:name] do |node|
      node.vm.hostname = host[:name]
      node.vm.box = "chef/centos-6.5"
      node.vm.network :public_network
      node.vm.synced_folder "/srv/data", "/data"
      node.vm.provider :virtualbox do |vb|
        vb.name = host[:name]
        vb.customize ['createhd', '--filename', host[:disk1], '--size', 2 * 1024]
        vb.customize ['createhd', '--filename', host[:disk2], '--size', 2 * 1024]
        vb.customize ['storageattach', :id, '--storagectl', "SATA", '--port', 1, '--device', 0, '--type', 'hdd', '--medium', host[:disk1] ]
        vb.customize ['storageattach', :id, '--storagectl', "SATA", '--port', 2, '--device', 0, '--type', 'hdd', '--medium', host[:disk2] ]
      end
    end

  end

end

2014-01-15

The grand Windows vs Linux fight

A lot of muggles are convinced there is some big battle going on between Microsoft and Linux. They are wrong.

Truth is that only a minority of very noisy wannabe-Linux users see this as a fight. I imagine this loud minority as people who once installed Ubuntu but actually spend most of their time playing games on Windows.

The reality is that most organizations use Microsoft on the Desktop and a lot of them also have one or more products like MS Active Directory, MS Exchange or MS Sharepoint.

But every other computer runs a form of Unix, very often this is Linux:
- the millions of servers from Facebook, Google, Twitter, ...
- millions of DSL modems
- more than a billion Android phones
- 98 percent of the 500 largest supercomputers in the world
- Lego robots
- space station laptops
- (in Belgium specifically stuff like the bbox and digibox etc)
- tablets, routers, firewalls, NAS devices (aka "external harddisks"), stock exchanges, radar control, gps navigation and much more

There was no battle, there is no fight, there will never be a Linux vs Windows. They are just different things, Microsoft is used for end user intranet, Linux for servers and all other devices.

(*) Sure there is also iPad, iPhone and Mac, I know that.

2013-11-04

nieuwe laptop kopen ?

Ik zou een nieuwe laptop willen kopen, graag advies:
- moet uiteraard Debian kunnen draaien zonder proprietary binary drivers (dus radeon hd?)
- liefst zonder Microsoft of Apple tax
- kleine harde schijf (ik gebruik amper 50GB)
- rond de 8GB ram
- snelle cpu i5 of i7
- maar wil vooral dus dat Debian er op werkt...
- us qwerty!

Ik was tevreden over de macbook pros die ik heb, maar vind online amper informatie over Debian op die retina Macbook Pro.

Heel wat laptops komen met Intel hd 4000 video, werkt die vlot onder Linux ?

Zou je vandaag nog Lenovo Thinkpad aanraden ? Zo ja welke ?


2013-08-14

independent Raspberry Pi

The Raspberry Pi is great, but by default it needs usb for power and utp for network.

Luckily there is the Smart Power Base to provide power and the Netgear (I use the wna1100 for obvious reasons) for wireless, both making the Pi a lot more independent.