Archive for July, 2007

Google Apps - Email

Tuesday, July 24th, 2007

I have been using paradox server to handle my blog(www.sandaru1.com) and emails(AT gunathilake.com) for more than a year now. However, due to several reasons our server went offline by a timely manner. The problem is fixed now but the xmail configuration is not perfect either.

So, I decided to go for google apps. I have used that for about a week now, and so far the only problem I got was, since the mailing account is new some important mails are marked as spam. However, google really learns fast(or it has some hidden filters for each user) and by clicking on “spam” and “not spam” buttons managed to fix the problem.

So, overall the system seems pretty good and handles with out any errors. Another big advantage of the system is it has superb gmail interface.

Picasa Widget updated

Wednesday, July 11th, 2007

Edit : Latest update http://www.sandaru1.com/2008/04/04/wordpress-picasa-plugin/

I just updated the picasa widget. Thanks for the comments on the early version. Now, you can select the image size. Then, picasa username field get bit complicated.

If you want to use your whole picasa album you can just type your username. If you want only one album then you can put the album name within brackets(Without spaces). Here is an example : username(album).

If you want to get photos from more than one user, then type all usernames separated by space. You can even use brackets with the usernames.

Click here to download

How to find free mp3 using google

Wednesday, July 4th, 2007

Most probably, you are using file sharing apps(Limewire, Bearshare, even Bittorrent) to download music. But do you know there are thousand of free mp3 hosted on internet, and those are directly accessible by normal browsers?

Sometimes, people upload mp3 files to their web servers thinking that no one will find them. But when someone enters the url of the folder which contains the music, the web server uses directly listing to show the files in that folder (Directory listing can be turned off).

Basically, if you can find some web servers with mp3 files, you can download those. The problem is finding those. You can use google advance queries to find them. The title of apache directly listing starts with the phrase “Index of”. So, you can use google to search pages with “Index of” in title. Then, you need “mp3″ files. So, just append mp3 to the query. Lets say you want Beatles. Then, append Beatles. Here is an example : intitle:”Index of” mp3 Beatles

There is a possibility that some of those url might not work. But keep on searching, there are lots of working urls.

When there is a lot of sub directories and files, you might want to get a list of urls. So, i wrote a simple PHP script. You can execute this script in command line. I have put some sample URLs. The sample pages given there will generate more than 1000 direct links for mp3s.

<?
	$stderr = fopen('php://stderr', 'w');
	set_time_limit(0);
	error_reporting(0);

	$urls[] = "http://www.mcgees.org/mp3/pearl_jam/";
	$urls[] = "http://www.xieish.net/Collective%20Soul/";
	$urls[] = "http://www.asilentflute.com/mp3/";
	$urls[] = "http://www.semret.org/music/";
	$urls[] = "http://www.koreangirlssuck.com/emotion/mp3/";
	$urls[] = "http://www.vrees.net/mp3/";
	$urls[] = "http://www.webpiri.net/Mp3/";
	$urls[] = "http://pierre33200.free.fr/Music/";

	$done = array();

	for($i=0;$i<count($urls);$i++) {
		$url = $urls[$i];
		$done[strtolower($url)] = true;
		$temp = parse_url($url);
		$path = pathinfo($temp['path']);
		$domain = $temp['host'];

		if ($path['extension']!="") {
			if (strtolower($path['extension'])=="mp3"
				|| strtolower($path['extension'])=="wma") {
				echo $url."\n";
				continue;
			} else {
				fwrite($stderr,"Escaping $url : Not mp3\n");
				continue;
			}
		}

		fwrite($stderr,"Proccessing $url\n");

		$html = file_get_contents($url);

		$direct = preg_match("/index of/i",$html);
		if ($direct==false) {
			fwrite($stderr,"Error : Not a directy index\n");
			continue;
		}

		$count = preg_match_all("/<a href=\"(.*?)\">.*?<\/a>/i",
				$html,$matches);
		foreach ($matches[1] as $match) {
			// Ignore the pages link to same url
			if ($match[0] == "?")
				continue;
			if (substr($match,0,7)=="http://")
				$cur = $match;
			else if ($match[0] == "/")
				$cur = "http://".$domain.$match;
			else
				$cur = $url.$match;
			if (!isset($done[strtolower($cur)]))
				$urls[]=$cur;
		}
	}
	fclose($stderr);
?>

Save the above script(”mp3.php”), then execute it(”php mp3.php > urls.txt”). Then, it will show you what it’s doing and all the urls will be written to “urls.txt”. If you are in linux, you can use “wget -i urls.txt” to download the songs. If you are in windows, download Free Download Manager and use File -> Import List of Downloads.

You can also download the list of generated links.

How to convert your live CD iso into a live USB

Monday, July 2nd, 2007

Two days ago I downloaded the latest Ubuntu Gusty Tribe 2 (What a pathetic name?). I only had one blank CD left, and the burning process was interrupt by some unknown force. There is no point going to town to get a new CD, so, I started messing around my USB drive.

First what I tried was writing entire CD iso image into the usb drive. As far as I know, there is no easier way to do that in windows. So, I used another real live CD, and used “dd”. What I thought was by writing the iso image, it would behave like a CD and it will work, but It didn’t.

After going through some tutorials in the internet, I came to know that the best solution is syslinux. That’s pretty easy to install also. If you are in windows, download the syslinux, and extract it. Open the command prompt, go to the syslinux folder(if it’s “c:\syslinux\” then type “cd c:\syslinux”) and execute “syslinux X:” where X is your usb drive letter.

Then, to test whether it was executed properly, you can go to the usb drive and do a “dir /a”. It should have a file called “ldlinux.sys”. If it’s there, try booting from the usb drive. Then, it’ll complain the kernel image “linux” is not there. That means it’s installed. If it says, “Boot Error”, there is a HP disk format utility, you can download that and format the disk. If you are in linux, you can use “fdisk” and “mkfs.vfat”. Make sure you mark the partition as boot.

Then simply extract all the files from the ISO into the usb drive. Actually, after this step you have to configure the boot options, move some files here and there, but since I’m not going to keep Ubuntu on my usb forever, I just didn’t do any configuring. To boot up linux, just coping is enough.

So, again restart, and since we haven’t done any configuration, it will surely ask for the kernel again. The kernel is casper/vmlinuz. You also have to mention some kernel parameters. Here is my command.


/casper/vmlinuz boot=casper initrd=/casper/initrd.gz root=/dev/ram rw

However, If you are going to try Ubuntu Gusty Tribe II, it’s not stable yet. So, if you don’t want your linux to crash time to time, install feisty fawn. Since, my modem still doesn’t work in linux, I didn’t install it.