Sunday, July 29, 2007

text formatting with vim and vi

Vim helped me out twice over the last few days.

A virus spam complaint about our postfix server - could use the "find" command to easily locate the surrounding lines in /var/log/mail/info to show that it was just bouncing a virus mail.

Find (forward) in vi = /characters_to_find
Find backwards = ?characters_to_find
Find next = n
Find next in the opposite direction = N

The next tip was from a thread in the comments section of an article on freshmeat on how to make emails palatable to the Linux community.

we vim users have an extra-nifty trick available.
gq} will reformat the current paragraph, while magically preserving > > -style quoting!
gq/^--/-1 will do it from the cursor until your signature, which is even better.
The second part is not working for me - it complains about no match for ^--

But gq} works when there are paragraph breaks - two newlines.

Thursday, July 19, 2007

iBook + iCab, but no ethernet

iCab installed on the iBook, browsing is now up to par, but the ethernet port seems to be broken - switch light flashes green instead of steady green.

Getting DivX to work with TT's tutorial, updating software using the list at pure-mac.com - OldVersion.com is useful only for Windows software.

Update: Upgrading to Quicktime 6 broke DivX playback. Downgrading to QT 5 involved first removing QT6 and then installing QT5. Removing software on the mac = dragging all associated files to the Trash. Used Sherlock to find files with 'Quicktime' in their name. DivX works with QT5 and the 3ivX codec using DivX Doctor, but files with resolution 720x480, for example, play at some 10 fps, probably because the processor can't keep up.

Wednesday, July 18, 2007

GMail and Blogger not usable on the iBook with IE

Since the iBook had IE 5.1 for Mac, it doesn't recognize the xhtml mime type: this is discussed in the Wikipedia and elsewhere but Gmail and Blogger seem to have issues with it still. User-agent code needs a brushing up, probably. Finally got the previous post's text uploaded thru Yahoo Mail, since the USB port was recessed and the mem-key was not able to go in without an extension cable.

Short guide to the Mac for PC users

After "rescuing" the Tangerine iBook from M, I'm "trying to find it a good home". Since almost no one has used Macs here, I have this small guide to get them started.

Intro to an iBook for a Windows PC user:

1. In MacOS 9 and below, there is no Start Menu: you have to navigate to the app's location and double-click on it to start any application.

2. Menus remain at the top, closing the window doesn't shut down the app.

3. Just like Alt-F4 in Windows, use Apple-Q in MacOS to quit an app - or choose File -> Quit from the menu.

4. List of all open apps, something like the taskbar, is available on the rhs of the menu on clicking the button there.

5. The equivalent of Windows Explorer is called Finder.

6. Drag and drop the CD-ROM / removable disk icon to trash in order to eject a CD / removable disk.

7. The online Help system is quite good.

make a small planet


Daily Dose of Imagery has an interesting post on how to produce images like this.

Saturday, July 14, 2007

extracting audio from DVD

To get an audio-only file: guide at http://www.dvd-guides.com/content/view/136/59/
found via videohelp.com - the guide uses DVD Decrypter and Goldwave, I used WinAmp with Disk-Writer plugin instead of Goldwave for the .wav conversion. Initially, the WinAmp playback of the mp2 file and saving to file was buggy - clicks at every second or so. Found that it was playing back fine in Windows Media Player. Found some info at this page - http://www.free-codecs.com/download/MP4_Input_Plugin_for_Winamp.htm leading me to remove the mp2 extension in the list of the Nullsoft MP1-MP2 plugin and add it to the Directshow plugin instead. Then it works fine.

Ctrl-P in WinAmp -> Plug-ins -> Input -> Choose relevant plugin, hit the configure button, add / remove extensions in the File Association Extension list.

Tuesday, July 10, 2007

firefox download manager

Wanted a download manager with the option to queue downloads, so that our net connection wouldn't get overloaded with too many simultaneous downloads. DownThemAll seems to be a good solution. It has options for using as a download accelerator, too.

Sunday, July 08, 2007

wifi, SPDIF, tv out and dual display

More tests on the Acer Aspire laptop:

Wifi:
Wifi finally enabled thru ndiswrapper. It probably works with the Atheros driver from madwifi latest svn build, but didn't try it. Took quite a while get it working because I tried to take short-cuts which didn't work. First tried with the kernel source given in the DVD, didn't work since an update had upgraded the kernel from 2.6.17-13mdv to 2.6.17-14mdv. Then, I disregarded a forum post saying the latest madwifi patches will be needed, and madwifi stable didn't work. Then used old version of ndiswrapper on the DVD, didn't work with the Windows driver. Finally worked with latest stable ndiswrapper tar.gz. I've not tested with a hotspot, just saw that Mandrake Control Centre and ifconfig recognize the interface wlan0. Left it disabled since A doesn't have wifi at home.

TV out:
Works in Windows, NTSC, after going to Intel display properties tab after clicking display properties Advanced button, needs the connector to be plugged in before the settings appear. Doesn't work in Linux.

External Monitor:
Works in Windows and Linux, Windows has option of switching between Extended Desktop on CRT, Cloned Desktops on LCD and CRT, LCD only and CRT only modes, while on Linux Cloned displays on both is the only option. If external monitor is connected, BIOS, GRUB etc display only on the external monitor. When Ext Monitor and TV-out work, video overlays on those displays were working too - videos played in KMplayer and Xine for Windows and Linux tests.

Details of wifi exteriments:

Using http://madwifi.org/wiki/UserDocs/Distro/Mandrake/OldGuides

inside the madwifi directory, ran
make KERNELPATH=/usr/src/linux-2.6.17-13mdv 
make KERNELPATH=/usr/src/linux-2.6.17-13mdv install
cp -rf /lib/modules/2.6.17-13mdv/net/* /lib/modules/2.6.17-14mdv/kernel/net
Kernel couldn't load the module on modprobe.

)))))))))))))))))))))))))))))))))))))))))))))))))

Got new kernel source, did again. Then,
modprobe -v ath_pci
gives in /var/log/messages
Jul  2 09:43:21 aceraspire kernel: ath_pci: 0.9.4.5 (0.9.3.1)
Jul 2 09:43:21 aceraspire kernel: ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 17 (level, low) -> IRQ 17
Jul 2 09:43:21 aceraspire kernel: wifi%d: unable to attach hardware: 'Hardware didn't respond as expected' (HAL status 3)
Jul 2 09:43:21 aceraspire kernel: ACPI: PCI interrupt for device 0000:03:00.0 disabled

So trying ndiswrapper instead of trying cvs and stuff.

))))))))))))))))))))))))))))))))))))))))))))))))
Using the ndiswrapper installation instructions:

lspci gave
03:00.0 Ethernet controller: Atheros Communications, Inc. AR5006EG 802.11 b/g Wireless PCI Express Adapter (rev 01)

lspci -n gave
03:00.0 0200: 168c:001c (rev 01)

Next to check out the windows drivers and use them.

c:\windows\system32\drivers\ar5211.sys

C:\Program Files\Atheros\Wireless\Driver\net5211.inf

With the ndsiwrapper 1.21 which was included in Mandriva 2007.1, /var/log/messages gave
Jul  3 13:29:48 aceraspire kernel: ndiswrapper version 1.21 loaded (preempt=no,smp=yes)
Jul 3 13:29:48 aceraspire loadndisdriver: loadndisdriver: load_driver(361): couldn't load driver net5211
Jul 3 13:29:48 aceraspire kernel: ndiswrapper (import:241): unknown symbol: ntoskrnl.exe:'ZwDeleteKey'
Jul 3 13:29:48 aceraspire kernel: ndiswrapper (load_sys_files:215): couldn't prepare driver 'net5211'
Jul 3 13:29:48 aceraspire kernel: ndiswrapper (load_wrap_driver:113): loadndiswrapper failed (65280); check system log for messages from 'loadndisdriver'


)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

Finally installed latest stable ver 1.47 from ndiswrapper.sourceforge.net, installed wireless tools, now all ok.

Friday, July 06, 2007

making DVD slide shows

Found Windows and Linux tools for making DVD slide shows for K*R :
Windows: DVD slideshow GUI
Linux: Slideshow Creator

Edit: But they have their idiosyncracies... slcreator needs gambas, so I directly tried it's backend, dvd-slideshow. Dependencies like ImageMagick > 5.5.4, mjpegtools, dvdauthor were already on saispace2, so tried installing and running it from there. The bundled dir2slideshow script easily produces the required input text file. But Imagemagick (composite) gave errors - lines similar to these:
composite -compose src-over -gravity center -type TrueColor -depth 8
unknown option src-over.

Running dvd-slideshow on aceraspire - Running the program with the images located in a remote samba share gave an error, the smb share getting disconnected. Most probably some issue with samba on the aceraspire. Copied the pix locally and ran, all 605 pixs at once. Chugged along, each 2-second cross-fade taking nearly 15 seconds to render! But the whole process took only 2.5 hours for 1.5 hour long video file to be output as a vob.

Running DVD-slidehow-GUI on Windows on saispace2:
If captions are enabled, AVISynth subtitle engine gives an error when there are 18 or more images, saying can't find the temp file DVDsGUItemp.ssa even tho' it is in the path mentioned in the error dialog.
AVISynth Open Failure - TextSub: Can't open "q:\path\DVDsGUItemp.ssa"

I suspect it is because the program is addding too much white space at the beginning of the ssa file - with 1-2 pictues, the subtitling works, and as more pix are added, the ssa file gets more white-space at the beginning. And again, after removing the subtitles in preferences, the program works, but takes up so much memory that the system (512 MB RAM, 512 MB swap file) runs out of memory if all the 600+ images are added at once. So, doing them 100 at a time. It also takes roughly 4 times real-time - so a slide show of 5 minutes takes 20 minutes to prepare the MPEG2 file.

wget saves the day

K*R wanted some wedding pics of a relative, from a US photo site which I won't mention here. They had a painful java applet interface, one photo viewable every 30 seconds, for ordering only. Checked the code, found the path to the images, and wget was able to suck them all out easily! Used the following code from http://www.cyberciti.biz/tips/how-to-generating-print-range-sequence-of-numbers.html to create a text file of images:
for i in $(seq 605); do echo "http://url _ $i _ .jpg"; done > list.txt
and then used
wget -i list.txt --random-wait --wait=2