Cowon iAudio D2+ and Linux – First impressions

After countless efforts to make my Sony NWZ-A816 work the way I wanted, I decided its time for an alternative. I do like the Sony devices for their quality but they want me to use WMP to sync my music which I am not willing to do and never will. What’s worse, is there is no way to create a playlist from the device.
So, goodbye Sony! and I found something that states in the spec that it supports Linux.

The D2+ is an anniversary gift from my wife and is looking good so far..Here are my findings

  • The device mounts in MSC or MTP mode
  • I could get album art support with the image in the album folder. I used cover.jpg for the name
  • Amarok 2/Songbird/Rhythmbox did not detect it though. Can’t say anything about it right now. Need to test more
  • Encoded videos using Avidemux and they play fine. I had created a custom config based on the specs. Basically I used the following
    Video - Xvid4, 29.970fps, 320x240
    Audio - MP3(Lame), 128kbps, 44100Hz
    Container: AVI

ToDo
How to create Playlists?
Sync with Local collection

Why I still like ‘Kangal Irandaal’

It’s been a while since the movie is released. This is still one of my favorites though I listen to A.R.Rahman a lot

Reasons…

  • has a feel of ilayaraja’s music in the 90′ s or before…
  • the music – James Vasanthan has done a really good job
  • excellent lyrics…
  • excellent voices of Belly Raj and Deepa Mariam

the movie had a tragic end…but the song will be in memory for a long time..

liked this line very much..

Pesa enni sila naal arugil varuvaen…
Pinbu paaravai podhum ena naan …ninaithaen…
Nagarvaen..eemaatri

roughly translates to…

sometimes….I come near you to tell something..
I then thought… a glance would suffice….
I moved away…deceiving you..

VLC for screencasting

I was looking for a way to create screencasts of my desktop. I tried the following options but was not completely successful(yet) in getting a video out of it.

  • xvidcap
  • recordmydesktop
  • istanbul

Today, I found out that it is possible to do a screencast using VLC!(1, 2) I have known about VLC for a long time and its capability to play multiple video and audio formats but never knew it could be used for recording the desktop. Will need to test further to see if I can get a usuable video.

The Making of Linux Revolution video

…for ‘We are Linux‘ video contest held by the Linux Foundation

My entry is here

I came to know about this contest mid-february and wished to participate in it. I have been a Linux user for almost 10 years now and know very well about its strengths. After thinking for a couple of days, I got the idea of using Cats to convey the following features of Linux – Stability and Speed, Security, Control and Freedom.

After the idea was conceived a simultaneous search began for the right tool and source material.  For the software, I was confused what would be appropriate, whether I should do a 2D or 3D animation or use sideshows with music etc.,  I tried to use the latest version of Kdenlive, but it crashed a couple of times, then came LiVES, which had no or limited documentation. Pitivi would not even start on my openSUSE 11. Days were running by and I had to hurry up. I even tried to use OpenOffice Impress. But if I am using impress, I would have to compromise on my original idea of using images and videos together.  At last I found Blender!

I had know about Blender before – when they released their first movie and the recent Big Buck Bunny. I had installed and tried to use it before and never understood how to use it. By chance, I came across the use of Blender for video editing, compositing etc., After a couple of tutorials online, I got started. I had difficulties rendering video with sound in the beginning. I got rid of it by downloading the binary from blender.org.At the end of this work, I realized the power of Blender.

For images, Flickr was useful (http://www.flickr.com/creativecommons). I made sure all the images are under the Creative Commons license or permitted derivative works. Finding video footage was the most difficult part. Short of time, I had to use what I found.

For the audio, I was lucky to find the composition by Butterfly Tea at jamendo. What a wonderful music it is! I liked it when I heard it for the first time and so did my wife.

In the end,  I was very happy and satisfied with the outcome.

As the video is less than a minute and the messages flash quickly, I thought I would post them here..

Our Stability and Speed – is hard to match!

  • Architecture – robust, tested and trusted
  • No random crashes or reboots
  • No slowdowns with age
  • High productivity, Less downtime

Our Territory – is secure!

  • Designed with security in mind
  • Immunity to viruses, trojans and other malware.
  • Control what runs and what does not

We are Incharge – of what happens around us!

  • Extreme configurability
  • Efficient process control
  • Cleaner package management

We Enjoy Freedom – in its true sense!

  • Open Source, free to use and modify
  • Standards compliant
  • Supportive commnity
  • No licensing/maintanance/upgrade costs

If you liked it, please vote for the video at http://video.linuxfoundation.org/video/1268. You would need to register.

SSHFS on SLES 10 SP1

1. Download SLED-10-SP1-x86-DVD1.iso from Novell (registration required). Mount the iso using mount -o loop

mkdir /mnt/sles
mount -o loop /path/to/SLED-10-SP1-x86-DVD1.iso /mnt/sles
cd /mnt/sles

2. Install the RPM
rpm -ivh suse/i586/fuse-devel-2.5.2-12.2.i586.rpm

3. Download sshfs from

http://download.opensuse.org/distribution/11.0/repo/src-oss/suse/src/sshfs-1.9-38.1.src.rpm
Note: (can’t use latest version due to bug https://www.scientificlinux.org/bug.feature/bugs/20/)

4. rpmbuild as user (Refer: http://dag.wieers.com/howto/bits/rpm-build-user.php)

rpm -i sshfs-1.9-38.1.src.rpm
cd ~/redhat/SPECS

rpmbuild -bb sshfs.spec

5. Install the RPM

rpm -ivh ~/redhat/RPMS/i586/sshfs-1.9-38.1.i586.rpm

6. Create mount point and set permissions

mkdir /media/work
chown -R user.group /media/work

7. Mount the ssh directory with
sshfs -o allow_other -o idmap=user -o reconnect -o uid=1001 -o gid=1001 user@sshserver:/var/www/html/ /media/work

For sharing the files via NCP on OES2

8. Create the NCP share using Remote Manager and point it to /media and not the /media/work (fails with error 150)

9. Adjust trustee rights to /media/work and add group

Mount at boot

The mount command would prompt for a password. This can be avoided if the ssh server supports public key authentication. The server I am mounting the SSH filesystem does not support this. Hence I will have to mount this manually after every server reboot. Haven’t figured a way around this. It would be possible to put a script under /etc/init.d and run it at boot. Haven’t tested this yet.

Reference:
http://www.linuxjournal.com/node/8904/print

Serve an NFS mount as an NCP volume accessed via Novell client

1. Mount the NFS share to a directory on the server
2. Use Remote Manager to create an NCP share
3. Use iManager, view objects to assign trustee rights to the NCP share or subdirectories under it

–details–

Sync files… the Python way!

What it does

  • copies missing files/modified files from source to target
  • does not copy if file is newer at target
  • use -r for a report mode and -s for the actual sync mode

Why?

  • I could not use rsync or other solutions for this situation
  • needed a scriptable solution. too much directories to sync

Note: It worked for me but might not in different cases. more testing needed.

import os, sys, shutil,time
import cPickle
from ListFiles import listFiles

def cleanDir(dname, dirlist):
	clean_dir_list = [path.replace(dname, "") for path in dirlist]
	return clean_dir_list
def removeItem(item, dirlist):
	dirlist.remove(item)
	return dirlist

def syncFiles(dname, files):
	error_logs = []
	not_copied = []
	done_logs = []
	for i in files:
		source_name = dir1 + i
		target_name = dir2 + i
		try:
			if os.path.isdir(source_name):
				os.mkdir(target_name)
				shutil.copymode(source_name, target_name)
				print 'created directory ' + target_name
				done_logs.append('created directory ' + target_name + '\n')
			elif os.path.isfile(source_name):
				shutil.copy2(source_name, target_name)
				print 'copied file ' + source_name + ' to ' + target_name
				done_logs.append('copied file ' + source_name + ' to ' + target_name + '\n')
		except Exception, why:
			error_logs.append(target_name + '\t' + str(why) + '\n')
			not_copied.append(source_name + '\n')
		pass
	return error_logs, not_copied, done_logs

if __name__ == "__main__":
	dir1 = sys.argv[1]
	dir2 = sys.argv[2]
	dname = sys.argv[3]
	report = sys.argv[4]

	if report == '-r':
		sync = 'no'
	elif report == '-s':
		sync = 'yes'
	else:
		print 'Usage: ' + sys.argv[0] + ' directory1 directory2 sync_option'
		exit

	if os.path.exists(dname + '_source.txt'):
		fin = open(dname + '_source.txt', 'r')
		flist1 = cPickle.load(fin)
		fin.close()
	else:
		flist1 = listFiles(dir1, "*",return_folders="1")
		fout = open(dname + '_source.txt', 'w')
		cPickle.dump(flist1,fout)
		fout.close()
	if os.path.exists(dname + '_target.txt'):
		fin = open(dname + '_target.txt', 'r')
		flist2 = cPickle.load(fin)
		fin.close()
	else:
		flist2 = listFiles(dir2, "*",return_folders="1")
		fout = open(dname + '_target.txt', 'w')
		cPickle.dump(flist2,fout)
		fout.close()

#open main log
log = open(dname + '_log.txt', 'w')

#missing files
clean_dir1_list = cleanDir(dir1,flist1)
clean_dir2_list = cleanDir(dir2,flist2)
missing_files= [item for item in clean_dir1_list if item not in clean_dir2_list]
if sync == 'no':
	if len(missing_files):
		print >> log, '\nmissing in ' + dir2 + ' compared to ' + dir1 + '\n'
		for i in missing_files:
			log.write(i + '\n')
		print 'list of missing files written to ' + dname + '_log.txt'
elif sync == 'yes':
	(missing_error, missing_not_copied, missing_done) = syncFiles(dname, missing_files)
	if len(missing_error):
		print >> log, '\nerrors occured while copying the missing files from ' + dir1 + ' to ' + dir2 + '\n'
		for i in missing_error:
			log.write(i + '\n')

	if len(missing_not_copied):
		print >> log, '\nmissing files not copied\n'
		for i in missing_not_copied:
			log.write(i + '\n')

	if len(missing_done):
		print >> log, '\nmissing files copied\n'
		for i in missing_done:
			log.write(i + '\n')
else:
	exit

#modified files
modified_files = []
for item in clean_dir1_list:
	if os.path.isfile(dir1 + item):
		f1time = os.path.getmtime(dir1 + item)
		if item in clean_dir2_list:
			f2time = os.path.getmtime(dir2 + item)
			if((f1time - f2time == 3600.0) or (f2time - f1time == 0.0)):
				continue
			elif(f2time > f1time):
				print >> log, 'file ' + item + ' is newer at ' + dir2 + '. will not be copied\n'
			else:
				modified_files.append(item)
			removeItem(item, clean_dir1_list)
			removeItem(item, clean_dir2_list)
if sync == 'no':
	if len(modified_files):
		print >> log, '\nthe following are modified in ' + dir1 + ' compared to ' + dir2 + '\n'
		for i in modified_files:
			log.write(i + '\n')
		print 'list of modified files written to ' + dname + '_log.txt'
elif sync == 'yes':
	(modified_error, modified_not_copied, modified_done) = syncFiles(dname, modified_files)
	if len(modified_error):
		print >> log, '\nerrors while copying the modified files from ' + dir1 + ' to ' + dir2 + '\n'
		for i in modified_error:
			log.write(i + '\n')

	if len(modified_not_copied):
		print >> log, '\nmodified files not copied\n'
		for i in modified_not_copied:
			log.write(i + '\n')

	if len(modified_done):
		print >> log, '\nmodified files copied\n'
		for i in modified_done:
			log.write(i + '\n')
else:
	exit

Preventing unauthorized SSH access using Denyhosts

Once when I was doing a regular tail -f /var/log/messages, I came across a number of messages like these.

sshd[29924]: PAM_NAM: User donk unknown to the authentication module
sshd[29924]: Failed password for invalid user donk from 'IP address here' port 63410 ssh2

My SSH was under continuous attack! . Hmm.., until I found DenyHosts that is..

DenyHosts is a cool little python script by Phil Schwartz, which will parse the logs and identify repeated authentication failures and add the IP address of the offenders to /etc/hosts.deny, thus preventing them to connect to the server in the first place.

As the program was not available in the official repositories for SLES 10 SP1, I had to do some manual configuration. The installation steps were detailed in the ‘Readme.txt’ file within the package.

First, the python-devel package has to be installed. It is not installed by default

zypper install python-devel

Download the latest version of DenyHosts from http://denyhosts.sourceforge.net/

The version available at the time of my setup was 2.6. After uncompressing the sources

tar zxvf DenyHosts-2.6.tar.gz

cd DenyHosts-2.6

python setup.py install

The above step install the scripts and config files in /usr/share/denyhosts and in the site-packages of the python directory.

Before proceeding the file denyhosts.cfg must be edited to suit the installation environment.The example config file is fully commented so it should be easy to follow. I had the following config

#/usr/share/denyhosts/denyhosts.cfg

SECURE_LOG = /var/log/messages
HOSTS_DENY = /etc/hosts.deny
LOCK_FILE = /var/run/denyhosts.pid

After this, I did the following step (as mentioned in the readme) to run denyhosts as a daemon during system start.

cd /usr/share/denyhosts

chmod 700 daemon-control

ln -s /usr/share/denyhosts/daemon-control /etc/init.d/denyhosts

/etc/init.d/denyhosts start

tail -f /var/log/denyhosts # will contain messages related to the start

If it is working as intended, enable it to start automatically by doing

chkconfig denyhosts on

It had happend occassionally that some valid IP’s are listed in /etc/hosts.deny. To prevent this, the genuine IPs from which users connect can be added to a file called ‘allowed-hosts’ in /usr/share/denyhosts/data. There is no specific format. Just add the IPs to the file one below the other. Also, edit denyhosts.cfg to change the following variable and restart denyhosts.

ALLOWED_HOSTS_HOSTNAME_LOOKUP=YES

Thats it! One more step towards a secure environment.

GPRS with AirTel MobileOffice(INDIA) and Sony Ericsson W200i

Sony Ericsson W200i

W200i comes under the Walkman series.The best thing about this phone (apart from the fantastic music capability and other features) is that it comes along with a data cable. Previously I had a Nokia 6020 and had trouble connecting it to the laptop. The data cable has to be brought separately.

When connected to the laptop using the cable, two options appear in the phone – File Transfer and Phone Mode. If you want to tranfer files i.e., themes, music etc from phone to PC, choose File Transfer.The W200 is easily recognized under KDE – an icon for the Phone as well as the Micro SD Memory card (128MB) appears in the desktop.

If the phone has to be used as a Modem to connect to the Internet, the Phone mode is selected.

AirTel MobileOffice(GPRS)
I subscribed for AirTel MobileOffice(although I had used AirTel Online before).Once activated, browsing can be done on the phone or can be connected to the PC for regular browsing. It took me about a day or so for mobileoffice to be activated. To Configure the phone, go to Menu – > Settings -> Connectivity -> Internet settings -> Internet profiles and then select Mobile Office. Do the same thing for Streaming settings and Settings for Java.

For AirTel Online, activation can be done by sending an SMS. The charges used to about Rs.5/day. The advantage is that it can be deactivated anytime by sending another SMS. The disadvantage being that large files cannot be downloaded.

The speed in both can be a test for your patience. But, overall I felt it usable. Sometimes better than a regular dialup connection from BSNL.

Configure OpenSuse

Login as root or su. In the terminal type yast2. Select “Network Devices” and then “Modem”.

You will find “Sony Ericsson W200″ and “Modem Not configured”. Select it and then click Edit.

The Modem device will appear as /dev/ttyACM0 or something similar.Leave the default options and click “Next”

From the Select Internet Service Provider, Check “Custom providers” and then Click “New”.
For the provider name type “AirTel” and for the Phone Number type *99***2#. Type your phone number for the username and leave the password field blank. Uncheck “Always ask for password”.

Once done click next and then Finish.

Open Kinternet – Right Click and select the interface (in my case it was modem1). Make sure the provider is AirTel.

To connect, just click on kinternet icon. It should be connected now. To disconnect, just click on this icon once again.

Open the browser and visit a website. No configuration of the browser is required if using Mobile Office. For AirTel Online, the proxy server need to be configured. The IP address of the proxy server is 100.1.200.99 and the port is 8080

OpenSuse on Acer Travelmate 4152NLCi

I bought this laptop in the beginning of 2005. It was preloaded with a basic version(no X/GUI) of Linux – known as Linpus linux. A long time fan of fedora, I was shocked to see that my new laptop would not boot from the Fedora Core 4 DVD. The other choices I had was SuSE Linux 10.1 and Ubuntu. I went ahead with SuSE and there are no regrets. I had updated it to OpenSuse 10.2 now. Either there was inbuilt support or I was able to make things work.

Works by default

Bluetooth

Works with intervention
Infrared[SMSC-IRCC]: works with the option enabled in the BIOS. FIR does not work
Internal Modem [AC 97] works with the smartlink-softmodem driver
Suspend to disk and Suspend to RAM works with minor change to options

Untested

Wireless Lan

Doesn’t work
Acer hotkeys

Software
Google Picasa works with the ulimit=unlimited option

I will be posting detailed instructions on these later

Next Page »