Pages

Monday, December 19, 2011

GUnzip all found files

GUnzip all the files from a directory hierarchy

find . -type f -iname '*.gz' -exec gunzip {} \;

Want to have a verbose output?

find . -type f -iname '*.gz' -exec gunzip --verbose {} \;

Tuesday, December 6, 2011

Ruby on Rails -=- Formatting Rails text_field_tag

Hi!

If you want to format a Rails text_field tag, simply do the following:

   <%= f.text_field :my_var, :value=> my_function(f.object.my_var) %> 

Where my_var is my variable and where my_function is a function where I can apply a format. You can apply directly the format that you want in :value instead of using a function

Ruby on Rails -=- Removing trailing zero

Hi! With RoR I'm always getting trailing zero for numeric fields. Example, 23 will be 23.0 In order to round theses values, simply do the following
"%g" % my_value
Where my_value is my variable

IE9 -=- Border on link images

With IE9, when we have anchor on images, Internet Explorer adds a border to this image. To remove it, simply use this CSS



a img {
     text-decoration: none;
     border: 0;
}

Sunday, December 4, 2011

Tuesday, November 29, 2011

Virtualbox Guest Additions on CentOS & RedHat Linux

Check this URL if you want to configure the VirtualBox Guest additions on a Linux box.


http://www.if-not-true-then-false.com/2010/install-virtualbox-guest-additions-on-fedora-centos-red-hat-rhel/

Configuring Pidgin with Google Talk for Google Apps

Here are the steps the configure Pidgin:

  • Open Pidgin.
  • Select Account.
  • Select Manage Account
  • Click Add
  • Enter the following information in the Add Account window:

  • Protocol: XMPP
  • Username: your Google Talk username (without any @ symbol or domain).
  • Domain: Your domain name (after the @)
  • Resource: Leave empty
  • Password: Your password
  • Remember password: Check the box
  • Local Alias: leave this field blank
  • New mail notifications: check the box if you'd like Pidgin to notify you of unread email in your inbox.
  • Click on 'Advanced' tab and enter 'talk.google.com' in the Connect Server box.
  • Click Save.