Sunday, November 29, 2009

OpenVPN on the DNS-323

There are times I want to grab files from my trusty DNS-323 when not at home. Recently I found time to try opening up access to it using OpenVPN.  This post shows the steps... and it really is simple to setup. I tested the process with Linpus, Fedora 12 and Windows XP as a client, and all went smoothly.

Friday, September 18, 2009

Transcoding MJPEG to Xvid

Videos from the Canon IXUS 80 weren't playing properly for me either with VLC (Linux or XP) or Media Player.. so I thought I'd try transcoding them. It worked nicely.
See my earlier posts for the transcode install process.

Input file -
[user@aspireone ~]$ tcprobe -i MVI_2282.avi
[tcprobe] RIFF data, AVI video
[avilib] V: 30.000 fps, codec=MJPG, frames=7607, width=640, height=480
[avilib] A: 44100 Hz, format=0x01, bits=16, channels=1, bitrate=705 kbps,
[avilib] 254 chunks, 22364580 bytes, CBR
[tcprobe] summary for MVI_2282.avi, (*) = not default, 0 = not detected
import frame size: -g 640x480 [720x576] (*)
frame rate: -f 30.000 [25.000] frc=0 (*)
audio track: -a 0 [0] -e 44100,16,1 [48000,16,2] -n 0x1 [0x2000] (*)
bitrate=705 kbps
length: 7607 frames, frame_time=33 msec, duration=0:04:13.564

Transcode to Xvid -
transcode -i MVI_2282.avi -y xvid4 -o MVI_2282.xvid

Output file -
[user@aspireone ~]$ tcprobe -i MVI_2282.xvid
[tcprobe] RIFF data, AVI video
[avilib] V: 29.970 fps, codec=XVID, frames=7606, width=640, height=480
[avilib] A: 44100 Hz, format=0x55, bits=16, channels=1, bitrate=128 kbps,
[avilib] 7606 chunks, 4055761 bytes, CBR
[tcprobe] summary for MVI_2282.xvid, (*) = not default, 0 = not detected
import frame size: -g 640x480 [720x576] (*)
frame rate: -f 29.970 [25.000] frc=4 (*)
audio track: -a 0 [0] -e 44100,16,1 [48000,16,2] -n 0x55 [0x2000] (*)
bitrate=128 kbps
length: 7606 frames, frame_time=33 msec, duration=0:04:13.786

The other benefit -
[user@aspireone ~]$ du -h MVI_2282.*
435M MVI_2282.avi
59M MVI_2282.xvid

Sunday, September 13, 2009

Tomcat on DNS-323

Given my lack of success with bridging for VirtualBox, I thought I'd try starting Tomcat on the DNS-323.

Starting with hope provided by this post.

The process was remarkably easy. Follow this post to get optware setup.
Then install the jamvm optware package.
Next, follow this post to install Tomcat.

It's a bit of a memory hog,
Mem: 60260K used, 1644K free, 0K shrd, 11220K buff, 8916K cached
CPU: 1% usr 0% sys 0% nice 97% idle 0% io 0% irq 0% softirq
Load average: 0.03 0.06 0.18
PID PPID USER STAT VSZ %MEM %CPU COMMAND
30766 30688 root S 40204 65% 1% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30687 30686 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30767 30688 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30835 30688 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30824 30688 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30836 30688 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30690 30688 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30691 30688 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30689 30688 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30768 30688 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak
30688 30687 root S 40204 65% 0% jamvm -classpath /opt/share/classpath/glibj.zip:/opt/jak


and painfully slow -
INFO: Server startup in 151671 ms

but it seems to be reasonably functional... although trying to run a database as well on the DNS-323 would be a stretch.

Wednesday, September 9, 2009

VirtualBox Bridged Mode on Linpus

I wanted to run TurnKey Tomcat in VirtualBox, and use bridged network mode to make the tomcat available on my LAN. Easy I thought...

The basics of setting preparing the host Linux environment I found this post.
However, the Linpus kernel doesn't have
- TUN/TAP support built in the kernel... so I turned to this post.
- Bridge support... so it was time to build my own kernel, for which I turned to this post.

I then discovered that Linpus has a custom build of Grub, that doesn't show a menu on boot... which was something of a problem, as my kernel, built with 'CONFIG_BRIGE=y" did not work properly - the mouse and keyboard didn't seem to work.

I hope to replace the Linpus grub with a more standard variety... but this I'll save for another post. I want to make sure I have a safe procedure for restoring the original version first.

On a side issue, I tried using
- Damn Small Linux (DSL) for recovery - but it hung whilst booting.
- RIPLinux - at first this didn't seem to work either... until I found that by first running it's hardware detection tool, and then running grub, it worked nicely. Strange incompatibility with the Aspire One I suspect.

For my kernel second build, I tried with bridge as a module, CONFIG_BRIGE=y. This worked nicely.

I then hit this error - VERR_SUPDRV_COMPONENT_NOT_FOUND which is easily resolved by modprobing, see this post.

Then, to my horror, I found that Linux bridging doesn't work on WIFI - see this post.

If anyone tries this procedure, and gets it to work, perhaps against a regular Ethernet port, I'd like to hear your experiences.

Monday, July 6, 2009

Snapshots in VirtualBox

Firstly, I want to give credit to this thread - as it steered me onto the right path.

The way snapshots and virtual media (hard disks) work in VirtualBox is clearly not entirely obvious to the newbie, myself included. If you don't understand it, it looks plain buggy... however once you've understood it... there is reason in the madness - and more importantly it works!

In VirtualBox there are 3 types (or modes) of virtual hard disk images, Normal, Immutable and Write-through. These are fairly well explained in the manual - I highly recommend reading at least that section of the manual, as it also helps make sense of snapshots.

I'll discuss only the 'Normal' image type here. This is the default type set, when you create a new machine and hard disk. You start up your guest OS, and everything works nicely. You try powering off the machine, saving the state, everything works as you'd expect.

Then you see the 'Take snapshot' option, and try it. Now, you need to understand how they work - whether you know it or not :)

The snapshot stores the machine state, just like the 'current state' you've used up until now. It also contains a differential image of the hard disk. Ie. from now on, the (normal) hard disk image file (eg. xp.vdi) that was previously being updated, is no longer updated. Instead, when your guest OS writes to disk, it writes into the differential image.

If you create another snapshot, a new differential image is created, so now, the current content of the hard disk is stored across 3 files, the original, and the two snapshots. This of course gives the possibility to go back to an exact, earlier copy of the entire system (including hard disk).

So what's the problem?

Snapshot files, including the differential hard disk image aren't particularly portable. So whilst you can easily move your original hard disk to different machines, moving the updates in your differential files is difficult. Unless you run on basically the same host machine, with the same vbox version you can restore the changes from your differential images.

Or can you?

The solution is to discard your snapshots!

Sounds dangerous? Well, not quite as dangerous as it seems. When you discard a snapshot, it merges the differential image into it's parent image.

So, if you have snapshots like this -
- Snapshot 1
- Snapshot 2
- Current State
And discard 'Snapshot 2', the differential image changes will be merged back into Snapshot 1, leaving -
- Snapshot 1
- Current State
Then discarding 'Snapshot 1', will merge back into your original hard disk image 'xp.vdi'... leaving no snapshots, but also a portable hard disk image.

I recommend experimenting by taking a snapshot, then create some files in the guest OS, and then create another snapshot. Then discard away, and see that the files survive.

Sunday, June 21, 2009

Commodore 64 on the iPhone

Well this is totally off topic, but it has two strong connections to my past. The C64 which I spent countless hours programming and hacking in my youth, and and old friend, whose personal company developed the product.

So go ahead and take a look -
c64iphone
Full Commodore 64 emulator rejected from App Store

Wednesday, April 29, 2009

Tiresome

But just because they bug me so much, here's the latest spammer from my www logs -

118.168.136.169 - - [29/Apr/2009:13:54:46 +0200] "CONNECT maila.burst.idv.tw:25 HTTP/1.0" 501 357 "-" "-"

Thursday, January 15, 2009

Hack attempt?

In my web server logs I regularly see the following -

211.95.78.70 www.ocnar.com - [14/Jan/2009:07:12:00 +0100] "POST http://www.ocnar.com/cgi-bin/textenv.pl HTTP/1.1" 404 345 "-" "-"

I'm assuming it's some kind of hack... but googling it didn't turn up much. Can anyone enlighten me?

Sunday, January 4, 2009

Using Sony Ericsson P1i as a GPRS/3G modem on Acer Aspire One

As I got the Aspire One just prior to travelling, I didn't have time to test using it for internet connectivity using my Sony Ericsson P1i as a GPRS modem. As I'm travelling again soon, I decided to iron out the process in advance.

First I tried using Windows XP running in VirtualBox, with the normal Sony Ericsson tools. This worked largely without any hitches.

On to Linux (Linpus Lite), using a post on bayan ni juan as a reference.

Here's how to do it -

Check to see that the phone is detected when you plug it in. You should see something like the following.

[user@localhost ~]$ dmesg
usb 3-1: new full speed USB device using uhci_hcd and address 2
usb 3-1: configuration #1 chosen from 1 choice
cdc_acm 3-1:1.1: ttyACM0: USB ACM device
cdc_acm 3-1:1.3: ttyACM1: USB ACM device
cdc_acm 3-1:1.5: ttyACM2: USB ACM device
usbcore: registered new interface driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters

Check that wvdial is installed. It seems to come with the Aspire One.

[user@localhost ~]$ yum list wvdial
wvdial.i386 1.60-3.fc8 installed

Install gnome-ppp

[user@localhost ~]$ sudo yum install gnome-ppp
Installed: gnome-ppp.i386 0:0.3.23-4.fc8
Complete!

Run gnome-ppp -

[user@localhost ~]$ gnome-ppp

Unfortunately it needs to run as root to access the modem, so give the root password (or invoke via sudo).

Click Setup
Click "Detect" to detect the modem
It should find /dev/ttyACM1
Speed 460800

Add the phone number for GPRS *99#
Phone numbers, *99# (you can use *99***10# to use profile 10 from the phone. I have the phone setup for WAP etc already, so this seems to be unnecessary).

Under init strings, my operator Telia suggests AT+cgdcont=10,,"online.telia.se"
this seems to be unnecessary, perhaps for the same reason cited earlier.

All other settings I left unchanged.

Quit and re-run gnome-ppp (perhaps not required)

Give a Username (test)
Give a Password (test)
Check the box "Remember password"
This seems to be required to workaround a bug in gnome-ppp. Without the box checked, gnome-ppp doesn't respond to the wvdial prompt "Please enter password (or empty password to stop):" - it took me a while to figure this out :)

Press connect, and hopefully you'll get a connection, with IP address, DNS etc.

Saturday, January 3, 2009

Alt Gr dead in java gui apps

Its time I blogged about a bug. This one isn't very interesting, but it is annoying. Internationalisation is one of those seemingly simple things that is so hard to get right, due to the huge combination of settings, and solutions.

Whilst trying to do some coding in Netbeans, I found the Alt Gr key not working on my Swedish/Finish keyboard. Pretty important as it gets you the { and } keys! What's so frustrating is that the keys are working perfectly in every other app I've used.

After checking this Netbeans article, I found the solution here in Ubuntu's bug tracker.

$ XMODIFIERS='' /opt/netbeans-6.1/bin/netbeans

Friday, January 2, 2009

VirtualBox on Acer Aspire One

I'd started to install VMware on my Aspire One (Linux), when I came across
macles* post on VirtualBox. In a couple of hours I had it up and running, with Windows XP as the guest OS, nice.

When reading about VirtualBox, the thing that excited me most was the support for USB devices - ie. it can 'pipe' them through to the guest OS, such that devices not supported in the host OS can be used in the guest OS... nice.

So I gave it a try - first was my HP Laserjet M1005 MFP, printer and scanner - no problems. Install the drivers (in XP), plug in the device, tell VirtualBox to enable it, XP detects it and out comes the test page. Similarly for the Scanner. Mounting ISO images of CDs (eg. install CDs) works beautifully too, something XP itself isn't so good at.

Then the Sony Ericsson P1i PC suite. This is a buggy thing to start with... I can no longer get it to install on my Vista work PC, how about XP under VirtualBox? Basically, no problems! I may have to run VirtualBox on my Vista laptop too :)

It's really nice when things work so well.