Latest Entries »

Follow these simple steps to create a custom ringtone for your iPhone, using iTunes 10.

- Open iTunes 10
- Browse to the song from which you’d like to make a custom ringtone.
- Right click on the song, choose “Get Info->Options”
- In the Options tab, set ‘Start time’ and ‘End time’ for the clip you would like as the ring tone.
- Right click on the song and choose “Create AAC version”.
- iTunes will create an AAC version of the clip you’ve selected, with the same name as the original.
- Edit the original song file, back to old Start & End times.
- Right click on the newly created clip, and select ‘Show in Finder’, to open the music folder.
- You’ll notice that the clip has an extension of .m4a. Rename the extension to .m4r.
- Copy the .m4r file to your Desktop.
- Go back to iTunes, and delete the clip from iTunes.
- Drag and drop the .m4r file from your Desktop to iTunes Ringtones folder.
- Sync the ringtones with your iPhone.

That’s it! You’ll find your custom ringtone in iPhone (Settings->Sound->Ringtone)

Tip: How to link to a specific part of a youtube video

Looking for a way to link to a specific part of a youtube video? Just add the following string to the end of the youtube url:
#t=MmSs where M=minutes, S = seconds.

For example, the following link takes you straight to 5:18 in that video.

Products I Can’t Live Without [2010]

Inspired by a few bloggers, here’s an attempt to track my favorite products over time. This is my 2010 list of ‘products I can’t live without’:

Google Finance
Google Docs
Google Chrome
Google Picassa
Microsoft Outlook
TechHit TwInbox
TechHit SimplyFile
TechHit QuickJump
Twitter for iPhone
MyFitnessPal (iPhone App)
Credit Karma

Pacific coastline & Mt. Tamalpais

Mighty Pacific at sunset.

Mighty Pacific

Mighty Pacific

Mount Tamalpais is the highest peak in the Marin Hills, which are part of the Northern California Coast Ranges. A view of the Pacific ocean coastline from Tamalpais peak.

Pacific Coastline

Current Playlist

Maestro Ilayaraja has composed for an unimaginable number of films (900 Films & 5000 Songs) and I don’t think I can ever claim that I’ve heard them all. Last week I tripped over this wonderful melody. Check out the prelude and interludes.

  • Kanna Unnai Thedukiren Vaa – Unakkagave Valzkiren
    S Janaki & SPB
  • Background score from the film Mani Ratnam’s Pagal Nilavu.
    Pagal Nalavu – Background scoreIlaiyaraja
  • Mac users, here’s how to increase/decrease tempo of an audio file with GarageBand.

    1. Open Spotlight. Type “GarageBand”. Select on “GarageBand” application. Start it.
    2. Create a new project in GarageBand (File -> New)
    3. Drag and drop your audio file (MP3, M4A etc) in GarageBand.
    4. Press Alt+Ctrl+G
    5. Highlight the audio track. (Track’s color changes to purple)
    6. Click on Track Editor (Scissors symbol at the bottom of GarageBand)
    7. Check “Follow Tempo & Pitch” in Track Editor.
    8. GarageBand displays Tempo next to the PlayHead display. Click on Tempo, and adjust it to your liking.


    PHP Coding Guidelines – A cheat sheet

    A cheat sheet, listing some guidelines for good coding practices.

    - Use tabs for indenting.
    - Set tab to 4 spaces.
    - Keep lines <80 chars long, for better readability.

    Spacing and Linefeeds

    - No trailing whitespace at the end of the lines.
    - Use Unix style formatting.
    * Lines must end only with a line feed (LF).
    * All text files should end in a single newline (\n) after the closing PHP tag (?>).
    - If you are using Windows platform for development, please set your editor to save files in Unix format.

    Naming Conventions

    - Use the following naming conventions.
    * filenames-in-general
    * javascriptFunctions
    * javascriptVariables
    * mysql_columns
    * mysql_tables
    * _php_global_vars
    * php_functions
    * php_variables
    * phpClassMethods
    * phpClassNames
    * README.txt


    - Arrays should be formatted with a space separating each element (after the comma)

    $array_number_one = array('this', 'is', 'foo' => 'bar');

    - If the line declaring an array spans longer than 80 characters, each element should be broken into its own line with proper indentation.
    '#title'=>'Post Title',
    '#maxlength' => 32,
    '#required' => TRUE,
    '#size' => 15,

    Function Arguments

    - Function arguments should be separated by spaces, both in the definitions and in function calls. There should not be any spaces between the arguments and the opening and closing brackets, or between the function name and the opening bracket.

    Eg: function this_is_a_test($argument1, $argument2)

    - Arguments with default values should always go at the end of the argument list.
    Eg: function this_is_a_test($argument1, $argument2, $argument3 = 'abc')

    PHP Code Layout

    - Do NOT combine multiple lines of code into a single line, even if they are comments or debug statements.


    $variable = $something + $something; $another_variable = $something_else; echo "test"; //WRONG

    Correct way:

    $variable = $something + $something;

    $another_variable = $something_else;

    echo "test";

    - Braces should ALWAYS be included when writing code using if, for, while etc. blocks. No exceptions here, even if the braces could be omitted. Leaving out braces makes code harder to maintain in the future and can also cause bugs that are very difficult to track down.

    Wrong practices:
    if ($condition1) echo "some code";
    if ($condition1)
    echo "some code";
    echo "some code";

    Correct way:
    if ((condition1) || (condition2)) {
    } elseif ((condition3) && (condition4)) {
    } else {
    //default action

    - Control statements should have one space between the control keyword and opening parenthesis.

    - Split lengthy IF statements into several lines.
    if (($condition1
    && $condition2)
    || $condition3
    || $condition4
    ) {
    //do something

    SQL Code Layout

    - Do NOT hard code db_prefix in table names. (Specific to Drupal).
    - Always capitialise all SQL keywords (SELECT, FROM, VALUES, AS etc.) and leave everything else in the relevant case.
    - If you are using WHERE clauses to return data corresponding to a set of conditions, enclose those conditions in brackets in the same way you would for PHP if blocks.

    Eg: SELECT * FROM {node} WHERE ( (rid = 5) AND ((type = 'recording') OR (blah = 'somevalue')) )

    - Split lengthy SQL statements into several lines.

    Quoted Strings

    - Strings in PHP can either be quoted with single quotes (”) or double quotes (”"). The difference between the two is that the parser will use variable-interpolation in double-quoted strings, but not with single-quoted strings. So if your string contains no variables, use single quotes, otherwise, use double quotes.

    SQL Injection

    - Make sure your SQL code does not expose SQL Injection vulnerability.

    Eg: This code is prone to SQL Injection.
    db_query("INSERT into {node} (nid, vid, type, uid, created, changed) VALUES($nid, $vid, '" . $type . "', $user->uid, $created, $changed)");

    Instead, use:
    db_query("INSERT into {node} (nid, vid, type, uid, created, changed) VALUES(%d, %d, '%s', %d, %d, %d)",$nid, $vid, $type , $user->uid, $created, $changed);

    1. Install SysStat
    apt-get install sysstat

    2. Enable Stat collection
    Open vi /etc/default/sysstat
    Edit the file, change “ENABLED” to “true”.

    3. Start Sysstat
    /etc/init.d/sysstat start

    3.a. By default, sysstat reports activity every 10 minutes everyday.
    If you’d like to change that interval, edit it here:

    4. To look at your load averages, type in
    sar -A

    If you have installed a Windows 7 Beta as Guest operating system on a VMWare server, over a Windows XP Base, you might run into issue with Network adapter ( i did).

    If that’s the case, follow these steps.
    1. Go to Windows 7 Guest OS VMWare directory on your file system, and open the .vmx file in a notepad.
    2. Add the following line to the end of the file and save it.
    ethernet0.virtualDev = “e1000″.
    3. Restart the Windows 7 Guest Operating system.

    Windows 7 will recognize the network adapter and you should be able to connect to the internet.

    Powered by WordPress | Theme: Motion by 85ideas.