Java CA Certs gone missing (Ubuntu 16.04)

One of the sons had Minecraft fail violently with CA Certificates errors. I looked around for the solution all over the place (re-installing Oracle Java 8 and so on), but nothing worked.

Got this error;

Java_CA_Certs_Missing

Then I realised all you had to do was run two simple commands, taken from this link. That sure was a relief.

Fix for missing CA Certificates in Java (StackOverflow).

Posted in Uncategorized | Leave a comment

OpenTTD Server – or How to build enormous railroads virtually

My kids love the transportation simulation OpenTTD, a fantastic game made by the geniuses behind Spotify, among others. It’s an open version of the old Transport Tycoon Deluxe, which was a sequel to Railroad Tycoon. Amazing game, and great fun.
It’s a multiplayer game that can be played over the internet, and to make sure that the game is available at all times I installed a virtual server called ttdserv on my KVM server (named runner) in the rack downstairs. With 384MB of RAM (the KVM host is running a total of five servers at the moment, this being the largest) and 12GB of disk, it’s running flawlessly.
All I had to do was install a Debian server via network install, choosing only the openssh server among the prepared packages, and after a completed install do

apt-get install openttd screen

That installs a whole lot of things, such as a full window management system, but it’s quite reasonable to have running on the virtual machine anyway. The screen package is to make sure the server can be kept running when logged of (it’s not normally run as an init.d script or daemon, but I’ll try and correct that later).

All that remained then was logging on via ssh, activate screen, and run the OpenTTD with a specific switch. Problem was to get the game configured the way the kids wanted without editing the openttd.cfg file (I haven’t had time to learn the options yet). So… I logged on and ran a remote OpenTTD session (i.e. via “ssh -Y ttdserv.lan”), created a game that had the options set as the kids wanted (gigantic map, lots of industries and cities) and saved it once it had started up.

Then it was just a matter of starting the OpenTTD game in daemon mode (see below), and at the command prompt load the game I just created.

openttd -D
(console output)
dir (to get a list of available games)
load 2 (to load game indexed as 2 in the list from dir)

And… bam! The kids could connect to the server and play.
Oh! And to make sure outsiders could connect I also opened port 3978 and 3979 for TCP & UDP at my firewall.

Posted in Uncategorized | Tagged , , | Leave a comment

Sölvesborg local car show

Wonderful car, this.

Do I want one? Yes.

This probably shows better than most what Mercedes was all about.

Now that SAAB Automobile is down and out, here’s what it was like back in the day.

A Volvo Amazon – the 120 series – something I’d want in my driveway…

A Volvo Amazon, the 120 series.

Posted in Uncategorized | Leave a comment

Scout hike and late spring scenery

 

Posted in Uncategorized | 2 Comments

Out abouting scouting

Posted in Uncategorized | 1 Comment

BZFlag Server 2.4.0 on Debian

I did a bit of work to get a BZFlag 2.4.0 game server running on one of my virtual Debian servers. I’m sure there must be a better/smarter way to do the same thing, but this is what I did.

First of all, I just downloaded the sourcecode for BZFlag 2.4.0 from their homepage. Then it was just a matter of making sure I’d installed what my Debian server needed to compile the code.


$> su -
$> apt-get install build-essential

After unpacking the code, and going into the unpacked directory, it was just a matter of doing…


$> cd ~magvar/bzfs2.4.0
$> ./configure
$> make

To make sure I could run more than one version of the game server, I placed the 2.4.0 version of the scripts needed in their own directory.


$> su -
$> mkdir -p /usr/games/bzflag
$> cp ~magvar/bzfs2.4.0/misc/bzfs ~magvar/bzfs2.4.0/misc/bzfsd /usr/games/bzflag/

I had to update the bzfs script, the server startup script, a little. The following were the changes I had to make.


# Set this path to the place where you keep the bzfsd script
bzfsd_path=/usr/games/bzflag/bzfsd
...
# Set this to your bzfs options
bzfsopts="-conf /etc/bzfs/bzfs.conf"

I also think I had to change the location of the lockfile.


/var/lock/$prog

I updated the bzfsd file to contain the following line to do the execution.


nohup /usr/games/bzflag/server/bzfs $* > $BZLOGFILE &

I edited the bzfs.conf file (controlling the configuration of what’s possible to do in the BZFlag game), and put it under /etc/bzfs.conf.


-a 50 38
-j
+r
-t
-s
-f B
+f GM
+f L
+f SB

Note that I made sure to remove the “Blindness” (B) flag. SmartBullets and Lasers are fun, though.

Missing were, among other things, /etc/init.d/functions. Found that, by luck, and just copied the code to a file, i.e /etc/init.d/functions

I got the whole file from this site.

I had to edit a few things out, among other things I hardcoded consoletype to one (1), as it’s a virtual terminal (no user behind the keys). Adding this after the export of PATH did the trick.


export CONSOLETYPE=1

Then it was just a matter of copying the binary and setting up the server to start automatically.


$> su -
$> mkdir /usr/games/bzflag/server
$> cp ~magvar/bzfs2.4.0/bzfs/bzfs /usr/games/bzflag/server
$> ln -s /usr/games/bzflag/bzfs /etc/init.d/bzfs.sh
$> cd /etc/init.d
$> update-rc.d bzfs.sh defaults

And hopefully that’s all that’s needed to get it running. Looking at my rebooted server, I’ve got a process running, at least. The init-file I linked to is located here.

 


root 1067 1 0 19:33 ? 00:00:00 /usr/games/bzflag/server/bzfs -conf /etc/bzfs/bzfs.conf

Posted in Uncategorized | 2 Comments

Debian on a SunFire V120

Well, after a number of attempts and numerous restarts, I’ve learned what it takes to install Debian on a SunFire V120. It’s an antiquated computer, for sure, but it’s… interesting. Makes a lot of noise, to. Maybe possible to mod it some way, reducing the fan-speed for example, but I think its self diagnostics system would have a fit if I tried.

I’ve used this link quite a bit to get things set up, and am grateful to its original author.

Since I had already set up a virtual Debian server (debbie) to do network installs earlier, all I had to do was download the netboot for Sparc and put it in the correct directory (as stated in the guide).

I found a great guide for how to connect using the minicom application as well, since you can’t see the console output during boot any other way.

I used an RJ45 – DB9 modular adapter to get my connection set up, along with a common CAT5 network cable to hook it up to my virtual server host, making it possible to ssh to my host server, and from there do minicom to the SunFire V120.

One thing that didn’t work despite the guide was that the system got a kernel panic when it tried configuring the network. That was fixed using the tip here (plug in two network cables, but once the Debian installation screen is seen, unplug NET0, then continue as normal). Thanks Roland!

One last thing stopped me for a while. When I rebooted, the server couldn’t be booted with the usual “boot disk”. I had to tell it specifically where to boot from.

boot disk1:1

That boots from the first disk and its first partition. It worked perfectly, and I was lead to doing that by another user guide.

To make it use the proper disk when booting, the following command is sufficient.

setenv boot-device disk1:1

That is enough to make the system boot from the correct disk next time it reboots.

Posted in Uncategorized | Leave a comment

XML to flat file (CSV) using awk

NOTE. Since WordPress doesn’t allow proper XML to be shown on its pages, and I can’t even link to simple shell scripts, all sample files and command lines are shown as png images. Sorry about that.
END OF NOTE.

Recently, I wanted to test how large a very large XML file (180 MB in size) would be if it was formatted as a CSV (in this case a semi-colon separated file). To make it so, I wrote a little routine in AWK to read out a specified number of tags and their values, and print them in a CSV in the order they were specified.

A (sample) XML file (with more than a few tags removed) would be;

XML demo file

XML demo file

First, I needed to get hold of the tags of the XML file. All I’m really interested in, which’ll be evident later, is the value tags listed in the “record” element. To extract all of them was pretty easy.

Get XML tags

Get XML tags


imsi
msisdn
imei
pdp
apn
charging_id
duration
tx
rx
local
ggsn
sgsn
charge

I piped the output of the command to a file called elements.txt. Note the order in which the elements are listed. That’s the order in which they’ll appear on each output line later.

Now, here’s the code to run to get all of the XML formatted as CSV.

xmlToCSV.awk

The syntax to call the program is as follows, and the output should be piped to a different output file. Note the “STARTTAG” and “ENDTAG” parameters. They show between what tags data should be extracted. Note that this script can’t really handle XML that contains multiple tags with the same name, or multiple elements with the same name, for that matter. But, that shouldn’t be too hard to add either…


awk -f xmlToCSV.awk -v INPUTFILE=data/inputfile.xml -v STARTTAG=record -v ENDTAG=record -v ELEMFILE=elements.txt

Posted in Uncategorized | 6 Comments

Installing Debian via network-inst / PXE

I had a bit of a challenge over the weekend. Oldest sons computer, an Intel Atom 330-based machine, refuses to boot from USB-sticks. It doesn’t have a normal CD/DVD reader, so I hooked one up that I found on the scrapheap in the basement, burnt a DVD with Linux Mint Debian Edition (my new favourite) and installed everything. Forgot just one thing before I removed the DVD and put the whole box back together…. to make the harddrive partition I used for installing bootable.

When I’d spent five minutes putting the box back together, I didn’t feel like dismantling it again. So… instead I took a virtual Debian server I’d installed a while earlier and installed a tftp-server on it, to make it possible for my sons computer to boot the installation from that.

So, I basically followed this Debian Installation guide, but skipping over the unnecessary parts.

Logging on to the virtual server, these are the commands I entered.


root@debbie:~# apt-get install tftpd-hpa
root@debbie:~# update-inetd --enable bootps
root@debbie:~# /etc/init.d/inetd reload
root@debbie:~# /etc/init.d/tftpd-hpa restart
Restarting HPA's tftpd: in.tftpd.

Then I downloaded the start package needed to get the installation going.

root@debbie:~# cd /srv/tftp/
root@debbie:/srv/tftp# wget http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/pxelinux.0

Adding the Debian network installation tar.gz package…

root@debbie:/srv/tftp# wget http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/netboot.tar.gz
--2011-12-10 23:38:10-- http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/netboot.tar.gz

… giving me the following directory content:

root@debbie:/srv/tftp# ls -lrt
total 8730
-rw-r--r-- 1 root root 8910860 Oct 5 23:02 netboot.tar.gz
-rw-r--r-- 1 root root 26816 Oct 5 23:09 pxelinux.0

I then unpacked the netboot tar.gz package.


root@debbie:/srv/tftp# tar xvfz netboot.tar.gz
root@debbie:/srv/tftp# ls -lrt
total 8705
lrwxrwxrwx 1 root root 34 Oct 5 23:02 pxelinux.cfg -> debian-installer/i386/pxelinux.cfg
lrwxrwxrwx 1 root root 32 Oct 5 23:02 pxelinux.0 -> debian-installer/i386/pxelinux.0
drwxr-xr-x 3 root root 1024 Oct 5 23:02 debian-installer
-rw-r--r-- 1 root root 69 Oct 5 23:02 version.info
-rw-r--r-- 1 root root 8910860 Oct 5 23:02 netboot.tar.gz

On my main server, which runs DHCP and other services, I made the following changes:


root@duosol:~# vi /etc/dhcp3/dhcpd.conf
...
# TFTP options
allow booting;
allow bootp;
...
group {
next-server 192.168.16.52;
host tftpclient {
# tftp client hardware address
hardware ethernet 00:1C:C0:DA:FF:D5;
filename "pxelinux.0";
}
}

“next-server” gives the IP-address of my TFTP server, while the “hardware ethernet” is the MAC-address of the machine that’s to use the TFTP-server to find its installation medium, in my case my sons computer. I found this written on the screen when just starting the machine as it tried to find the TFTP server. I guess there’s an option to allow all that ask for it to use the same, but… I couldn’t be bothered to find out.😉

I then restarted the DHCP server.


root@duosol:~# /etc/init.d/dhcp3-server restart

When booting the client (after having turned on “allow network boot” in the BIOS), it got its IP address assigned and booted the Debian installation program at once.

When I got to the partitioning of the harddrive, I just selected “Manual partitioning”, set the partition that Linux Mint was already installed to as “bootable”, and quit the Debian installation program.

Rebooted, and… got the familiar Linux Mint startup screen.

Maybe a complex way to solve a trivial problem, but now I’ve got a TFTP-server set up and a way to install other clients and servers with Debian should the need arise. A good excuse for tinkering with “stuff” when there was nothing good on the TV anyhow.😉

Posted in Uncategorized | Leave a comment

Installed Linux Mint Debian Edition

Well, in the end I got tired of Ubuntu and the weird hoops I had to go through to make sure things worked the way I wanted. Removing Unity (the desktop shown in the screenshot) was the first thing I did after installing, taking back the Gnome3 shell instead.

But, that got boring. So I decided to just abandon Ubuntu all together, after… well, a number of years, and going to Linux Mint. Since their Linux Mint 12 is based on Ubuntu (but doesn’t go for Unity), I decided to go back to something I’m more accustomed to: Linux Mint Debian Edition. Debian is the root of all that’s good, so… And Mint had made sure things Just Work when I installed it (Ubuntu had a bit of a problem with my sound chip), so I’m now pleased.

Oh, and Debian has a rolling update strategy, i.e. they don’t do releases like the rest of the world. Updates are to individual programs and are applied as they’re released. No need to upgrade a whole distribution anymore.

After a number of weeks, I must say I’m mighty pleased. Mint have added the niceties I’m used to have when I’m working, and things just work while looking good. Could it be better?

They warn people that the distribution has some sharp edges, but hey… I used to run Gentoo as my desktop, on an old mini-ITX 1GHz board. Ain’t much with rougher edges than that.

Posted in Uncategorized | Leave a comment