Skip to main content

Posts

setting up daily cron job

create a script in /etc/cron.daily . Do remember that the script should not have any suffix otherwise the cron job will not pick it up. I made a mistake of naming the file mysqlbackup.sh and later discovered that the cron job was not executing this script. I had to rename it to mysqlbackup (no .sh suffix)

Apple developer site UI

It was kind of unusual to see apple developer page messed up. I guess we don't expect to see this kind of UI from a company like Apple which sets a very high standard when it comes to usability. http://developer.apple.com/

Yahoo Small Business India hosting - not ready yet

One of my relatives was looking for a hosting solution to host a website for a travel agency. Coincidently, I received a call from a Yahoo sales agent in bangalore about their special website hosting plan along with a domain name for Rs. 999 for the first year. So I signed up for the plan and uploaded the website pages, which were all static. As I started using the service I discovered that Yahoo small business India is still not ready for anyone planning to do more than just upload static webpages. I could not configure custom IPs for nameservers and there is no imap access to email accounts. They do offer pop mail access for emails but the emails sent from a mail client are not stored in "sent mail" folder in yahoo account. When contacted, the customer care got back to me with a similar response on both occassions that it is not supported today and they do not have a timeframe for it. For anyone looking for a hosting solution in India, I would suggest that you go with other...

Developing iphone web application

I am currently working on an iphone web application. The first thing I looked for is how to create an iphone-like UI. Luckily I came across a UI framework called iUI which provides a template for UI we often see in iphone applications. It provides a css and javascript along with sample examples to show the usage. Once I downloaded the framework I was ready to create UI screens for my web application. However, I wanted to setup a development environment so that I could test the pages quickly in an emulator. Apple has released an sdk for iphone which can be downloaded from Apple Developer Connection site. But it only works on Mac at this time. For windows, Aptana has created an iphone plug-in for eclipse that can be used during the development as an iphone emulator. It is very helpful as it provides a quick way to see how the page would appear on an iphone. Plus, it has a built-in server that can be used to test the pages on the iphone handset. I enabled wi-fi on iphone and was able t...

Postgres database export and import

Here's how to export an existing database and import it into another database in postgres. 1. Login to a database machine as postgres user 2. use following to export database pg_dump database-name > filename-dump.out 3. Now create a new database in which the data will be imported, if it does not exist. createdb new-database-name 4. Now import the data into new database psql -f filename-dump.out new-database-name

Preventing SSH attacks

One solution is to run sshd on a non-standard port. Most automated attacks only attempt to connect on port 22 and therefore, this can be an effective way to hide from many attackers. To configure this, just change the Port line in /etc/ssh/sshd_config and restart ssh as follows; vi /etc/ssh/sshd_config Port 922 <-- update port number and uncomment if the setting is commented /etc/init.d/sshd restart

passing attributes in nested tiles

Tiles is a great framework to organize site content by constructing a page using multiple tiles. It allows reuse and customization of site content. I ran into a problem of making tiles attribute visible to a nested tile. The attributes defined in tiles definitions are defined in tiles scope and hence only available to the tile associated with the definition. In order to make the attribute available to nested tiles, pass the attribute as follows; <tiles:insert attribute="header" ignore="true"> <tiles:put name="title" beanName="title" beanScope="tile"/> </tiles:insert> If there is a need to access the attribute in struts bean tags or JSTL use <tiles:useAttribute/> or <tiles:importAttribute/> tags in jsp to access the attribute as follows; <tiles:useAttribute name="title" /> You can now access the value of title attribute using struts bean tag <bean:write name="title" /> or usin...