Affixa software by Notably Good Ltd. (http://www.affixa.com/) lets you easily setup GMail or Yahoo as your mail client. Using this, you can easily send attachments from any of the windows application include Office and Windows Explorer.
How to restore / resurrect deleted files in subversion?
If you delete a file or folder from subversion. You can easily restore it using the svn copy command below:
#Example Command (all one line)
svn copy http://subversion.server.com/path/to/deleted/file.psd -r 115 http://subversion.server.com/path/to/deleted/file.psd -m “Commit Message”
Note: 115 is the revision number in subversion where the latest version of file exists.
How to auto start services on boot in Centos / Redhat?
To auto start services in Centos or Redhat OS, you can use builtin chkconfig utility. It is located in /sbin directory. If you are a regular user (non-root), then /sbin may not be in your path. Therefore, you may have to use the full path to access the chkconfig utility.
To auto start a new service:
- Find out the name of service’s script from /etc/init.d/ directory e.g. mysqld or httpd
- Add it to chkconfig
sudo /sbin/chkconfig –add mysqld - Make sure it is in the chkconfig.
sudo /sbin/chkconfig –list mysqld - Set it to autostart
sudo /sbin/chkconfig mysqld on
To stop a service from auto starting on boot
- sudo /sbin/chkconfig mysqld off
Moved this site on to a VPS from IntoVPS
Few days ago, I moved this website on to a VPS from IntoVPS. So far IntoVPS has been quite good. It took only few minutes to get access to my VPS after signing up on IntoVPS site.
I picked Ubuntu 9.10 Server Edition for the OS because it is much easier to build a server on Ubuntu than dealing with Centos/Redhat crap.
P.S. Suprisingly IntoVPS guys also run super handy IntoDNS.com service!
Open Port 80 for Apache in iptables on Centos or Red Hat
One mod deflate filter to rule them all …
Add the following code to your .htaccess file to automatically have all of your text files compressed by mod-deflate on the fly.
Warning: Make sure you are running Apache 2.0 server with Mod Deflate enabled.
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-javascript application/javascript text/javascript text/css application/xml
All in one line.
Drupal Best Practices : Use Theme Image Function to embed images
Often times, when you are themeing in Drupal, you may have to embed an image inside a template file. If the image is local, then it is best to use the theme_image theme function to embed it rather than using straight HTML tags. This not only makes your HTML output less error prone, but also automatically embeds height and width attributes to the tag. Embedding height and width attributes reduces the amount of repainting that the browser needs to do while rendering a webpage.
Here is sample code, which embeds a User’s Profile Picture.
<?php echo theme('image', $u->picture, $u->name, $u->name, array('class' => 'content_img')); ?>