Wednesday, February 2, 2011

ipv4 exhaustion

As you are hopefully aware IPv4 is on its way out and we reached a major milestone yesterday. Up until monday IANA had seven /8 subnets(that's a a bit under 17 million adresses each) left. On Tuesday APNIC requested another two, which let the number drop to the treshold agreed upon in advance on which the remaining five subnets will be distributed, one to each of the RIR's(Regional Internet Registries). That means yesterday every RIR got one last /8 Block, APNIC got three and that's it. Every IPv4 address that willl be requested once these blocks have been used up will have to come from some previous allotment.

How long will this last on the RIR level?

First you have to look at the rate with which the addresses were given out until now. As you can see the rate was about 10 /8's per year, of which only a neglegible amount was used by AFRINIC(Africa) and LACNIC(South America) (overestimate with 10%). On average RIPE(Europe) and ARIN(North America) use about equal amounts and together about as much as APNIC(Asia and Pacific) does. So that means APNIC, RIPE and ARIN will need about 4.5, 2.25 and 2.25 /8 networks over the course of next year if demand stays exactly the same.

Given that the good is becoming rarer this is unlikely as consumers will probably start hoarding. So given this increase in demand and estimating RIPE and ARIN to have a spare of about 1 /8 left over that would mean APNIC will be the first RIR to run out for good until September at the latest, shortly followed by RIPE and ARIN. LACNIC will likely run out early 2012 and AFRINIC probably will last longest given their low local demand.

What happens then?

Most likely it will be an ugly patchwork of a routing mess and a rather small bazaar for the unused parts of previous allocation that were simply to big for the organization getting them to be used up sensibly. I don't think this will scale to very small subnets since this will put too much demand on the routing infrastructure, so this market is a lot smaller than a lot of people estimate right now, although it will surely be amusing.

Apart from that there will be a rush to get IPv6 out to the public which will fail in a lot of entertaining ways and i am certain will be blamed on the short time frame that this had to be done in (a ludicrous claim that will be uttered for sure). A minor number of people will sit in the dark and wonder why a few websites won't work but overall won't notice anything wrong.

What does it mean?

PARTY! The dog days are over. Well at least to some degree I hope. I am really looking forward to what will hopefully be a global shared address space with hopefully less routing issues, NATing, masquerading and all that other fun stuff. I am sure someone will come up with some unbelievable abomination to ruin the fun but let's enjoy utopia while it lasts

If now my dorm and my work place (a scientific institution) would consider running ipv6 I'll be overjoyed.

Monday, January 17, 2011

getting Skype to work on opensuse as a user

Skype is still only provided as a 32 bit binary and that is rather upsetting, because opensuse doesn't ship libXv as a 32 bit build by default. So if it fails because of that install xorg-x11-libXv-32bit (and any other stuff it wants).

If however you aren't root, then you are a little on your own. I got it working with the following
  1. Grab a 32 bit libXv from somwehere, e.g. here
  2. Unpack it. In my case like this: rpm2cpio xorg-x11-libXv-32bit-7.5-1.8.x86_64.rpm | cpio -idmv
  3. Now push that libXv.so.1 some place sensible (I recommend ~/.local/lib)
  4. Export LD_LIBRARY_PATH="$HOME/.local/lib/" or appropriate
  5. Start skype from within the reach of that export e.g. the same shell
Steps 4 and 5 have to be redone every time, so you might as well make a script out of it
All of this can be automated of course and is just a pointer for poor souls like me that take longer than 10 minutes to figure this out.

Thursday, January 13, 2011

Tex Font Catalogue

This is a most excellent find:

http://www.tug.dk/FontCatalogue/

Saturday, January 8, 2011

Latex Wrapperclass

When you define a new class in latex you most unlikely want to start from scratch. This is of course not a problem, you can easily inherit another documentclass. Problems tend to start if you also need to react on an option of the class as well. The example shows the easiest way i know of:

\NeedsTeXFormat{LaTeX2e} 
\ProvidesClass{myartcl}[2010/01/06 This is so 2010!]
\RequirePackage[unknownkeysallowed]{keyval} 
%set up the function for finding doublesided as an argument 
\define@key{keygroup}{doublesided}[true]{% 
  % Do whatever you need to here 
  \PackageWarning{myartcl}{Found doublesided #1}% 
} 
% and we pass it on to the keyval parsing algo 
\DeclareOption*{% 
  \edef\act{\noexpand\setkeys{keygroup}{\CurrentOption}}\act% 
  \PassOptionsToClass{\CurrentOption}{article}% 
} 
\ProcessOptions\relax 
\LoadClass{article} 

Saturday, January 1, 2011

Optional Arguments in Latex Functions, Style and Class Files

I just wrote my first own latex package and as usual i was rather aiming for the stars than KISS.
The last big issue was finding out how to have optional package arguments that take a value (think geometry's left).

First: 
How to have functions with more than one optional argument or named optional arguments: Turns out not to be too complicated in the end. First you need the package keyval which enables you to parse key=value style arguments and then you need to understand how it works (the doc is aweful imho). Set up your parsing functions with something like

\define@key{keygroup}{keyname}{\dostuff{#1}}

this defines an option keyname that takes an argument, that has to be provided if the key is used.
Example: 
\define@key{keygroup}{color}{\domorestuff{#1}}

You can also define an optional argument that has an optional value that gets used when none is provided with the following syntax

\define@key{keygroup}{keyname}[default]{\dostuff{#1}}

 This lets you for example define a length type argument like follows:

\define@key{head}{width}[\textwidth]{\def\@bannerwidth{#1}}

This would set \@bannerwidth to 5cm for width=5cm and to the width of the text otherwise.
 Now to parse an optionstring you need to pass it to \setkeys like this:

\setkeys{keygroup}{optstring}

So now in order to have a command with more than one optional argument (beware syntax is different though!)

\newcommand{\printbanner}[2][]{
    \setkeys{keygroup}{#1} 
    ....
}
and call it like so: 

\printbanner[width=18cm,color = red]{Other Arg}
 
Second:
I think keyval was written with functions in mind but that shan't stop us from abusing it for package options. Declare all your options that don't need keyval syntax first (it's easier than going through keyval). Afterwards set up the catchall handler with 

\DeclareOption*{\edef\@act{\noexpand\setkeys{keygroup}{\CurrentOption}}\@act}

The reason you need this is so you can delay the expansion of the arguments. This should be enough so you can 

\includepackage[width=18cm]{package}

Further Notes:
If you want a switch case like option have a look at the package ifthen.
A complete, minimal, working example is available here.

Friday, December 31, 2010

Auberginen, Radiccio, Weißwein sauce

Was:
2 kleine Auberginen
1 Kopf Radiccio
1 mittelgroße Zwiebel feingeschnitten
2-3 Knoblauchzehen
4 gehackte Tomaten
Ziegenweichkäse (Alter nach Vorliebe, frischkäse geht auch ist aber etwas fader)
ein wenig Brühe
\frac{1}{8}l Weißwein (nach Belieben, mir beliebt trocken)
Olivenöl
(roten) Pfeffer
1 Handvoll gehacktes (frisches) Basilikum
Thymian
Dazu: Pasta oder Gnocchi

Wie:
Auberginen halbieren und dann orthogonal dazu in relativ dünne (4mm) Scheiben schneiden. Mit Salz bestreuen und eine Weile weinen lassen (halbe Stunde wäre gut ich bin dafür meist zu ungeduldig. Auberginen mit Olivenöl grillen (oder braten) bis sie zart sind (2-4 min pro Seite je nach Hitze). Radiccio ebenfalls erhitzen bis er welk wird (1-2 min pro seite).
 Ein wenig Öl in einer ausreichend großen Pfanne erhitzen, Zwiebeln und Knoblauch zugeben zwei Minuten erhitzen, Thymian und Petersilie zugeben und rühren bis Zwiebel weich und glasig ist.
Nun Thomaten, Brühe, Weißwein, Pfeffer und Basilikum zugeben und ein paar Minuten simmern lassen.
Auberginen und Radiccio zugeben und abschmecken.
Pasta/Gnocchi in Teller füllen mit Sauce bedecken und zerkrümelten Ziegenkäse darüber streuen. Als Deko eignet sich das obligatorische Blättchen Basilikum.

Warum:
Lecker

Vegetarische Quiche

Ein simples Rezept, das ich sehr schätze:

Teig:
200g Mehl
100g Butter
1 Prise Salz
bis zu 50 ml Wasser
Butter kneten (Küchenmaschine empfiehlt sich), Mehl und Salz einbauen und kneten bis keine Klümpchen mehr existieren, Wasser dazu, kneten und kaltstellen.
In eine (gefettete) Backform packen, mit der Gabel ein Paar Mal einstechen und bei auf 170 Grad vorgeheiztem Backofen etwa 15 min vorbacken.

Füllung:
2 Spitzpaprika
1 Stange Lauch
1 Zwiebel
1 Zehe Knoblauch
 [Chili|Muskat|Paprika], Salz, Pfeffer je nach Vorlieben
Zwiebel und Knoblauch in Fett (Butter,öl) erhitzen, Lauch dazu. Wenns einigermaßen glasig aussieht Paprika dazu. Nach ein, zwei Minuten würzen, fertig! Wein würde sich sicher auch gut darin machen. 
Anschließen in die Form mit dem vorgebackenen Teig füllen.  

Überbackung:
150g Gry\'ere
1 Becher saure Sahne
Zusammen rühren über die Füllung verstreichen und alles in den Backofen bei 170Grad und backen bis es lecker aussieht (15 min?)