Planet Linux Australia

Syndicate content
Planet Linux Australia -
Updated: 15 min 7 sec ago

Howell Tam: SCIM with 32-bit app on 64-bit system outside chroot

Wed, 2016-05-11 13:05

For those who need SCIM while running 32-bit apps on a 64-bit system outside chroot, there are two things (at least for me) needed.

Apart from the obvious that you need SCIM installed in the 32-bit chroot, you’ll need to set SCIM_MODULE_PATH to point to the 32-bit SCIM libdir. For instance, my iceweasel32 script looks like:

#!/bin/sh export CHROOT=/chroot/testing.32 export GTK_PATH=${CHROOT}/usr/lib/gtk-2.0 export LD_LIBRARY_PATH=${CHROOT}/lib:${CHROOT}/usr/lib:/lib32:/usr/lib32 export SCIM_MODULE_PATH=${CHROOT}/usr/lib/scim-1.0 export MOZ_PLUGIN_PATH=${CHROOT}/usr/lib/mozilla/plugins linux32 ${CHROOT}/usr/lib/iceweasel/firefox-bin "$@"

Secondly, you’ll need to add a symlink in /usr/lib32/gtk-2.0/2.10.0/immodules for the chroot’s /usr/lib/gtk-2.0/2.10.0/immodules/ Not the cleanest way I have to say, but it works.

Howell Tam: LCA 2007 Day 2 – Jokosher and Gaming Miniconf

Wed, 2016-05-11 13:05

There isn’t an Audio Miniconf this year like the one in LCA 2005. Still there are a couple of audio related talks like the Jokosher talk I went to in the GNOME Miniconf today.

Jono Bacon pinpointed that a few good elements that what and how a (sound editing) GUI would make sense and be intuitive. I have played with ardour a little bit myself and I have to agree what Jono has said about it. I guess it’s kind of like how I keep hearing people who got used to a 3D modeling app like AC3D and then go and try Blender. (I use and am used to Blender, though)

Well, spent most of the day at the Gaming Miniconf. Wesnoth, PS3 Linux, and so forth.

Also fulfilled my panorama obsession and half-heartedly took one at the round house while people waiting for the conference party. No I haven’t fixed every single glitches in the photo, that’s what the GIMP tutorial on Thursday is for :)

Howell Tam: My FlightGear’s gear

Wed, 2016-05-11 13:05

Bought a Saitek Cyborg Evo when I was in HK. It’s a pretty good stick for Flight Sims. It has most of the basis including the throttle, rudder control and hat switch. And I kind of like those little lights too. Now I can practise all my flying in FlightGear with it.

Howell Tam: Pilot filters in FGMap

Wed, 2016-05-11 13:05

A couple of weeks ago, one of the fellows (yes, you, MSmith) from the Island Virtual Airways, the virtual airline based on FlightGear, poked me and was asking me if there is a way to show only their airline pilots on FGMap. After spending a few coding train trips, I’ve added a very simple pilot filtering feature. Currently you can filter by the callsign and the aircraft. It also has query string support, so you can do things like

Check it out at Code is in my usual git repo.


Howell Tam: MPlayer + MatrixView for windows

Wed, 2016-05-11 13:05

Gianluigi Tiesi is kind enough to update my MPlayer + MatrixView patch to work under windows. Thanks very much! That’s why open source software rocks :)

Howell Tam: LCA2008 Day 5

Wed, 2016-05-11 13:05

Last day of the conference. There were a few interesting talks that I wanted to go to but a lot of them are at the same time. The not-so-bad thing is though almost all talks were recorded.

In the afternoon, among the few talks I was interested, I decided to head to the MythTV BOF, partly because I know the BOFs weren’t recorded. As a quite-long time MythTV user I find the BOF pretty interesting, however I wish there was more time for it. One of the brought up issues, and also an everlasting issue, was TV guide data in Australia. I always feel funny that it is so hard to get the data, as if they don’t want you to watch their programmes.

After the afternoon tea was the lightning talks, followed by the closing of the conference. To me lightning talks are always the cool and very entertaining. Of course this year’s talks were no exception, and I enjoyed them a lot.

After the closing was the Google party. It was right outside the university union house, so it’s kinda outdoor. The atmosphere was good, and I think pretty much everyone was there enjoying the drinks and the BBQ. The food was nice, but I wish there were a bit more variety.

I stayed around for a bit and headed back to St Mary’s common room. My friend and I joined another two guys (sorry I didn’t catch the names or I just forgot :() there for a game of table tennis. I haven’t really played any double myself so that was kinda of cool.

Howell Tam: FlightGear + Google Earth fun

Wed, 2016-05-11 13:05

Last week I briefly played with Google Earth (GE) and KML, exploring the potential of using it to do something useful with FlightGear (FG).

The quickest hack I did was the GE version FGMap, which shows a moving map of all the online pilots on the FG MP servers. It is basically a very simple change with the FGMap CGI that translate MP server info into XML, only this time it outputs KML. Very simple and straight forward, nothing fancy at all. Check it out by opening this file in GE (if no one is on the server, you’ll see nothing! Check FGMap too).

[Updated] GE MP map using 3D models work-in-progress:

This weekend I started looking into GE’s 3D model support. Currently it supports two kinds of 3D model definition. KML embedded model using MultiGeometry, or a Collada .dae format. After some investigation I figured I have to use Collada to do what I want – having a 3D model of an aircraft and updating its position/orientation in GE. MultiGeometry (current version at least) is a fixed coordinates format, while with a Collada model you can place it in GE and then move it around, and also altering its heading/pitch/roll.

Quickly I found this Collada exportor plugin for Blender. As a test I loaded the C172P aircraft AC3D model from FG into Blender, followed by a few trail-and-error and I figured out what I need to export for GE: 1) Convert all faces to triangles, 2) Export Triangles, Disable Physics, Use UV Image and optionally Use Relative Paths.

According to the KML tutorial I have to pack up the .dae file together with the textures, along with a textures.txt for textures path mapping. However I discovered you could actually alter the path referenced in the .dae file to a local jpeg file, or even an HTTP URL.

So now I’ve got GE to show a 3D model of an aircraft from FG. Next is to get FG to talk to GE. There are many ways (network, serial port, etc) in FG you can export real time flight data. To make things easier for now, I’ve set it up to export simply latitude, longitude, altitude, pitch, roll, heading to a file (or actually a fifo), then I wrote a little program to read and output a KML file for GE to read. Then on the GE side, I have to create a KML with a NetworkLink to refresh the actual FG KML.

Now, problems. It seems even if I set the refresh time to be 0 seconds, and I can see GE refreshing the link continuously, on screen it still only updates the position/orientation about once per second. It could well be a GE internal limitation (or feature). The bottom line is, we need a sane way to feed data into GE.

Another thing is I can never get GE to “follow” the aircraft properly. It’s either not panning faster enough, or it will go kinda crazy and jitter a lot. Guess I’m not a GE/KML yet. I need to test it more and tidy up my codes/scripts/things a bit and I’ll put them up.

Nevertheless, it’s kind of fun to “fly FG inside GE”.

Screenshots of FlightGear running side by side with Google Earth, whereby FG sending data to GE and showing the 3D aircraft. Possibly more screenshots here


Hong Kong with Computamaps Hong Kong 3D models

Howell Tam: LCA2008 Day 4

Wed, 2016-05-11 13:05

As my back blogging continues…

Day 4 is the Professional Delegates Network Session (PDNS) night. Shortly after all the talks of the day we headed down to the Melbourne museum, where the PDNS was held.

I was absolutely stunned by the museum, and I just couldn’t stopped taking photos. And as a result this also distracted me from the actual “networking”. I shall put up my LCA2008 photos real soon. There was the CSIRAC – Australia’s first computer, and there were many many other cool displays of various animals and bugs, like those awesome ant’s nests and spiders.

It’s a pity though that we were only allowed to be in a rather small area of the museum, and we couldn’t really go anywhere else.

There’s also one of those displays where you put on a specially made glasses to watch a few video clips in 3D.

The food was very nice as well! There was a few things with some kind of raw beef, some thing that a bit like sushi but not quite, raw oysters, usual but delicious sandwiches. Allow me to say that the PDNS food this year was better than last year’s :P

Howell Tam: LCA2008 Day 2

Wed, 2016-05-11 13:05

After asking for an extra pillow (the one that was already in the room just didn’t work well, it’s as flat as a Macbook Air), I had a good sleep last night.

I have been hiding in the gaming miniconf pretty much the whole day. It was all fun and cool. In particular the Crayon project, which is supposed to turn a simple photo or drawing into some sort of games, sounded very interesting. Unfortunately due to time constrains there wasn’t a demo. It might be shown on the open day however.

Another interesting one would be Rusty’s wiimote project, which will hopefully be ready to for demo on the open day as well.

Howell Tam: FlightGear Multiplay Air Traffic with Google Map

Wed, 2016-05-11 13:05

After seeing lots useful and cool stuff people have been doing using the Google Map API, I was inspired to write something perhaps to plot buildings/models I have been/will be doing for FlightGear. While trying the API out a bit, an idea striked my head. What about a real time map for the FlightGear multiplay server air traffic map?

And so I started off doing it. It’s heaps of fun, not to mention finding out all those bugs with IE. M$ is very kind, they always do things that make people laugh. This always gives me a chance to revise a lot with Javascript.

I also ended up writing my own routines for map overlays displaying plane markers and info, instead of using the GMAPI’s GMarker. A bit more flexible, and it does exactly what I want.

There is time when Javascript is useful, and there is time where it’s just overkill. IMHO, Javascript is useful for writing “web app”. Same as using Flash, or Java applet. But btw this does NOT mean every website should be bloody web app!!

And there you go, the FlightGear server online map. A couple of FlightGearers have been using it as a flying map and as a simple ATC radar. If it’s the right time you’ll see us flying!

I’ve got plans to add more features, like airports/navids lookup. And of course, improving the usability and UI is always on the plate. Comments are also welcomed…

Also thanks to everyone who has helped me with testing and giving suggestions to the page. (ampere, AJ, thorben, vivian, gorilla, Surge, johnh51, MasseR, etc)

Howell Tam: vimpress – wordpress from vim

Wed, 2016-05-11 13:05

This is a test…

Well, not really.

I was looking for an alternative to posting blog entries using the web interface, and was randomly trying a few apps in Debian. There were drivel and gnome-blog but they don’t seem to support tags. BloGTK seems to, but there’s something weird about how it does, and it doesn’t support multiple categories. BloGTK is also being removed from Debian.

Then I came across vimpress – a vim plugin for wordpress. It’s simple, but it does what I needed. You can get a list of your blog entires, post a new blog, or even edit an existing blog. So I’m testing it with this blog entry and see how it goes.

The only small rant, not to vimpress, but to Debian’s vim, is that vimpress needs vim’s python support, but it’s not built into the vim.basic binary, which I prefer over vim.gtk or vim.gnome. One of the reasons is when I ctrl-z to background vim, and then foreground it (fg), it sometimes (not all the time) gets stuck unless I hit ctrl-c. This does not happen with vim.basic, but only vim.gtk and vim.gnome.

I did try to trace it and it is when the function mch_suspend calling pause(), which causes vim to wait for a signal.

Perhaps I should report to vim later…

Howell Tam: “I know kung fu…”

Wed, 2016-05-11 13:05

And so does everyone else. Simply apt-get install ipkungfu.

I’ve finally switched my gateway box from my 12 years old Pentium (I) 166MHz gateway box (still running Debian potato, kernel 2.2. This is Linux for you, when it works, it can work forever…), to my 5-6 years old Netwinder.

I was also very glad that the Netwinder is now (or still) officially supported by Debian. I had Debian potato installed on it for years. Upgrading it was painless.

My old gateway box was running such an old kernel, and the firewall was one of those copied-from-others script using ipchains. This time I decided to use a better way to manage my firewall rules. After a bit of research and trying things out, I’ve chosen ipkungfu. Again, it was painless to setup.

The only not-so-good bit was, I did the machine switching-over only 1 day before I went away. So as it turned out, my net connection went down in about 2 days time. I always have some scripts checking if the net is up or not, and it would reset everything (bringing down/up the interface, renewing IP, relogging on, etc). But looks like that wasn’t helping either. So I thought it might be one of those cable-modem-needed-to-be-reset situation.

I asked my uncle to power cycle the cable modem for me. And just to be safe I asked him to do the same for the gateway box too. As expected my net connection went up again. And I was happy, for a while.

Who would have thought, it went down again. Suspiciously, it also only stayed up for about 2 days. My instinct told me it wasn’t a coincident. A few days later my uncle again power cycled the modem.

I got on and check the logs again and found that my firewall was blocking (and logging) a lot of IGMP packets from some mysterious 10.x.x.x (Telstra internal network instruments) IP. It’s strange though, I haven’t seen these logs when I was testing the net. So apparently just the bpalogin client heartbeat is not enough. Seems that without the IGMP packet response (or how-ever IGMP works), after a certain timeout period (2 days?) the other end terminates the net connection and stops leasing IP, even if the cable modem is on or even there are existing network connections. So of course, I’ve then updated my firewall rules.

Lesson learnt, testing the net for 1 day is not enough, cos it will go down in 2 days ;)

Once again, many thanks to my uncle for the trouble.

Howell Tam: FGLive 0.1 LinuxTag edition

Wed, 2016-05-11 13:05

The first, sorta official release of FGLive is here. FGLive – FlightGear Live is a bootable live system on CD (or any bootable medium) that boots into Linux, with FlightGear setup, ready to run. FlightGear is an open-source, multi-platform, cooperative flight simulator development project.

To find out more about FGLive, see here, and make sure you read the README as well.

See screenshots and videos of FlightGear here.

Howell Tam: LCA 2007 Day 3 – Cool talks and professional drinking^H^H^H^H^H^H^H^Hnetworking session

Wed, 2016-05-11 13:05

After the short Linus-on-stage and Tanenbaum’s awesome keynote, I went to Albatross UAV session by John and Hugo, Tridgell’s clustering tdb, followed by Raster’s E and pants, nouveau driver, Stewart’s data eating talk, and the X monitor hotplugging by Keith Packard.

The X talk reminds me of xdmx, which works but the version I tried last time still had the nasty Xrender bug (which is apparently fixed in the development version). Also I couldn’t get any GLX direct rendering to work, even for the local native screen which I thought it would work. Someone could show me some lights? (Is it supposed to work or not?)

In the evening we had the professional networking session at the Scientia. This is actually my first time at LCA as a professional. The atmosphere there was great. There were a lot more people there than I thought it would be. Took some nice photos there too.

Photos of the 3rd day here.

Howell Tam: Bonding – switching network interface without losing connections

Wed, 2016-05-11 13:05

There’s wireless setup at my wife’s home in Taiwan. But whenever I’m upstairs in our room I prefer using the wired connection. While when I’m downstairs I have no choice as there’s no extra ethernet port.

Switching between the two networks is not a big deal. And with the help of ifplugd, the switching is automatic. But after all, they are two different interfaces. It would be good if I could switch between them without losing any existing connections. After a bit of googling around, I’ve found one solution: Ethernet channel bonding.

From the Linux source code Documentation/networking/bonding.txt: “The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical “bonded” interface”. In my case, I’m bonding the eth0 (wired) and the eth2 (wireless) together.

Under Debian, the bonding driver is built as a module bonding. I’ve also installed the ifenslave. So I put the bonding driver into my /etc/modules so it’s loaded at system startup:

bonding mode=1 miimon=500

where mode=1 sets the bonding mode to active-backup. The bonding driver also supports a few different load-balancing modes, which you might want to check out as well. miimon=500 sets the link check interval in milliseconds.

There’s also a primary parameter which you could specify which slave interface will always be used if it is available (e.g. primary=eth0).

The bonding driver gives you a new network interface bond0. Now to setup bond0, eth0 and eth2 in /etc/network/interfaces:

# the wired interface iface eth0 inet manual hostname xxxxxxx # the wireless interface iface eth2 inet manual wireless-key s:xxxxxxxxxxxxx restricted wireless-essid xxxxxxxxxxxx wireless-mode managed # the bonding interface, eth0 + eth2 iface bond0 inet dhcp pre-up ifconfig bond0 up pre-up ifenslave bond0 eth0 eth2 pre-down ifenslave -d bond0 eth0 eth2

bond0 is set to use DHCP, while eth0 and eth2 are not, as they will act as slave interfaces. bond0 is the master. The 2nd pre-up command for bond0 attaches both eth0 and eth2 as slaves to the bonding device. Note that it is possible to configure a bonding device via sysfs, which is also documented in Documentation/network/bonding.txt.

While ifplugd takes care of eth0 going up and down, I also want to turn off the wireless completely when the wired network is plugged in. So I added my own script /etc/ifplugd/action.d/bonding:

#!/bin/sh set -e if [ ! -f /proc/net/bonding/bond0 ]; then exit fi case "$1" in eth0) case "$2" in up) /sbin/ifdown eth2 /sbin/ifconfig eth2 down /sbin/iwconfig eth2 txpower off ;; down) /sbin/iwconfig eth2 txpower auto /sbin/ifup eth2 /sbin/ifconfig eth2 up ;; esac # I need to do this sometimes, so I've put it in # or could someone comment on this? ifdown bond0 ifup bond0 ;; esac

This script will turn off the wireless radio for me when my eth0 wired network is up.

I’m relying on ifplugd to bring up bond0, which will then bring up eth0 and eth2. Hence in /etc/network/interfaces I did not set any of the interfaces to be auto. I also added -l to the arguments of ifplugd in /etc/default/ifplugd:

ARGS="-q -f -u0 -d10 -w -I -l"

so that it will run the “down” script on ifplugd startup if no cable is detected. That way my script will bring up my wireless eth2 if eth0 is not plugged, say at boot time.

With this setup, the bonding driver automatically switches to use eth0 or eth2, whichever is brought up. In my setup, eth0 and eth2 won’t be up at the same time. If you use the primary parameter, the primary slave interface will always be used, even if the other slaves become available.

/proc/net/bonding/bond0 shows the status of the bonding interface. For example I’m now on the wireless network:

Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006) Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: eth2 MII Status: up MII Polling Interval (ms): 500 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eth0 MII Status: down Link Failure Count: 0 Permanent HW addr: 00:11:2f:9c:57:25 Slave Interface: eth2 MII Status: up Link Failure Count: 0 Permanent HW addr: 00:11:2f:9c:57:25

It’s pretty obvious that the currently active slave is my eth2 wireless. I can run something like watch -n 1 cat /proc/net/bonding/bond0, and as I plug the ethernet cable back, the active slave will become eth0. You can also find out the currently active slave via /sys/class/net/bond0/bonding/active_slave.

For completeness, here is the output of ifconfig:

bond0 Link encap:Ethernet HWaddr 00:11:2F:9C:57:25 inet addr: Bcast: Mask: inet6 addr: fe80::211:2fff:fe9c:5725/64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:329306 errors:0 dropped:0 overruns:0 frame:0 TX packets:329010 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:732552585 (698.6 MiB) TX bytes:204431117 (194.9 MiB) eth0 Link encap:Ethernet HWaddr 00:11:2F:9C:57:25 UP BROADCAST SLAVE MULTICAST MTU:1500 Metric:1 RX packets:303936 errors:0 dropped:0 overruns:0 frame:0 TX packets:304693 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:245381818 (234.0 MiB) TX bytes:27905638 (26.6 MiB) Interrupt:5 Base address:0xd800 eth2 Link encap:Ethernet HWaddr 00:11:2F:9C:57:25 inet6 addr: fe80::211:2fff:fe9c:5725/64 Scope:Link UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:25370 errors:0 dropped:0 overruns:0 frame:0 TX packets:24317 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:487170767 (464.6 MiB) TX bytes:176525479 (168.3 MiB) Interrupt:5 Base address:0xe000 Memory:ff9fe000-ff9fefff

which shows bond0 being the master, and eth0 and eth2 being slaves.

It almost makes plugging and unplugging the ethernet cable fun. I can just sit there and keep replugging the cable alllllll day… :)

I’ve been using this setup for at least a week now and has been working very well. Please let me know if there’s anything I’ve missed, or any even better way of setting this up.

Howell Tam: Pikkoro – My Linux live system on a CF card

Wed, 2016-05-11 13:05

Since the last few times when I was in HK/TW, I’ve been thinking of having a Linux live system, installed on a USB stick or Compact Flash (CF) card, so I could simply plug it to any machine (say, those m$ windows box of my parent’s or my wife’s). I had been using the Ubuntu LiveCD, and it was really great. But then of course CD access is slow, and it’s read-only.

So I bought myself a 2GB CF card when I was in HK months ago. And I’ve finally finished setting Linux up on it. Host name “Pikkoro” (yes, yet another machine named after Dragon Ball characters), got Debian Etch (testing) installed, have it booting and running my own Linux system using a USB-CF card reader.

For those who are not familiar with the idea of a “live” system, it is basically an operating system (Linux in this case) installed on any media that can be used to boot on a computer. We all know the common setup of your computer booting the OS installed on your harddisk. So your harddisk is “bootable”. These days most computers can boot not only from a harddisk, but also from a CD/DVD, or a USB storage device (aka USB drive/stick). A live system would mean the OS/system can be run without installation. It won’t touch your harddisk (unless you want to).

So in my case, I have Linux installed and setup on my CF card, which can be plugged to a computer via a USB-CF card reader. The reason why i didn’t use a USB stick/drive is so I can use/read it on my iPAQ too, which has a CF slot.

Getting a Linux live system to work is pretty easy if you’re familiar with how Linux boots and how Debian works. Nevertheless I did some searches and reading on what other people have been doing, and I found this mini guide. What interested me is the localepurge package in Debian, which saved me a some disk spaces.

One of many things during the process was picking a window manager (notice how I said “window manager”, but not “desktop environment” :) I’ve been an AfterStepper (1.8) for a long long time. When I was doing FGLive I played with fluxbox a bit and I liked it. So I’ve decided to give it a go. After fiddling with it for a while, it’s official, fluxbox is now default on my Linux live CF. Its tab feature is probably one of the coolest. My only complaint so far is it not able to switch virtual desktop by mouse, and the fact that it only has concept of linear virtual desktops it seems.

Anyway, I’m now happy that I can carry around my own Linux system anywhere I go…