X11Forwarding But DISPLAY variable not set

x11-logoSerious programming in the olden days mean to deal with Unix – the father of today’s ubiquitous Linux running bigger part of the internet.

The first bigger project I was involved in was still the good old DOS with Turbo Pascal – anybody remember that?

As soon as I could, and we had to build something less of a hack but more of a software-engineered application, I steered my client into Unix, first the X86 version of Xenix, which turned out to be too flaky, and then a nice hundred thousand dollar HP Workstation. As it was an application involving graphics, an important order of business was to get familiar with the principles and techniques of the X11 windowing system.

This was not a very long-lived project and with the advent of more powerful x86 hardware and a finally decent piece of software from Microsoft – Windows NT – the develoment was moved to that new platform. The fact that the port from X to NT was not terribly difficult was a nice testimonial for proper application of software engineering principles. Hacking mentality as promoted by something like Turbo Pascal would have required a complete rewrite.

System administration, I had become familiar with during that time, was helpful when I started to maintain a few linux web servers years later. I always considered X11 far superior to all the other graphical windows software but I really had never anything to do with it any more – until a point in time a few days ago.

First of all, I finally succeeded in getting Ubuntu running on an old laptop. A flaky DVD had never gotten me through an installation properly and the machine was so old that it could not boot from a memory stick. I ultimately succeeded when I found a utility I could burn on a CD and boot from that made my USB bootable. Now I could load Ubuntu from the USB stick.

So, there I finally was again with a computer with a proper graphical user interface. But that computer was tucked away somewhere with little physical access. It serve as a local testing machine for web development – did not really need that X Windows for that!

But it was sitting there, teasing me, so I finally got XMing – an X Server running on MS Windows – installed on my main computer where I sit all day and I could finally connect to that old laptop remotely with a graphical user interface. In my early days of X11 there was not too much concern about security – it was all on the local network – yes, a coax ethernet cable – and to have an application display on an xterminal you just had to set the DISPLAY environment variable to the IP address of any X-Server, like a xterminal, and authorize its use.

That is all different now. I learned that from a remote machine you start an ssh connection on my workstation (windows 7) to the remote host (old linux laptop) using putty. If the putty session had X Forwarding enabled then a secure tunnel for all the X traffic was created. This tunnel could even go through a router with NAT without a problem. Initially I had wondered why I saw the value of the DISPLAY variable set to strange things like localhost:10.0 – but I finally understood that this was how the ssh tunnel worked: the ssh server on the old laptop pretended to be a local X server on display number 10; then it transported all the X traffic it received securely to the machine I was sitting on and fed it into XMing. It all worked perfectly.

Two weeks later I received my first Raspberry Pi and that little wonder did behave the same way as the old laptop, a bit slower I have to admit, so the old laptop is still a bit more powerful than the miniature linux box sitting over there on my speaker. Both are full LAMP systems and are even accessible from the rest of the world through the magic of DynDNS and port forwarding.

But then my trouble began.

As I had all this so nicely and easily set up, it was suddenly not enough any more that I logged into my real web servers only with putty, SCP, and DirectAdmin. Nostalgia had me in its grip and I just had to get X running on them as well.

First of all there was no X-stuff installed on those servers as they were web servers in some remote data center. But a “yum install xterm” got this handled. Still no go – starting xterm from the ssh login gave me the error message that the display was either not there or could not be opened.

The next step, I found out, was to enable X11Forwarding for the sshd on the remote server – but still no go – the DISPLAY variable was still not set. Lots of Googling around but no solution – everything I tried made no difference.

But I learned about the -vvv parameter to ssh. It would give me insight into what was happening during the establishing of the ssh connection. Unfortunately, putty does not have it! But I found that it has a logging function and after turning this on and comparing the logs from connections to my local old laptop and the remote web server I finally saw the light:

xauth

After I had it yum-installed and run to generate a new .Xauthority file for a local X server my quest for the xterm running on that web server and displaying on my local machine behind a NAT router in my office had come to a successful conclusion.

Not that I will use that much – putty and SCP have done the job for me for years – but I now could, potentially, install firefox on that server and start browsing through that server located at a very different place on the planet.

Hmmm  – why don’t I just try that: yum install firefox……………………….
finally, after installing a gazillion dependent packages, the installation is – complete!

Now: firefox& – wait – wait – wait…

ff-on-linux

But it is clear that I have to file this away under ‘education’ as it is so slow to make it more or less unusable.

Seeing the Future

When I was in my late teens, starting to read science-fiction, I was sure that by now we would regularly traveling to other planets and had settlements on the moon, and the flying car was a given.

But many of these things are still only subject of science-fiction, but something totally unimagined has materialized – a network that did make the world’s knowledge accessible from the palm of my hand. I knew there would be talking robots but that I would be able to access all data with just a query – I just hadn’t thought of.

Found this interesting video of visual thoughts of how the future might look like…

But with that last experience, what’s really going to happen, will be something totally different altogether.

When Only The Government Has Guns

I grew up in a country that has one of the strictest gun control in the world – Germany. Once I tried to get a gun permit after I was being beat up by some guys and was very afraid that my little sister got mauled (which fortunately did not happen) without me being able to defend us.

I remember a cop actually showing up at my house interviewing me to evaluate if I had the maturity to be entrusted in defending myself – but I was mostly scoffed and laughed at. Funny part of that story is that I was asked by another cop for help with the guys that had beaten me up. Looking back, it was somewhat funny. After these three or four guys let me go, I did what every good citizen who survives violence is supposed to do – I called the cops from the next phone booth (cell phones were not invented yet). And they came pretty fast, scouted the area and apprehended two of them, which I identified. After then I made my way home and the cops look the bad guys to the station.

There, apparently, one of the guys got so solidly on the police man’s nerves that he hit him. He then came to me to ask if I would testify in his defense should the bad guy complain about that rude behavior. It never came to that, though.

But back to gun control – so I, as a law-abiding citizen, was absolutely not able to get me the means to level the playing field to put up an effective defense. Now, interestingly, the Wikipedia article about German Gun Control tells the story that gun and weapons (which in Germany includes bigger knifes) control was tightened even more in the early 2000s after a chain of school shootings. Imagine this, even with this nearly complete disarmed people, school shootings were possible and did, in deed, happen. This should be reason enough, at least for any semi-logical person, that gun control does not stop gun violence and school shootings.

So, what would then be the real reason for gun control – meaning a society where only the government has guns?

It becomes glaringly clear when we look at the following:

  • In 1911, Turkey established gun control. Subsequently, from 1915 to 1917, 1.5-millionArmenians, deprived of the means to defend themselves, were rounded up and killed.
  • In 1929, the Soviet Union established gun control. Then, from 1929 to 1953,approximately 20 millon dissidents were rounded up and killed.
  • In 1938 Germany established gun control. From 1939 to 1945 over 13-million Jews,gypsies, homosexuals, mentally ill, union leaders, Catholics and others, unable to fire a shot in protest, were rounded up and killed.
  • In 1935, China established gun control. Subsequently, between 1948 and 1952, over 20 million dissidents were rounded up and killed.
  • In 1956, Cambodia enshrined gun control. In just two years (1975-1977) over one million”educated” people were rounded up and killed.
  • In 1964, Guatemala locked in gun control. From 1964 to I 98 I, over 100,000 Mayan Indians were rounded up and killed as a result of their inability to defend themselves.
  • 1n 1970, Uganda embraced gun control. Over the next nine years over 300,000 Christians were rounded up and killed.

Doesn’t that looks like more the act of a gang of bad guys trying to get rid of a threat to their monopoly on violence?

The only thing that stop the bad guy with a gun is a good guy with a gun. Cops are supposed to be just that. But history shows that those guys often become the bad guys and then there is no line of defense if they are the only ones with the guns, except, maybe a few of the private bad guys who are the only – if weak – competition.

if only the government has guns

Google in the 60s

My first encounters with computers were through the medium of punch cards and line-printers.

Thus, finding the Google60 art project made me a bit nostalgic. The project tries to show how you would interact with the all-pervasive Google through the mediums of the 60s.

Click on the image to experience it yourself…

Google60-inout

Google 60 Art Project

Emotional Stuff That Makes Me MAD

This emotional video of a 6-year-old boy with cerebral palsy walking to his homecoming marines-dad the first time made me raving mad…

Am I the only one wondering why this dad was away so long instead of being with his son during all these years?

What is so heart-warming about a mercenary for an imperial outfit to go out and miss his family to support the ‘interest’ of the owners of a country like the US?

Usually, in response to this, we hear that they are heroes defending our freedom and liberty.  Could not possibly be true if we look at the only country I know of that had no war for two centuries – Switzerland – a country smack in the middle of the bloodiest wars.

They have a militia – as suggested the US should have according to the constitution. Being in the militia is a part-time job, so they can be home with the family and they don’t go out to foreign lands to conquer. They are just all armed and ready to shoot any invading troops and are trained snipers to take out the highest officers – not troops – and that caused even Hitler to leave them alone.

No, marine-dad, there is no reason for you to wait years to see your son walk, if you would stop believing all this imperialistic propaganda, evaluate the ethics of what you are asked to do and find out that killing is simply killing, even if you are ordered to do so by a ‘law-maker’ – a glorified lawyer.

Just imagine – they gave a war – and nobody went…

The Good Old Trash 80

I ran into a web site today showing the 1980’s Radio Shack catalog of the TRS 80.

It made me feel sentimental as my very first computer had been a Trash-80 and I remember having a lot of fun with it. One of the most difficult tasks for me to understand, at that time, had been the idea of an interpreted language, like that TRS-80 Basic.

Before that computer, I had been mostly exposed to assembler and some high-level language like Fortran and PL3 on an IBM mainframe. The idea of typing in human-readable code and directly running it – without compiling and linking – was a strange concept for me to grasp.

The TRS-80 I had was far less sophisticated than the one shown in the above catalog, so I looked around and found a picture that matched better what I remembered:

I believe that I had the 16kB model but certainly no floppy disks – I saved my programs and data on cassette tape. With my difficulty to grasp the concept of interpreted languages the first program I bought was an assembler. I was quite some work to get anything done with this setup:

  • Insert the cassette with the assembler and load the program
  • Edit and assemble the code, keeping source and assembled program in memory
  • Insert a new cassette into the recorder and save the source file
  • Insert a different cassette into the recorder and save the assembled program
  • Load the assembled program (overwriting the assembler in memory)
  • Running, testing the assembled program and writing down errors
  • Rinse and repeat

This lengthy procedure trained you to really think ahead and consider all possible errors – it took too long to ‘just try’ something. In this regards those interpreted languages are much easier and train programmers to be much sloppier.

The bigger part of the internet now is based on such sloppy work – whenever you have a PHP file it is more or less interpreted like the old Basic in my Trash 80. I once read – and it made a lot of sense – that we would do a lot to avoid global warming if we would compile all those billions of lines of PHP code into machine code once and then execute that on the server. All data centers around the world could be scaled down considerably if each line of PHP code would not have to be compiled over and over and over again, thus saving energy for the processors of the webserver and the energy for cooling them.

Maybe, then the web could run on a couple of TRS-80s.

Slow-mo, 3D – all the good stuff

Sometimes we might not realize that we are standing at the cusp of a new world.

Looking back it is easy to see that something new and exciting had been happening at a specific time, but while you are in the middle of it, it might not be so obvious.

Watching the slow motion video, Louie Schwartzberg presented at his TED talk, drove it home that this is similar to the wonder people experienced when they watched the first ‘movies’ around the previous turn of the centuries (the one from the 1800s to the 1900s), especially when the subject was either so far away that the chance of experiencing it oneself was minimal or total creative fiction like a trip to the moon.

Movies really allow you to experience a different reality, either far away in term of location of far away in terms of speed of time as in this example…

If you want to see more from Mr. Schwartzberg, you can check out his Youtube channel and dig out your 3D glasses because he has some really good 3d videos to show.

Yet Another Picture Collection

Thanks, Beverly, for sending these pictures my way. I enjoyed them and want to pass them on here…

Triumph of the Nerds

Now that all those nerds that created the computer revolution are getting to an age where we might lose them – see Steve Jobs – documentaries like Robert X. Cringley’s Triumph of the Nerds become more of a history text book (book understood more figuratively).

In the old InfoWorld magazine/newspaper Cringley’s column “Notes from the Field” was always my favorite – your’s too, Max, right?

So, I just had to stop and listen (and watch) when I ran into his documentary “Triumph of the Nerds” on Youtube.