Archive for the ‘Linux’ Category

Skype Video, and a Logitech webcam

Saturday, January 5th, 2008

Was hardware shopping yesterday, and couldn’t resist getting myself a webcam, now that Skype 2.0 on Linux supports it (okay, its beta, but it works). Picked up a Logitech QuickCam Family for RM65. There was a more expensive version (RM10 more) that was “Skype certified”, but I figured I could save the cash, seeing that there is no way Logitech supports Linux officially anyway.

Did it work with Linux? Most certainly, on Fedora 8, it just worked. Of course, you need the livna repository. Just install gspca (it’ll pull in some kernel modules too), and then run modprobe gspca, and voila! you have a working webcam. Tried it with Ekiga, it was detected. Tried it with Skype, and even had a chat, with a user on Windows, and it worked. Glad to be webcam enabled.

Technorati Tags: , , , , , , ,

VirtualBox on Fedora 8

Wednesday, January 2nd, 2008

I managed to get my old Vista image created on Ubuntu Gutsy, to see if it would run under KVM on Fedora 8. Turns out I get a similar blue screen of death. Looks like it might be the splash screen of Windows causing KVM/QEMU to bork. Decided that it might be time to try VirtualBox.

No Fedora 8 RPMS are provided, so the Fedora 7 RPM will have to suffice. First snag? Lacking kernel-devel (by default, you now get kernel and kernel-headers). After installing that, its a simple sudo /etc/init.d/vboxdrv setup. Ensure that the user you’re running as, is also a member of the group vboxusers (you have to do this manually).

Starting up innotek VirtualBox is now a breeze. Though I have a feeling I have to run the setup everytime I get a new kernel (which is a problem in Fedora land, as there’s a rapid pace of development). This feeling was confirmed quite quickly, as I had a new kernel release almost immediately from the time I trialled this to the time I wrote this. At first glance, its an ugly application (Qt based).

Setting up a VM requires no KVM support, so in Fedora, this means removing kvm_intel and kvm from the running kernel. Good thing they’re modules, eh?

Setting up Window Vista was a breeze. Allocating it 1GB of RAM on my 2GB machine, seemed OK, as long as Firefox with multiple tabs weren’t running. Vista does something quirky - it pre-allocates all the RAM, probably by writing zeroes, and thus makes use of 1GB of RAM even before it starts. Oh well. At least I have Windows, and it performs, relatively well, so I can test software.

Networking? Much has been written about this, in fact, there’s even a ticket #504 for this. In fact, it was easy - Devices -> Install Guest Additions. Then get Windows to probe for new hardware, and add the network card. Very simple, quite unlike my KVM experience. If you for some reason want to mount the image itself, its located at /usr/share/virtualbox/VBoxGuestAdditions.iso.

Technorati Tags: , , , , ,

Secure travelling tips with iptables and SSH port forwarding

Thursday, December 6th, 2007

The general paranoia at conferences is such that there almost always is WiFi, and there almost always is someone wanting to snoop your traffic. I guess, in a similar vein, this could also happen at Starbucks. So, on day 1, at foss.in I tried to recollect what I used to do, ages ago (when I used to run Fedora on my R51, before the disk died, and I realised I lacked a backup of /root).

iptables
Firewalls break networks? They also secure networks. I have access to some legacy POP servers, that don’t support SSL/TLS like the IMAP servers I have access to. Firing up Thunderbird, to change the settings, to point to localhost, just seems like a waste of time. So the magic of iptables comes into play.

iptables -t nat -A PREROUTING -p tcp -d my.pop.server –dport 110 -j DNAT –to-destination 127.0.0.1:1235
iptables -t nat -A OUTPUT -p tcp -d my.pop.server –dport 110 -j DNAT –to-destination 127.0.0.1:1235

The above, ensures that to access my.pop.server:110, the traffic is automatically routed now to localhost:1235. Clearly, I don’t run a POP server on my laptop, so this is where SSH port forwarding comes into play.

SSH port forwarding
Provided you have access to a server via SSH, and you trust it, you can tunnel your traffic through it. Its made very easy by the:
-L localport:my.pop.server:foreignport

So using the above example, that would be -L 1235:my.pop.server:110.

Then, let’s not forget the useful -C option, to compress traffic.

And hey, web surfing isn’t secure either, so lets create a SOCKS5 proxy while we’re at it. ssh supports the -D option, which works a charm. Use it such that you have something like:
-D 8188

And now, configure your web browser, to use a SOCKS proxy, localhost:8188. You can also configure it in GNOME, under the Network Proxy, but it seems like not all applications respect it (for instance, I can get pidgin to segfault, and Liferea will not get RSS updates for some reason, etc.).

So to sum it up, your SSH command should look something like:
ssh -D 8188 -L 1235:my.pop.server:110 -C my.ssh.server

Discuss
Am I missing something? Do you have an easier iptables rule? Yes, I realise I can also use a VPN. If you have other tips, please don’t hesitate to comment. Thanks.

Technorati Tags: , , , , , ,

Mozilla party at Opus, summary of project days

Thursday, December 6th, 2007

foss.in is officiated. Atul is on stage, speaking and the room is filled up. The lighting ceremony happened, a while ago. “Only an Indian can give a keynote, at foss.in” - here comes the Anjuta keynote, by Naba Kumar. History of Anjuta? The name, was the name of his girlfriend, and now, its his wife (they have a cute daughter, whom we got to see at Opus last night).

Last night quite a number of us went to the Opus, for a Mozilla party. It was truly, a hip event. Lots of beer, lots of chatter, and there was even some local Indian scotch towards the tail-end of the night. We were having so much fun, we didn’t even realise dinner wasn’t around yet ;) Aizat and I wolfed down some amazing pasta in under 5 minutes around 11pm.

Kudos to Shreyas and Shilpa for ensuring we were all safe and sound (and Kishore who sent me home, since I missed the bus :P). It was great to speak with Tejas, Allen, Gopal and the rest of the crew.

Yesterday, spent some time in Juergen Schmidt’s talks in the OpenOffice.org Project Day. I tailed into another talk about translations in Kerala, who seemed to represent the government of Kerala to some extent. Translations alone don’t interest me, but finding out more about FOSS use in Kerala clearly does. I am after all, a Mallu ? I hope I got that right :)

Jumped to see Tom Callaway speak about Fedora Secondary Architectures, though there are some things there that I feel are a little incorrect with the idea behind it. Build machines, not hosted by the Fedora Project? Wrong. Packages and the distribution itself, save for the torrents, not hosted by the Fedora Project? Wrong. Allowing a build of software to fail on a secondary architecture? Wrong. Allowing the secondary arch maintainer to fix broken packages? Smart. Though honestly, I think this might end up having to becoming a team.

Rahul Sundaram’s talk about spins was great. Considering I was building LiveCDs before there were tools, to do so, I’m glad that there are so many ways to do so now (easily, even). And of course chit chatting with him over beer at the Opus later, was fun.

Anyways, time to pay attention to the Anjuta talk. Not a big fan of IDEs myself, but I’m seeing the need for it (for folk that aren’t comfortable with vim).

Technorati Tags: , , , , , , ,

Days 1 & 2 at foss.in 2007

Wednesday, December 5th, 2007
I’m in Bangalore for foss.in. Its the second day now, of the 2-day project days (think of this as linux.conf.au MiniConfs).

Yesterday, my agenda was around the Mozilla Day - spent most of the morning, listening to Mozilla-related extension talks. I ran away the moment they talked about accessibility and localisation, and spent some time in the Hack Centre, which was just tables, chairs, WiFi and good hacking :) Then hopped into the GNOME project day, to listen to Ritesh Khadgaray tell us about how to hunt bugs. I continued spending the rest of my day there, for what its worth.

Dinner, at MG Road. Wonder if there are other locations to eat? I mean, I’ve extensively walked around the MG Road area, around Brigade Road, Church St, and so on.

Today, I’m going to jump between the OpenOffice.org and Fedora project days, both of which are projects close to my heart.

Of the 2,700+ registered jokers, the project days certainly seem a lot smaller than I’d have expected… Under-1000 attendees maybe? I guess this will pick up certainly during the main conference.


Photo by aizat

WiFi works wonderfully well at the conference. I’m actually shocked! Has to be one of the few conferences that have got Internet access working. Maybe I should knock wood in case this disappears soon…

Technorati Tags: , ,

Size differences between WAV, OGG, MP3

Sunday, December 2nd, 2007

Ever since getting the Sandisk Sansa e280 (yes, so much better than the iPod Nano, if you must know), I’ve been interested in the Voice recording feature. I fiddled with it today, to give it a bit of a test, as I plan on conducting audio interviews.

Once recorded, it outputs WAV files. This is easily accessible in Linux, in the RECORD folder. So I played around with converting the original WAV file into an OGG and MP3. Quick findings:

  • WAV:  RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz size at 1020K
  • OGG: Ogg data, Vorbis audio, mono, 16000 Hz, ~48000 bps, created by: Xiph.Org libVorbis I, sized at 148K, converted via oggenc 071203_01.wav -o 071203_01.ogg
  • MP3: MPEG ADTS, layer III, v2,  24 kBits, 16 kHz, Monaural, sized at 104K, converted via lame 071203_01.wav

This was on a clip that was 32 seconds in length. The MP3 is smaller than the OGG, and there’s no noticeable sound difference between all the 3 formats. Is there something to make the OGGs generated by oggenc smaller? I’m happy if they just match the MP3 file sizes, to be honest.

Time to start podcasting? :)

Technorati Tags: , , , , , , ,

Why I liked Ubuntu (and my thoughts on Gutsy Werewolf, aka Fedora 8)

Thursday, November 8th, 2007

One of the reasons I like Ubuntu is because they have a really swanky commercial repository, and they make it easy for me to get some commercial software, without pulling an RMS-styled “Freedom is a feature” on me. Don’t get me wrong, I still love Fedora with all my heart, but when you get out of the distribution business per se, you feel that you might just want your primary machine to “Just Work”(tm). And long gone are the days where I carry 2-3 laptops when I travel - I just aim for one (I have lots of photo gear to worry about, instead).

The Feisty Fawn, was a pretty good Ubuntu release. That is, I got my commercial software fix - Sun’s JDK (moot these days, hello IcedTea in Fedora, for instance), VMWare Server (its free, kind of useful for running other distributions), and even Opera (sometimes I’m bored with Firefox, Galeon, Epiphany, I need to test things in another browser).

When Gutsy Gibbon got released, I couldn’t wait to update to the next, best thing. You expect things to move forward, never regress right?

Well, Sun’s software still works. As does Opera. But VMWare, has since, stopped working. Kernel 2.6.22-14 does not come with appropriate VMWare modules. Yes, that means, there’s no vmmon or vmnet loaded (or even, loadable, to be exact). Effectively, they’ve broken VMWare. I wondered why, so I hopped on to a package search, only to find out that VMWare has been removed from the commercial repository. No real explanation that I can find as to why it doesn’t exist.

So, my next option is to maybe build-my-own-package. There’s a guide titled VMWare in Ubuntu Gutsy - Kernel 2.6.22 that might be a good read for those that want to use this. Then I recall why I moved to using Ubuntu daily - I did it to get away from the frustration of having to build things myself. I did it, for the “Just Works”(tm) experience.

My options are to move to using some free software, quite obviously. There’s KVM, Xen, or even VirtualBox. Hey wait a minute, I can get all this in Fedora 8 too, can’t I?

The Gutsy Gibbon was supposed to come with a rocking new tool, displayconfig-gtk (i.e. System -> Administration -> Screen and Graphics). Unfortunately, it is broken beyond all thought. Then I remember an old friend, system-config-display, from Fedora - at least it works, and it has been around for ages (since what, Red Hat 8?). displayconfig-gtk is supposed to give me all the wonderful hotplug goodness of an external display, but it doesn’t. I can manually push xrandr to at least mirror my display (Intel chipset, might I add), which I’m sure I can also do in Fedora 8.

So I’ve come to the realisation that things are broken, and I’m going to have to do things manually, if I want them to work. This is irrespective of if I run Ubuntu or Fedora. Being just an “end user” is hard, to almost impossible.

My needs-to-work-list:

  • sleep/resume - this can also be kernel version dependant, Ubuntu has the advantage for a less aggressive release policy, but it seems Fedora is catching up with wanting to ensure laptop stuff, just works
  • wifi - ipw3945d is my poison, and it seems that both Fedora and Ubuntu have this working out of the box (a stark improvement to previous Fedora’s where you had to get the firmware yourself). Of course, repeated sleep/resumes tend to make WiFi die, and that just annoys me
  • video out - this is hacky at best, Ubuntu works if I tweak things manually, I wonder if Fedora 8 will have this any better. Nonetheless, xrandr should come to my rescue
  • sound - well, my laptop is my primary music listening device as well as video watching device. Ubuntu and Fedora should have this working just fine
  • codecs - I need to watch DivX, play MP3s, and so on. Ubuntu provides this via Medibuntu and Fedora via Livna
  • media keys - Ubuntu and Fedora should have this working fine, and GNOME in both environments is highly friendly
  • virtualization - I don’t care if I end up using KVM (which is looking like what I’m going for), or Xen (no ACPI, and obviously can’t sleep/resume), but I think I’ve had it with VMWare unless they have sensible packages. I have useless VMs sitting on my laptop now.
  • fully 64-bit OS - I plan on moving on from 2GB of RAM to 4GB of RAM (its kind of cheap nowadays), and want a fully 64-bit OS. Ubuntu works, sure, but I have to have ugly chroot hacks for a 32-bit environment. Fedora just works, some say because RPM is broken but I say, if that’s the case, its broken in a good way. Mixture of 32/64-bit rpms, are sweet
  • Skype, GizmoProject - closed source, install your own, works on Ubuntu and Fedora

My “it’ll be nice if it worked” list:

  • compiz effects - Doesn’t seem to work on Ubuntu, I wonder if Fedora will have it any better
  • hibernate - not quite suspend/resume, but it can be handy to have around
  • sd/mmc/memory stick card reader - Doesn’t seem to work on Ubuntu (Feisty, last I tried it)
  • tv out - Never tried, but if video out is this bad, I doubt s-video is any better

I take it that’s enough ranting for today. Congratulations to the Fedora Project for releasing Fedora 8 today. I think Werewolf will be a gutsy release alright.

And a happy Diwali/Deepavali to all Hindus. As an aside, the number 8 is interesting - in Chinese, it loosely translates to being lucky. And November 8 2007 seems to be the “festival of light”. The only way it could’ve been any more numerically lucky is if it were released on 08-08-2008 (a day for a lot of weddings, I assume).

I seem to enjoy asides today, so here’s another. I ran dict gutsy, and it has some interesting definitions:

  gutsy \gutsy\ adj.
     1. marked by courage and determination in the face of
        difficulties or danger.
       Syn: courageous, plucky.
      2. rough or plain; not sophisticated or refined; earthy.
        Opposite of {sophisticated}, or {refined}.
       Syn: earthy, lusty, robust.

I wonder if, definition-wise, Gutsy Werewolf is #1 and the Gutsy Gibbon is #2?

Technorati Tags: , , , , , , , , ,

RAW Management and Conversion in Linux

Tuesday, November 6th, 2007

Today, I was playing around with Linux, and RAW management. Not wanting to carry a laptop just for photo editing (i.e. I plan on travel without my MacBook Pro, and beautiful Lightroom, Aperture, iView Media Pro [okay, Microsoft Expression Media now], and Photoshop CS2), I figured I should make Linux up to scratch.

My favourite photo browser, is GQview. Its not standard software any longer, but its pretty old, and it works fairly well. It however, doesn’t support RAW. Today I discovered f-spot (ok, I discovered it ages ago, but I didn’t like its iPhoto-ness, where it wants to import stuff for you). Never fear, that’s what

    f-spot –view <path>

is for. Shortcut wise, its a little different, so I just use the up/down arrow keys to browse.

Now to convert the RAW files to JPGs, with preservation of EXIF data. I played around with the commands manually after reading the man page for dcraw, and figured there must be a better way. So I hopped on over to Yahoo!, did a little search, and came up with Jamie Zawinski’s mvpix. After changing the script a tad bit to suit my environment, I have images! RAW, JPEG, and copies of the JPEGs in an EDIT folder. mvpix also works on OS X.

The options being passed to dcraw seem to be simple: -w for using camera supplied white balance, -t 0 for no tilting, and -c for writing decoded images to stdout. Its passed to cjpeg, and run at 95% quality. However, the images seem to be a tad different, and I have no idea why.


On left, is when the camera was shooting in RAW+JPEG, and on right is the JPEG generated from the RAW file (click for larger image). These are 100% zooms.

The colour differences befuddles me. Why does the camera come out with “brighter” RAW, and dcraw come up with paler tones?


On left, is what the in-camera JPEG gives, when you’re shooting in RAW+JPEG, in the middle is what UFRaw sees from the RAW file, and on the right is what the converted JPEG looks like, after being parsed through dcraw+cjpeg (click for larger image).

What gives? Are there better options in dcraw to give me an as-close-to-in-camera JPEG experience? Are the converted images better/more true coloured? I’m not sure which to pick, and I’m not sure what’s the correct setting, to be honest.

Now about the photos. Apologies to the girl pictured here, all I know is that she’s probably a student at the Caulfield Campus of Monash University (so no, I don’t know her name). She was randomly picked for some quick studio photos, which was really just a bunch of us playing with a few studio strobes, and having the power of wireless triggers. These photos all rolled off an EOS 350D digital back, with a 50mm/1.4 lens attached to it, shot at f/1.6, at 1/25s. Sure, this should have really been made at f8, but there was no time to coax the girl.

Technorati Tags: , , , , , , , , ,