Unkillable zombie blog

This blog just won't die

Jul 14, 2007

Making my Sony Handycam HDR-UX3 work with linux (almost)

I was recently given a Sony Handycam HDR-UX3 video camera as a present (yea!). This camera can record at in HD format ( 1080i ) and records straight to DVD. It’s a very new camera and not much info about making it work under linux, so here what i can up with.
First, reading the MemoryStick Duo that contains any images is straightforward. Just plug the USB cable, select the memory stick from the LCD and you get a new device that you can mount as usual.
I have not tested HD video. Just SD video using a DVD-VR disk. Again, plug in the USB cable, choose the dvd icon on your camera’s LCD and you get a new /dev/sr* device. (eg. i got /dev/sr1 sicne i already had a /dev/sr0). This can be mounted as a normal file system (i believe it’s UDF 2.0 so your kernel must support it, which it should).
Now, the tricky part is extracting the video. The only program i could find that does this is here . Just download, untar and compile (typing ‘make’ should be enough.)
Assuming you have mounted the camera at /mnt/mycamera you simply type:
/dvd-vr VR_MANGR.IFO VR_MOVIE.VRO
to extract the .vob files. Eg in my case:
./dvd-vr /mnt/mycamera/DVD_RTAV/VR_MANGR.IFO /mnt/mycamera/DVD_RTAV/VR_MOVIE.VRO
And that’s it!
It seems that if you are using 16:9 recording the ratio is not right, but i chose ‘anamorphic’ format under xine which fixed it.
It’s rather simple, and easy to use. You can even eject the disc by typing:
eject /dev/sr1
 Enjoy.
Click to read and post comments

Jul 11, 2007

doesn’t pownce.com support unicode properly?

I was invited to pownce.com today. It’s a hot new Web 2.0 messaging applications that is also developed by a really hot developer in a hot language using a hot framework.
It’s still in BETA and the new accounts are invite only. I suspect that most people have accounts and the whole ‘invite’ thing is a way to make it sound cool. After all, upon registration you get 6 invites automatically. It’s not like they are controlling how fast they grow like google did by giving invites using their own criteria to control growth.
Being in BETA it means there are bugs, and features missing. It seems that one particular bug is rather significant. My Greek friends tried to send messages in Greek (in unicode encoding) and all they got was question marks. Not being able to communicate in my native language is a major bug. I am also a little curious as to why this is happening. Django and Python have excellent unicode support, Mysql (horrible as it may be) has unicode support, so what gives?
Click to read and post comments

Jun 26, 2007

Lambda Lives!

It seems that Guido Van Rossum has decided to keep lamda for Python 3000 (or as it will be called when release.. Python 3.0.
I can’t say i like all of the proposed changes. It starts to feel more and more like Java, though that may not be necessarily a bad thing.
It’s backwards incompatibly in a significant way, so don’t expect major applications to be ported right away (or at all!)
posted at 00:19  ·   ·  python
Click to read and post comments

Jun 17, 2007

Validating Greek VAT code (έλεγχος Α.Φ.Μ)

I recently had to validate the VAT code entered in an internetl Django application. Searching around lead me to this site. The implementation there is Visual Basic though, which wouldn’t suit me. So i translated it to Python as best as i could (given i don’t actually know any VB :p )
Here it is:
def isValidAFM(afm):
    if len(afm) != 9:
        return False

    try:
        int(afm)
    except ValueError:
        return False

    AFMpart = afm[:-1]
    afmsum = 0
    multiplier = 2
    for c in AFMpart[::-1]:

        afmsum += ( int(c) * multiplier )
        multiplier *= 2

    if not afmsum:
        return False

    afmmod = afmsum % 11

    lastdigit = int(afm[-1])
    if lastdigit == afmmod:
        return True
    elif (lastdigit == 0) and (afmmod ==10 ):
        return True
    else:
        return False

Caveats:
  • I don’t know if the actual algorithm is valid since my search for official documentation turned up nothing. It seems to be accepted by a large on-line community of accountants though, and that’s good enough for me.
  • I have not tested it much. You at your own risk, as always
posted at 13:54  ·   ·  python
Click to read and post comments

Jun 07, 2007

Xine pvr:// undocumented feature

I am happy owner of a Hauppage WinTV PVR 150 card. On linux, both mplayer and xine support it but xine has special support for it (in the form a special MRL for it nonetheless) so this is why i prefer it.
The problem i had was that the PVR input for xine by default uses  the root directory to store its temporary vob files. The partition that my root is located however is rather small and i could only have very small files (and therefore very small recordings if a paused or wanted to go back in a video).
I wanted to change this location but there is nothing on the documentation. A quick Google search turned up nothing. So i looked in the source code and , sure enough, the kind folks had it documented in the comments of src/input/input_pvr.c. 

pvr:/<prefix_to_tmp_files>!<prefix_to_saved_files>!<max_page_age>

In other words all you have to do is specify the path in the MRL! Eg:

xine pvr://mnt/xine_pvr_tmp_files/

There are more settings there (like events you can send to tell xine you want teh recording saved instead of being deleted on exit, but i haven’t explored them yet.

Update: I was at #xine on freenode.net and told people about this. 10 minutes later it was fixed in the CVS.  Now that’s responsive.
posted at 21:50  ·   ·  linux
Click to read and post comments

Jun 07, 2007

Defense against ssh brute force attacks

I have ssh daemon open on this server and accessible to the internet. I need it since i need to access my computer when i am away. Recently, however, i became the target of brute force attacks against sshd. I would block the offending IP using iptables but this would only last a few hours until the next attacker (from a different IP obviously).

I thought if snort and rules that exist to update iptables automatically but a) that would be a lot of work to setup and b) snort would brock my old computer to its knees (PentiumII  with 64Mb ram).

Yesterday i came across denyhosts which is a Python program (yay!) that detects intrusion attemplts and adds them to /etc/hosts.deny. It has a lot of nice features, its easy to setup  and quite effective. (well… its Python.. what did you excpect)

Seems quite cool, and it doen’t need snort and plugins and hours and hours of configuration and reading.
Click to read and post comments

Jun 07, 2007

Slashdot story accepted

It seems that a story i submited  to slashdot was accepted and became this story  which appeared in the front page.
They did change it than i originally submited it, as i had mostly copy-pasted the story from the blog of Asteris Masouras.
The story is about the arrest of Tsipropoulos of blogme.gr which you should know by now so no link for you (well, i am lying,  asteris blog has all the information you need).
Click to read and post comments

Jun 07, 2007

Moving to Patras

I came to Athens in the summer of 1997. The time has come for me now to return to Patras.
I will be taking the server off in a few hours since i am transfering all the equipment to Patras.

I don’t yet know if adsl access is available in the area of my new residence there there is a chance i won’t be able to bring back my server very fast.  If that’s the case i will try to find a hosting provider, but that may be somewhat expensive (since it will have to support python, webware, cusomized python packages, and an array of other things) i am probably looking for virtual server solutions :)

I have been living for almost 10 years in Athens and i have good friends here that i don’t want to loose.
At least i have a hope that i will reuinite with friends i left in Patras when i moved to Athens.

The distance between Athens and Patras is 216Km and about 2:00 -2:30 hours travel. Not that far i guess. Getting to some areas in Athens takes more time than that :)
posted at 21:48  ·   ·  stuff
Click to read and post comments

Jun 07, 2007

The benefits of Web 2.0: Server side blink

Long ago, Netscape introduced the world to the wonders of the amazing <blink> tag. Unfortunately, the blink tag never really cought on. This failure should be attributed to the non-standard nature of the tag, which in other words means that it only works on Netscape (and Mozilla/Firefox).

With the introduction of the Web2.0 it has become apparent that we are in need of a portable, enterprise and robust manner in which to implement this feature. Ajax, enables us to achieve this goal.

Ladies, and gentlement …. the server side blink
posted at 21:48  ·   ·  ajax  humor
Click to read and post comments

Jun 07, 2007

MgOpen fonts ebuild for Gentoo

The people at Magenta.gr have released some fine Greek fonts for free. They are available at:  http://www.ellak.gr/fonts/mgopen

For Gentoo users i created an ebuild that will do the installation for you.  get it here. This is my first attempt at creating an ebuild but it is the simplest of ebuilds and it should work without problems. It works fine on my computer anyway.

Just put in in your portage overlay, digest it and emerge it. If you don’t know what i am talking about, then google for this (there is plenty of material on using portage overlay out there, i won’t repeat it here. It’s easy though)
posted at 21:48  ·   ·  gentoo  linux
Click to read and post comments
← Previous Next → Page 7 of 8