Oct 21

Here’s an easy way to change the prompt in Unix Shell

export PS1="[\W]$ "

This will use the current directory as command prompt

Tagged with:
Oct 21

By default, ‘crontab -e’ uses vi without syntax highlights or nano.
to make it use vim, execute the following command:

> export EDITOR=/usr/bin/vim
Tagged with:
Nov 18

Hi Guys, I just want to ask how’s my buffer doing in Alberta? Is it a big help?

Thanks for dropping by. :-)

Tagged with:
May 13

Login as root

### Create a folder `installer` ###
mkdir /installer
cd /installer

### Download the installer from apachefriends usin wget ###
wget http://www.apachefriends.org/download.php?xampp-linux-1.6.8a.tar.gz

### Unpack the tar ball to folder `/opt` and install service ###
tar xvfz xampp-linux-1.6.8a.tar.gz -C /opt

lvl=`egrep :initdefault: /etc/inittab|cut -d: -f2`

cd /etc/rc.d/rc${lvl}.d

ln -s /opt/lampp/lampp S99lampp

ln -s /opt/lampp/lampp K01lampp

### Start Server ###
cd /opt/lampp
./lampp start
./lampp status

Tagged with:
Apr 20

I have installed Canon 5400 in our network, and found an option to add the printer with its MAC address in the installer, then wondered if that’s possible with a network printer to retrieve its MAC from my PC, although I know what its IP address. Here’s the solutions

1. Click Start -> Run, type cmd and click Ok
2. Type ping xxx.xxx.xxx.xxx, replacing xxx.xxx.xxx.xxx with the IP address of the computer who’s MAC address you want to retrieve( in my case its 192.168.0.3)
3. After the ping response has finished, type arp -a
4. Under Internet Address, locate the IP address you just pinged. In the same line, the corresponding MAC address is listed under Physical Address

You will see something like:
192.168.0.1 00-17-16-00-33-b4 dynamic
192.168.0.2 00-50-04-ee-99-c2 dynamic
192.168.0.3 00-00-b4-ce-2a-ac dynamic

Tagged with:
Mar 24

Most of the developers nowadays prefer to rewrite URLs for (Search Engine Optimization)SEO. This code is sample on how to strip symbols from a string.

<?php
function urify($str){
  return str_replace(" ","-",trim(ereg_replace("[^A-Za-z0-9[:space:]]", "", $str)));
}
$string = "I really hate symbol on my URL - 12345 What the !£$%^& ~!@#$%^&*()_+=-[]{}";
echo urify($string);
?>

Output is:
I-really-hate-symbol-on-my-URL–12345-What-the

Tagged with:
Mar 19

Google Currency Conversion API

Well, the api is pretty straight forward.
I found it from the Curreny Conversion gadget of iGoogle.

Here is the example:

http://www.google.com/ig/calculator?hl=en&q=1USD%3D%3FPHP

Here is templage in php:

$amount = "1";
$from_Currency = "USD";
$to_Currency = "PHP";


$query_URL = "http://www.google.com/ig/calculator?hl=en&q=$amount$to_Currency.%3D%3F$to_Currency";

The resposnse looks like this:
{lhs: “1 U.S. dollar”,rhs: “45.6704421 Philippine pesos”,error: “”,icc: true}

Not sure if Google is credible to use for conversation, however, if we are just working on simple project, this will be a good help. :-D

Feb 19

If you’re looking for an easy way to extract emails from Craigslist but want to avoid tying up your computer and your connection – http://craigslist.pasukan.com web based will fit your needs perfectly.

Unlike other Craigslist email extractor software that causes Craigslist to blacklist your server or IP address and causes your computer to slow to a crawl, http://craigslist.pasukan.com collects email effortlessly through the web. Enjoy always-on access to the latest, up-to-date emails directly from Craigslist. Target your mailings more precisely by targeting on the exact city and category you want to promote to. Make your message heard by getting only the most recent emails available the email addresses based on the information you supply, so you’re assured of smart results – every time.

Forget dealing with CAPTCHA bypassing and having your account suspended. http://craigslist.pasukan.com works from anywhere to give you all the details you need – right when you need them.

Tagged with:
Feb 04

Dante’s Inferno hid passwords for their website http://hellisnigh.com in the source code of various websites. When you enter them all you get to download a zip file called “earthly_rewards_dantes_inferno.zip”. I’ll let you know what it is once it finishes (46MB and climbing) — the website is really slow right now. You can probably try to download it directly here, let me know if it doesn’t work: http://www.hellisnigh.com/files/earthly_rewards_dantes_inferno.zip

Password 1: excommunicate
Password 2: scythe
Password 3: grafter
Password 4: styx
Password 5: unbaptized
Password 6: alighieri

Password 1 is found in the source of http://digg.com, 2 on http://dailymotion.com, 3 on http://gamespot.com, 4 on http://ign.com, 5 on http://gamesradar.com, 6 on http://wwe.com

Tagged with:
Jan 22

I use Hostgator as my hosting company. I love them – great service, tons of space and no long term obligations. And the servers are fast. Now, another reason to love them – running Subversion repositories on your server with the caveat – you can only have one account to account to access that repository. If you develop by yourself, and I do for now, it’s not a problem. So how do you do it – assuming you are a Java coder using Eclipse on Windows?

1. Send Hostgator support a request to get SSH access to your server. They will ask you to send in a picture id and once that is cleared, you should be good to go. A matter of a day or two.

2. Install Subclipse SVN plugin for Eclipse. The Subversive plugin DOES NOT WORK.

3. Install the really good Tortoise SVN client

4. Set up an environment variable called SVN_SSH. To do that, go to the Windows Control Panel -> System -> Advanced -> Environment Variable -> New (under the bottom Window). For variable name enter the value SVN_SSH and for its value enter c:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe (assuming you installed Tortoise SVN in the default location).

5. Start Eclipse and go to the Subclipse options: Window -> Preferences -> Team -> SVN . There, for the SVN Interface select “SVNKit (Pure Java)”. Click OK to store the setting.

6. Now, using Putty or some other SSH tool, SSH to your account. You will need to set up a repository for your project. To do that, create the directory that will be used as repository, say /myrepo. Now, create an Subversion repository inside that directory: svnadmin create myrepo.

7. Create a new project by checking out the repository from SVN. To do that, in Eclipse, go to: File -> New -> Other -> SVN -> Checkout Project From SVN.

8. The ‘Checkout from SVN’ window will appear. There select to create a new repository location

9. For the URL, enter: svn+ssh://@:2222/home//. In other words, if your domain is example.com, your admin user name is joey and the path to your repository is /myrepo, then your URL will be svn+ssh://joey@example.com:2222/home/joey/myrepo

10. Another popup window will follow that will ask you for your SSH user name. Enter the details and make sure they are saved.

11. You should be good to go at that point as the rest of the process is the normal project checkout scheme used by Subclipse.

Tagged with:
preload preload preload
Bless CV