Skip to content

Stopping X on Ubuntu 11.10

sudo service lightdm stop

Share

Ubuntu: Making resolv.conf entries permanent

Edit following file:

root@ubuntu:/etc/dhcp# vim /etc/dhcp/dhclient.conf

Change/Add (uncomment) following line:

prepend domain-name-servers 8.8.8.8;

Note that you may need to change 8.8.8.8 to your own DNS server ip.

Share

Paypal IPN: Pending because of multi_currency issue

I was getting IPN posts from paypal with payment_status=Pending along with pending_reason=multi_currency @ IPN URL. This was happening each time I tried a non-USD currency in my cart.

Simply accepting multiple currencies in my paypal seller account fixed the problem. Its Payment Receiving Preferences section under Profile, if you wish to set it in advance.

Share

Testing Paypal IPN in sandbox and nonstandard http port issue

It seems that paypal IPN has issues with non-standard http ports. I discovered this after a lot of head bangs against IPN simulator. So, do make sure that your public URL is “publicly” accessible and is on port 80 (or 443)

Also, don’t forget to enable “IPN hits” in the seller account that you are using.
For this, go to “Test Accounts”, logon to your sandbox account that you use to receive payments.
- Go to Profile
- Go to Selling Preferences and click Instant Payment Notification Preferences.
- Click Edit settings.
- In Notification URL, enter the public IPN URL.
- mark Receive IPN messages (Enabled).

Click the Save button.

Test your IPN

Share

apache + mod_jk + tomcat6 setup on ubuntu karmic and ubuntu lucid

sudo apt-get install libapache2-mod-jk
sudo cp /usr/share/doc/libapache2-mod-jk/httpd_example_apache2.conf /etc/apache2/conf.d/mod-jk.conf
sudo vi /etc/apache2/sites-enabled/000-default (could be different in your case)

In your virtual host block add following line:

JkMount /hudson* ajp13_worker

Note: I am trying to map hudson here.. but app context could be different in your case. (simply replace hudson with your app name)

Check for syntax errors (should report OK)
apache2ctl -t;

Restart apache (or reload config)
sudo /etc/init.d/apache2 restart

Default tomcat installation won’t listen to connector port by default. Make sure that connector port configuration is uncommented in your case:
sudo vi /etc/tomcat6/server.xml

then, uncomment following line if commented out:
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Restart tomcat
sudo /etc/init.d/tomcat6 restart

Done
Test your setup: http:///yourdomain.com/hudson

Tested on:
lsb_release -a
Description: Ubuntu lucid (development branch)
Release: 10.04
Codename: lucid

and
lsb_release -a
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic

Share

SEO Basics presentation

Share

Public stings using Facebook

I had this thought a while ago while on my long drive to office. At many occasions, I have encountered people misbehaving on roads and I wished I could do something to fix their heads. Primarily, I was looking for something that could be a real time reporting mechanism for Traffic police but unfortunately there was nothing except calling them. I wished that I could somehow capture the snaps of such vehicles and send them to people who are hunting for them.

Recent news about “Traffic stings by public using Facebook” on Tuesdays’ NBT is like this thought coming true. People actually took pictures and reported to Police using Facebook. And police actually sent out challans to a good number out of those reports. This is nice.

For those who are reading this and not aware(like me), Delhi Traffic Police is now on both Twitter and Facebook. You can use these channels to connect to them by simply following them and messaging them. And it must be pretty easy now since almost every handset is shipping with Facebook and Twitter client these days.

You will in addition get useful updates about traffic situations for free(I know how badly i usually need this information).

Share

AOL rejecting or blocking emails

Recently, we faced a problem where emails generated from our application were not showing up in AOL inbox(es).

We have recently switched to a new machine & I suspected that for new machine mx-records are not set correctly from where I am trying to send the email.

We didn’t wanted to change our mx-records as we feared loosing any email. This is when SPF works.

http://www.openspf.org

We setup SPf records & this problem is solved. Now, our new machine is a valid email sender for our domain.

But emails were still not making it through AOL.

After some googling & aoling i found this link:

http://postmaster.info.aol.com/trouble/index.html

from here I followed this:

http://postmaster.info.aol.com/tools/telnet.html

I followed the instructions relegiously & got this error:

421-: (DNS:NR) http://postmaster.info.aol.com/errors/421dnsnr.html
421 SERVICE NOT AVAILABLE

URL: http://postmaster.info.aol.com/errors/421dnsnr.html clearly states the problem

So, reverse DNS is not set correctly.

AOL also provides this tool for further testing of your reverse DNS

http://postmaster.info.aol.com/cgi-bin/dns_tool.pl

We asked our hosting provider setup reverse DNS for our domain.

Damnnn.. Why didn’t we first looked at AOL faqs.

Share

Wget came to my rescue

I was trying to download some 150-200 zip files from a http URL by finding each file & clicking on it to download.  I soon realized how boring it is using standard download support in browsers.

This is something I am supposed to do periodically

I know that there are some browser extensions available that could do this pretty easily, but i wondered if i could do this via command line & later on automate it somehow.

This is when i recalled wget.

I downloaded it for my machine from here

After some experimentation i finalized following working set for myself:

wget “http://somewebsiteyoutarget/folderx/foldery/” -r -A zip

Options Explanation:

-r : recursively digs the folder until it exhausts. There are options for specifying recursion levels too (see wget -h)

-A : you can specify extensions you want to download. In my case these are zip files only.

Since these files were quite big in size, it took some time to download these files. Occasionally my internet connection broke & i had to restart things again.

But wget has solution for these problems as well (see wget -h). I explored the help and found -c & -t options pretty usefull for crappy connections.

So now my command looks like this:

wget “http://somewebsiteyoutarget/folderx/foldery/” -r -A zip -c -t

Wget rocks (full marks) ! : o ) !

Share

lynx: https how to

step1: Compile lynx with ssl support

cd lynx source folder

./configure –with-ssl

step2:  make ; make install

To avoid local ssl error prompts/complains,  Open lynx.cfg make following change:

step3:  FORCE_SSL_PROMPT:yes

thats all!. you should be able to crawl https pages using lynx now.

Share