7.22.2018

Our safari in Poland

We have just arrived after midnight from our two weeks adventure. Our original plan was to have a longer biking trip in Poland, but the rainy weather and the distances between our destinations transformed our plan to a real adventure safari.  

Of course, we started on the Helsinki-Tallinn ferry from where we drove to Klaipėda, Lithuania. There, we have done a one day trip on bike on the Curonian Spit to Nida, where we have visited Thomas Mann's summer house. This was an amazing day with lots of sunshine in beautiful nature on easy terrain.

From here, we have gone to Białowieża National Park in Poland to see the reserve of European bison. We have met a German cyclist there, and we have arranged the visit together. Despite the rainy weather we have managed to see both the nature and the bisons. Great experience!

Our next stop was the historic town of Sandomierz where we have visited the historic downtown. We have continued with a unique experience of traditional rafting on the river Dunajec, on the border of Poland and Slovakia.
The next item on our list was our biking trip in the Beskid Mountains. We have left our car with a friend close to Nowy Sącz, and pushed the pedals for 200 km on a route with stunning scenery and lots of heavy climbing. Unfortunately, we have got heavy rain, so we had to cut it to three days. 
All the better, as we had one more day for Krakow, where we have visited the Wieliczka Salt Mine, the castle and the historic downtown. These are truly amazing places, the mines are absolutely unique experience, and the downtown is probably the most beautiful one in central Europe. It is funny than you can see the most authentic Germanic style city main square in Poland.
Well, we have finished as we have started, on the Tallinn-Helsinki ferry. We have driven 4000 kms, raised our tent in campings, parks, slept at friends, airbnb flats, biked next to the Baltic see and in mountains. This was a full experience!

11.24.2016

Caribbean storms: some win, some lose

The other day one I have written some thoughts about how economy developed in Hungary and some other European countries. A friend of mine from Cube have seen this piece asked me to have a similar look what happened with her home country during the past few decades. I have become interested, so this morning I took a look again on the Maddison Project data and here I show what I have found and how I interpret it.
Again, I use the GDP per capita data from selected countries in the Caribbean region. I have selected four countries to have a closer look: Cuba, the Dominican Republic, Haiti, Jamaica, and Trinidad and Tobago. I used data from Brazil and Mexico as some kind of regional reference only for comparison. 
I would like to start again with the disclaimers:
  1. I am not a historian nor an economist, I am just a guy interested in these topics and have an easy way with numbers and data. My conclusions are mine with all my misunderstanding and sometime lack of knowledge.
  2. I am aware that GDP per capita data is not a good indicator of life standard, but it is hard to deny that it correlates very well how people in a country senses their levels of life. It is still true that when this measure goes upward people feel that life is getting better. Similarly, people tend to see countries with higher GDP per capita as better to live in. Maybe once I will have a closer look on how international migration follows the GDP per capita of countries.

With all of these stated, let’s have a first look on the raw values.
 
Well, it is nice, but Trinidad and Tobago over-performs everybody in the cohort so much that we can hardly see what is going on with others. Let’s just forget them for a minute and see what is happening with the others.

No big surprises here, Mexico and Brazil are on the top, and there is some development in most of the countries. With the exception of Haiti. Haiti struggles do develop its economy ever since we have data, and actually from the beginning of the 80’s, it is going down and down. Haiti and the Dominican Republic are the western and eastern part of the same island called Hispaniola. It is a very interesting question why they have run such a different paths. After WWII, in the early 50’s they have started from the same economic levels, but while DomRep is one of the eminent performer while Haiti is the poorest country in the Western Hemisphere, and running close to claim the title in the whole world. There is debate, and some people wrote on the topic some articles, but it is hard not to notice that while DomRep has diverse political and economic systems, Haiti has been in the state of anarchy for much of its independent history.
During the 50’s many of these countries were torn by independence movements and dictatorships. Since my main focus is on Cuba, I wanted to see how its political system influenced its economy. I have chosen 1958 as a reference year, which was the last year of “free economy” in Cuba, after which the Castros took over ruling the country.

We can see interesting developments and dramatic course changes. Before the 50’s countries from which we have data, so Cuba, developed head-to-head with Mexico, Brazil, and Jamaica. 1958, the year of Castro, marks the course change for Cuba. After that point Cuban economy has grown minimally until the end of 90’s. At that point the collapse of the Soviet Union caused the so-called “Special Period”, when Cuba lost approximately 80% of its imports, 80% of its exports and its Gross Domestic Product dropped by 34%. There was a serious famine and shortage of practically any modern goods considered needed for everyday life. Cuba has recovered slowly to the levels of 1990 only by mid-2000’s.
Other countries have seen serious events too. Jamaica gained independence from the UK in 1962 and sported a steady development of economy comparable to Brazil, Mexico, Trinidad and Tobago, and others. In 1972 they got bored with this course, so they have decided to choose the Cuban model and elected the People's National Party to power. As a good peoples’ party, they started immediately to deliver public services to the people without caring much about where the funding is coming from. Alas, they have managed to correct the course of Jamaica following the Haitian and Cuban example of economic success.
To be fair, we have to mention that non-socialistic countries were not spared of shocks either. Many countries of the region were suffering of the so called Latin American debt crisis caused by financing their economies from external loans. The solution of this crisis caused a huge loss in the standard of life in countries like Brazil, Mexico, and Trinidad and Tobago. These countries struggled for more than a decade to grow back to their pre-crisis level.
I am very interested in the general courses which these very different economies run.

The reference trend is of the countries which have managed to double their GDP per capita between 1958 and the late 70’s, and practically tripled it by 2010. On the other hand I see outright stagnation in Cuba and Jamaica (after 1972), and outright decline in Haiti. Should I say more? “Viva la revolución!

R code for making the plots


10.27.2016

Hungarians and the dream of Austrian life standard

Hungary has a stormy historical relationship with Austria. The two countries were part of the same empire between the mid-16th century and 1920, though Hungarians revolted several times against the formation. Ever-since Hungarian people have a sight on the western brother-in-laws (as we call Austrian people) for reference on how well state affairs could go also in Hungary, if only we would be as smart, lucky, greedy, hard working, easy going, etc, as those living beyond the Leitha.
Especially when we talk about the life standard. In politics, the Austrian standard of living is the de facto standard, to which we always want to close the Hungarian one, and about which politicians state year by year that it is further ahead of us then ever.
Since I have a nice historical dataset about GDP-per-capita values from a nice range of countries including all European ones, I thought I will do some fact finding exercise to figure if those statements are true, and if so, why? (The original data is available form the site of the Maddison Project, and it is called: Historical Statistics of the World Economy:  1-2008 AD.)
Let's begin with my disclaimers: First, I am not an economist, just a guy who likes to play with data. It can easily happen that all my insights are wrong, or mis-interpreted. Second, I am aware that  GDP-per-capita is not a direct nor optimal measure of life standard, but 1) this is the best data I can access, 2) it is not that bad since so many economists are still using it for comparing living standards in different countries.
Now that these are off the table, lets have a look on a general picture how GDP-per-capita changed after the second world-war.

I use a few countries as references here in addition to Austria (green, as their lawn is always green). UK (red) as a general reference representing general trends in the world economy. Germany (blue) as a representative of WWII losers in Europe, Finland (orange) because during the past century, it had a very similar starting point and background as Hungary. I know, at this point people start to scream that how-so? Well, in the beginning of the 20th century Finland was in a very similar status just like Hungary. Not much of natural resources, some industry but nothing overwhelming, part of a huge empire which is hated by much of the population in the country. They enjoyed a wide autonomy, but gained independence during the endgame of WWI. Some red political adventures, but generally a capitalist backwater country with strong economical dependence on western allies. Parallel histories until the end of WWII. Besides, as I am a Hungarian living in Finland, the orange line is absolutely a must have in this mind-game.
So, let's have a look on the plot. The absolute GDP-per-capita values were more-or-less steadily growing in all countries. The exception is the period around the '90s representing the collapse of the Soviet economy. Hungary (black line) was inside the block, and Finland was a heavy exporter to the Soviet-union, so both of these countries experienced an economical shock when the rouble of Big Brother went to south. During this period, the growth in Hungary was much less than in those other, more lucky, countries, including Austria. Well, thank you socialist plan-economy.
So how faster Austria developed than Hungary?

Much. Just after the war, Hungary was able to produce at 90% level of Austria. Thanks to the hard-core communism between 1945 and 1956, this sharply dropped to 55% in the course of 11 years. After the '56 uprising, the new socialist regime realized that Hungarians will be content of the new world order if only they will be given perks. After exterminating all internal enemies, Kádár started their 'New Economical Mechanism', which was not successful stabilizing the economic backsliding compared to Austria. They started to finance workplaces, production and in a small part social expenditures from external loans in 1973, which finally stabilized the life standard at around 40-45% of Austrian people. (I have to add that it was somewhat expensive. There are calculations stating around 40-70% of today's public debt is the interests of external state loans obtained between 1973 and 1990.) Again, the collapse of the Soviet bloc and their economy shrunk further 10% and by 1992, Hungary was able to produce at 31% of Austria. I remember this time very well. People were driving to Vienna to but such goods as washing-machines or computer components. By this time where are the years after the WWII, when Austirans and Hungarians were really brother-in-laws in our misery of losing the war, living at almost the same levels?
Ever since the beginning of '90s, Hungarians are working day-and-night, and we can be proud (?) that we are closing to 40% of Austrian life standard.
Conclusion? Not much. Maybe I recommend these plots to those who still believe that socialism and socialistic economy was so good for those poor people. After 50 years such an adventure in Hungary, we can see these data and think. Without this experiment, where could we be? Where Austria or where Finland is?
(Code for generating the plots and some more is posted to Pastebin.)

4.28.2016

Mapping the Moon

I am fascinated by space exploration. The other day, inspired by the recent anniversary of the Apollo 16 mission, I was watching a short documentary about Moon exploration.

The documentary had an interesting note about the Lunar ReconnaissanceOrbiter, a space probe orbiting the Moon since 2009, and performing different measurement to prepare for future Moon expeditions. One of the six on-board instruments of the orbiter is called Lunar Orbiter Laser Altimeter, or LOLA. It measures the precise height of the lunar surface under the probe by centimeter accuracy, and it is used to build a topographic map of the Moon.

That has turned on my brain and I was carried away. What could be more cool than play around with the real 3D topographical map of the Moon! Then I figured, that NASA is a public institute, they publish practically everything they measure or record during their missions. So maybe, if I dig deep enough, I can find LOLA data out in the Internet wilderness.

And here we go! The orbiter itself has a great and informative website. They provide links not only to interesting images and multimedia, but also to actual real measurements and datasets via NASA's PlanetaryData System archives (sounds mind blowing!).
The actual measured raw data can be downloaded from the Lunar OrbitalData Explorer. For example, a single set of measurements can be imported into R like this:

raw.data<-read .table="" a="" href="http://pds-geosciences.wustl.edu/lro/lro-l-lola-3-rdr-v1/lrolol_1xxx/data/lola_radr/laser1/lro_no_01/lolaradr_092582345.tab">http://pds-geosciences.wustl.edu/lro/lro-l-lola-3-rdr-v1/lrolol_1xxx/data/lola_radr/laser1/lro_no_01/lolaradr_092582345.tab
")
head(raw.data)

This is a table file which can be nicely imported into an R data frame. Its structure is explained here.
The main point is that the first two columns contain longitude/latitude coordinates, while column 10 is the distance of the surface measured from the orbiter. It is a simplification, because the measuring laser is not always pointing “down”, but for our purposes that will do. Because after investigating a few of the files (and there are many of them), it is clear that they contain data segmented by collection time, meaning that in a file there are reads from a segment of a single orbit. Since I am more interested in all the measurements from a given lunar location, I was digging further on the website.

Fortunately, they offer also a tool to download all the elevation reads from a location, and it can be selected using simply the coordinates of the desired region: http://ode.rsl.wustl.edu/moon/indextools.aspx

So I have fired up Google Moon and picked up one of my favorite regions: the Posidonius Crater. There are multiple crater rings in this complex, and I have randomly picked up crater “J” and its surrounding and downloaded data between 30 to 32 E; and 33 to 35 N coordinates.

The data is kindly generated as a CSV file, which is very easy to handle with R:

dat.file<- font="" opofull_csv_table.csv="">
my.data<-read .csv="" dat.file="" font="">
head(my.data)
summary(my.data$topography)



The important information is stured in the first three columns of the created data frame: the longitudes, the latitudes, and the “topography”, which can be simply interpreted as elevation compared to a hypothetical “sea level”.
After a brief investigation of this topography data, it can be seen that it is actually “below” that level, so all the elevations are negative:

summary(my.data$topography)

It is easy to use the plot3d() function to draw a 3D scatterplot of the measured data. I wanted to use a color code which would resemble map colors, with high values as brown and low areas as green. The terrain.colors() function offers a handy solution for that:

zlim<-range font="" my.data="" topography="">
zlen<-zlim font="" zlim="">
colorlut<-terrain .colors="" font="" zlen="">
col<-colorlut font="" my.data="" topography-zlim="">

With the colors prepared, plotting is a matter of providing the proper parameters of plot3d():

plot3d(my.data$Pt_Longitude,
       my.data$Pt_Latitude,
       my.data$topography,
       col=col,
       zlim=c(-4000,11000),
       xlab="Longitude",
       ylab="Latitude",
       zlab="Elevation",
       main="Posidonius J crater on Moon",
       sub="Lunar Reconnaissance Orbiter LOLA data")



This is excellent, the passings of orbiter are clearly visible, and with a bit of turning the plot this and that ways, we can clearly see the shape of the terrain. Still, it is not what I wanted as a nice 3D topography. For that, the measurements taken under the orbital passings should e converted to a regular grid format, where the elevation is recorded in a grid like matrix. It is not a trivial task to convert our existing data to grid format as it involves heavy interpolation. It is a computationally expensive calculation, but nothing that a modern computer could not handle. R offers the akima package, which implements the interpolation of H. Akima (http://www.iue.tuwien.ac.at/phd/rottinger/node60.html ).

library(akima)

int.dat <- font="" interp="" my.data="" t_longitude="">
                  my.data$Pt_Latitude,
                  my.data$topography,
                  xo=seq(30,32,length=100),
                  yo=seq(33,35,length=100))

It takes some 10-15 minutes to run the interpolation, but the results are suitable for visualization with the rgl package. First, I wanted to convert the elevation values so that they scale close to 1:10 with the horizontal dimensions of the plot.

elevation<-int .dat="" font="" z="">
elevation<-elevation 1:10="" distortion="" font="" of="" sizes="" vertical="">

Again, the colors are recalculated so the usual topographical colors are scaled to this data:

zlim<-range elevation="" na.rm="TRUE)</font">
zlen<-zlim font="" zlim="">
colorlut<-terrain .colors="" font="" zlen="">
col<-colorlut elevation-zlim="" font="">

And finally, we are ready to see the surface of the Moon!

library(rgl)
rgl.open()
rgl.surface(100:1,1:100,elevation,color=col,back="lines")



Incredible! A piece of Moon on my computer screen!

2.25.2013

Education as a memeplex


The essay that follows has been written by, and is entirely the work of Csaba Ortutay. This piece was inspired by Steve Fuller’sTEDx Warwick talk.

Introduction

There are basic units of culture and traditions, which are replicated or inherited from generation to generation. Different schools studying the development or the history of cultures use different terms to identify these units. One of the schools interprets the history of cultures as a form of Darwinian evolution, and they use the term 'meme' to describe the basic elements of traditions coined in the book of Richard Dawkins, titled 'The Selfish Gene'1.
Since the first publication of these incentive ideas, some scholars developed the initial idea of the evolution of memes to form a new discipline, called memetics. There are a large number of supporters and critics of memetics, just like in case of any novel field in science. Some of the researchers actively working on memetics noted that there are groups of memes, which are often associating with each other, their presence enhances each others' success; therefore, they form more complex structures which have stable long term function. These complex structures are called memeplexes according to their terminology2.
I suggest in this essay that 'education' is such a memeplex, which presents a significant variation in time and place. To appreciate this idea we have to remember that education is one of the main ways how memes and memeplexes today propagate (or replicate) from generation to generation. A similar dissemination is already presented in connection with physical education3.

Ways of education

Oral traditions were the main, often exclusive ways for passing information, tradition, skills, or good practices from generation to generation before inventing writing; therefore, during the major part of human history. In certain cases, oral tradition was expressed in folk songs, tales, rhymes, with a clear function to preserve the content.
Invention of writing has happened at least three times independently, in the Middle East (around 3200 BC), China around (1200 BC), and pre-Columbian Mesoamerica (600 BC). It has opened new possibilities to record traditions, and help to teach the essential knowledge for the future generations.
It is fascinating to observe that replacing oral traditions by writing is a successive process. In more traditional countries, or in case of nations under the ruling of an oppressive majority, oral traditions still have vital roles in education. Some of the earliest written artifacts are nothing more, than written versions of earlier oral traditions. We can mention the Epic of Gilgamesh, the Vedas, the Book of Enoch, or the Homeric poems4 as examples, although the status of some of these is debated.

Content of education


What subjects are covered by any educational system reflects the needs of the society of the time and place. Earliest formal education focused on the tradition of religion and administrative skills. In many cultures in the ancient Middle East, scribes and priests formed separate classes of the educated elite, and their education, often independently, served the continuation of their status. Certainly, the content of their curricula reflected their situation. During the middle ages, European education was organized almost exclusively by Christian churches. It is not a surprise that theology was the main focus of the studies. In spite of that, many memes originating from this period are used in the modern context too, such as trivium (or trivia) and liberal arts.
On the long perspective, we can clearly observe that in many cultures education moves away from theology, and as finer education starts to be fundamental for more and more professions, wider and more diverse subjects are included in the curricula of different level schools. At the same time, we can see that the schools are more and more specialized. During the earliest middle ages, subject specialized universities were mostly exclusive for India. On the contrary, today relatively few universities teach a full curriculum, including all the seven plus one liberal arts, most of them are specialized on one or few subjects.

Structure of education

Already relatively early in all leading educational traditions it was recognized that not all members of the society need the same extent of education, and the differences were reflected in different ways in the different institutions. In early systems, formal education was focused only on the highest levels, when esteemed people opened their academy. They lectured whoever they were able to pay for it. Later on, local schools were organized by local priesthood, like in Europe or Japan. These schools usually trained the local elite needed for local government. In this system, the highest education was organized by churches or states, providing training only to the richest and the most talented.
The three levels education observable in most of the places is originating from John Amos Comenius. He has divided the time of learning to three periods: elementary school, secondary school, and higher education. In the system Comenius drafted, the different functions and demand levels can be optimized for the needs of a society. These memes survived with changing content the last four centuries. A macro view of the history of education can observe a trend towards diversification and decentralization.

Goals of education


Different societies define the goals of their education system according to their morals and ideologies. Several philosophies left their landmarks on education, many of them being dominant for periods in different cultures: Idealism, realism, scholasticism, pragmatism, materialism, and others defined the desired practices and the final goal of education immensely differently. Idealist education aims to discover and develop the full human potential of each individual while realists focus on more the physical world and how to deal with problems there. Pragmatists stress the goal of solving real life problems while existentialists stress the importance of the individual choice. The influence from all of these can be seen culminating in MOOCs, where the subjects are free to be chosen, but the available subjects are clearly shaped by the demand of the audience: Internal variation and external constrains, well known topics from memetics.

Dynamics during the history of education


All of the aspects of education were keeping changing during the history and inside the different traditions. The observation that finally none of the educational systems is designed, even though from time to time influential leaders tried to do that, they much more evolved entities. Education, as a vital organ in the body of societies, changes details, content, and goals to respond to the changing constraints from its environment. The analogy with genes and species is clear and a detailed analysis of the mechanisms is imperative for the theorists who want to understand what is the education system capable of responding best to the challenges of the 21st century.

References

1: Dawkins, R. The Selfish Gene. Oxford University Press, 1976.
2: Blackmore, S. The Meme Machine. Oxford University Press, 2000.
3: Tinning, R. The idea of physical education: a memetic perspective. 2012, Physical Education & Sport Pedagogy, 17.2:115-126.
4: Parry, A. The Making of Homeric Verse: The Collected Papers of Milman Parry. Clarendon Press, 1987.


12.07.2009

Building a virtual network with qemu

I do not know much about computer networks, but I try to learn things about them. They say, the best way to do is by building a real local network and experimenting with the settings of the software and the hardware. Unfortunately I just cannot do this. I do not have enough space, money, etc. As an alternative I have considered to play with emulated machines which I can run inside my desktop computer, so they do not require additional space. I am somewhat familiar with qemu, I used it earlier to have a look on different Linux distributions without rebooting my PC. I have chosen Debian Lenny as a base system, and I have downloaded the install CD iso from their project page. I have created a 3G size hard-disk image and I have installed the system in the same way, as if I would have done it on a real computer.

qemu-img create qemu_debian_501.img 3G # creating hdd image
qemu -hda qemu_debian_501.img -cdrom debian_cd.iso -boot d -m 256 # installing debian

I have done a minimal installation, since I do not really need any graphic program or interface at this stage on the system. I have run the installed system with the most basic method:

qemu -hda qemu_debian_501.img -m 256 # running debian

This way I will have an internet connection, so I can access anything on the net from the guest system. For example it is not a problem to use the apt to update the system and use the latest packages from the repositories. The first difference of this virtual computer to a real one is the way how it can be reached from the outside world. I had to learn that it is not as simple as I thought earlier. Since (in this configuration) the virtual machine does not have an own IP, we cannot reach it via the network as a normal physical computer. There are several solutions for this problem depending on our needs. Now I do not need much, I just want to access the virtual machine via the standard ssh from outside, mostly from the host machine itself. I have learnt that it can be done easily by redirecting some of the free ports of the host to any ports of the guest system:

qemu -hda qemu_debian_501.img -m 256 -redir tcp:2222::22 # running debian with 2222 to 22 port redirection

With this command the 2222 port of the host is redirected to the port 22 of our virtual debian, so the ssh access becomes possible. So now this simple command on the host will connect to the virtual system:

ssh -p 2222 localhost

Now I have the basic system and I can boot it up with a proper reach from outside. Now I have made three copies of the hard-disk image as sys1, sys2 and sys3.

cp qemu_debian_501.img qemu_debian_501_sys1.img
cp qemu_debian_501.img qemu_debian_501_sys2.img
cp qemu_debian_501.img qemu_debian_501_sys3.img

I will organize these three virtual system into a local network. There are also several solutions to this problem, but it was really hard (to me) to figure out the proper way from the qemu documentation. But it is there, and my efforts were rewarded with success! So I have dreamed a LAN, where sys1 is a gateway to the internet, while sys2 and sys3 are inside my virtual LAN. I want to reach sys1 with the aforementioned way by ssh, but in other respects the LAN should not be reachable from outside. For this configuration I need two network card in sys1, one connecting to the WAN, and the other is connecting to the LAN. Now we have to mention that the qemu environment have some mostly hidden, but very useful features, which are very handy in basic usage. When we fire up a virtual machine, qemu emulate us a network environment with a DHCP server. Since most operating systems tries to configure the first available network card with some DHCP client, this means that in most cases we have immediately network connection, so we can access the Internet from our guest system without any manual configuration. So in our case with the virtual network, connecting the sys1 with its first network card toward the WAN is easy. The other network card of sys1, and in addition the sys2 and sys3 systems will form a separate vlan, therefore we have to configure them independently from the aforementioned network environment. The simplest solution is to add static IP to the three cards from the 192.168.0.1... range, as we would do in a real physical network. Additionally we have to set up sys1 as a router between the two vlans.
The qemu virtual machines are independent program processes on the host system, so we have to let them know how they can communicate with each other. For that purposes if we create a vlan (as in this case), we have to assign to it a physical port on the host system. One of our qemu virtual machines will listen on that port, and the others can connect there, so they can do their network communication via this solution. The problem is that we have to start the instance of listening qemu first, and all the others just after that. (But we do not have to wait at all till the OS on the listening qemu boot up fully.) In addition if the listening qemu process crash for whatever reason, the vlan, which was administered by that process will fail to function, we have to reboot all the systems in the proper order to restart its functionality. In our scenario I have chosen sys1 as the listening qemu process for our vlan.
I can reach sys1 via ssh. I have tarted the three machines like this:

qemu -hda qemu_debian_501_sys1.img -m 256 -net nic,vlan=1 -net user,vlan=1 -net nic,vlan=2,macaddr=52:54:00:12:34:57 -net socket,vlan=2,listen=localhost:1234 -redir tcp:2222::22
qemu -hda qemu_debian_501_sys2.img -m 256 -net nic,vlan=2,macaddr=52:54:00:12:34:01 -net socket,vlan=2,connect=localhost:1234
qemu -hda qemu_debian_501_sys3.img -m 256 -net nic,vlan=2,macaddr=52:54:00:12:34:02 -net socket,vlan=2,connect=localhost:1234

I set up the network cards on the systems as follows:

On sys1 the eth0 card which connects the virtual network to the outside. It gets IP by DHCP client. I put this into the /etc/network/interfaces file:

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

The second card connects to the LAN, so the virtual network itself. I cannot set it up properly with the /etc/network/interfaces settings (maybe my fault), so I just put this line into /etc/rc.local:

ifconfig eth1 192.168.10.2

On the sys2 and sys3 I specified static IP for the network cards. On sys2 I put this into the /etc/network/interfaces :

# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.10.3
gateway 192.168.10.2
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255

Sys3 was set up in a similar way, with a different IP (192.168.10.4).

After these settings, my virtual network is ready to work.

Additionally I wanted to boot up the virtual machines in “headless mode”, so without the graphical window of qemu. This way I can set up the whole network with three computers, and I can log out from my account on the desktop, and the system is still up and running.

qemu -hda qemu_debian_501_sys1.img -m 256 -net nic,vlan=1 -net user,vlan=1 -net nic,vlan=2,macaddr=52:54:00:12:34:57 -net socket,vlan=2,listen=localhost:1234 -redir tcp:2222::22 -nographic
qemu -hda qemu_debian_501_sys2.img -m 256 -net nic,vlan=2,macaddr=52:54:00:12:34:01 -net socket,vlan=2,connect=localhost:1234 -nographic
qemu -hda qemu_debian_501_sys3.img -m 256 -net nic,vlan=2,macaddr=52:54:00:12:34:02 -net socket,vlan=2,connect=localhost:1234 -nographic

Now everything is perfect! I have a nice system, where I can experiment with the network. I can go in via ssh to localhost port 2222. The systems can see the internet, so I can update them etc.

I have used this page as reference.

2.19.2009

Bye bye Xandros....

Two days ago my Eee PC went crazy. First it has showed that there are a lot of updates including an upgrade from firefox 2 to version 3. I said OK, it should be all right. But then it has shown that the upgrade has failed and started to behave in a strange way. Soon I had to realize that the writable part of the root partition is full.
Eee version of Xandros have an interesting partition scheme. The root partition is on the 4 Gb SSD disk and consist of two parts: an approx. 3.4 Gb read only part and a 600 Mb writable part. Any additional programs go to the writeable part, so there is no too much space. Contrary on the read only part there is some 2.5 Gb free space which is not accessible. I think this is a design error. Anyway, I have used the backup function which copies the files from the read only part therefore restoring everything but the user's data to the factory defaults. Otherwise it is not a bad idea, but I hate that I have just a very limited space for additions.
Anyway, I have restored the default program set. And again, I applied the upgrades without installing any additional software. And again! The writeable part become full, so I cannot use the system. That was the last drop, since it is obviously a design problem.
I was looking for a suitable alternative and finally I ended up with Eeebuntu (Netbook remix). I am really not a fan of Ubuntu, I do not like the hype around it, so I had doubts about it, but I gave it a try. Now I have installed everything, and even more. All the features has worked out of box, webcam, wifi, wired ethernet, hybernation etc. I dedicated the 4Gb disk to the system (never again too small space!) and the 16 Gb disk to home. I am a bit worried about the wearing of the SSD disks, so I will look around the right mount options like noatime, and the migration of logs to a tmpfs filesystem. At the moment I am very satisfied with Eeebuntu, I like some of the features I lacked from Xandros. For example I like that the system does not hybernate when it is on the charger and the lid is closed. This way I can listen for internet radios without keeping the stuff open. Since I do it a lot, now the LCD does not get dirty.
I hope I can use now the system even more efficiently, since I like a lot the hardware, just Xandros what made it slow and not suitable for me. And I can install even gramps for my family history research!