Wednesday, 28 December 2011

5 tips running drupal 7 site rackspace cloud sites


#1 - Increase the PHP memory limit

In your Drupal .htaccess file add a line at the top of the file that says:
php_value memory_limit 128M
Rackspace Cloud Sites default memory limit is 32MB which is the minimum recommended amount for a Drupal 7 site, but way too small for a full featured Drupal 7 site. My opinion is that 128MB is the minimum and sometimes 256MB is necessary on a large site with many modules.
If I don’t increase the memory limit, I’ll usually get an error on most sites the first time I try to run update.php after updating some contrib modules.

#2 - Uncomment “RewriteBase /”

For clean URLs to work on Drupal in Rackspace Cloud Sites, you must uncomment the line in your .htaccess files that says “RewriteBase /”. Without this line, Drupal won’t give you the option of turning on clean URLs during installation.
For Beginners: uncommenting in the .htacces file simply means deleting the “#” character at the beginning of the line.

#3 - Disable the Overlay Module

This is really just a general tip for Drupal 7. The overlay Module, while cool, definitely slows down the admin side of a site. If you can live without the niceness, it will make building and managing the site much quicker.

#4 - Write Shell Scripts for Repetitive Tasks

One of the biggest negatives of Rackspace Cloud Sites is the lack of shell access. The best alternative we’ve found for repetitive tasks is to write shell scripts, then set up a cron job to run the script. A couple of examples of shell scripts we use are zipping and unzipping archives, dumping and restoring databases, and mirroring a live site back to a development site if they are in the same Cloud Sites account.

#5 - Turn on Caching

This tip really goes for any production site, but especially in Rackspace Cloud Sites. A Drupal site without caching on can seem slow in this hosting environment, but once caching is on, it’s much faster. If you are using Cloud Sites as a development environment, then leave caching off or you’ll pull your hair out wondering why your site changes are showing up. But once the site is live, turn it on.
The cache settings in Drupal 7 are found at: /admin/config/development/performance
Check the boxes next to:
  • Cache pages for anonymous users.
  • Aggregate and compress CSS files.
  • Aggregate JavaScript files.
And select the options:
  • Production (minified)
  • Google
Also, remember that Rackspace Cloud Sites charges based on “compute cycles,” so turning on cache will help keep costs down once the site is live.
Try these tips with your Drupal 7 site on Rackspace Cloud Sites and we guarantee your experience will be much improved. Also check out these other helpful articles we’ve written about Drupal.

A trick to find unused PHP files (Drupal template files)


Drupal registers every single theme implementation, including template files, in the theme registry. You could create a custom module and implement hook_theme_registry_alter() to inspect the theme registry to find what templates are being used by your theme. From there, you could compare your theme folder with the list you generated.
Example implementation:
function mymodule_theme_registry_alter(&$theme_registry) {
  global $theme_path;

  $templates_used = array();

  foreach ($theme_registry as $theme) {
    if (!empty($theme['template']) && $theme['path'] === $theme_path) {
      $templates_used[] = $theme['template'] . '.tpl.php';
    }
  }

  // Display the list (requires Devel module)
  dsm($templates_used);
}

Tuesday, 20 December 2011

Play With Google Gravity

just search "google gravity" on the google
u shuld found a result
http://mrdoob.com/projects/chromeexperiments/google_gravity/

Root HTC Amaze 4G On Android 2.3.4 Gingerbread Permanently With ‘One Click Root’


Good news, folks! The critically acclaimed HTC Amaze 4G can now be rooted! If you’ve got one and want to be able to install root-only apps like Titanium Backup, then follow our guide after the jump!

The root tool comes from developer xboarder56 over on popular forum for Android hacking / development XDA-Developers.
From XDA:
Hi,
guys this is a One Click Perm Root tool and its verified working. Even after reboot no more bricks like the old one Crack eyes made. It will root your phone and it will stay rooted after multipule (sic) reboots. Enjoy.
How To Root HTC Amaze 4G With One Click Permanent Root Tool
DISCLAIMER: Redmond Pie is not to be held responsible for any loss of data as a result of the malfunctioning of your HTC Amaze 4G in the following of this guide. Follow at your own risk.
Note: This root will be permanent or temporary based on the state of your bootloader. If it is locked, the root will be temporary and you will have to re-root every time you restart your device. However, if it has been unlocked, root will be permanent. You can follow this guide on XDA to unlock your bootloader.
Alright, so before we get down to it, we suggest you download these files beforehand so that the actual rooting process can be done quickly.
Although the process shouldn’t take more than 5 minutes to complete, be sure to ensure that your HTC Amaze 4G has enough charge to last through the rooting process. If your device runs out of battery during rooting, there is a chance that you might brick it.
Step 1: Install HTC Drivers on your computer so that One Click Perm Root can detect your HTC Amaze 4G properly.
Step 2: Connect your device to your computer through USB.
Step 3: Enable USB Debugging on your HTC Amaze 4G from Settings > Applications > Development.
Step 4: Extract Zerg_Root_OneClick.zip (which you downloaded before Step 1) to C:\ and launch ZergRushTempRoot.bat
Step 5: Your HTC Amaze 4G will now be rooted. The process will take up to 3 minutes.
Step 6: Reboot your device.

If you need help or have any queries, visit the official threadGood news, folks! The critically acclaimed HTC Amaze 4G can now be rooted! If you’ve got one and want to be able to install root-only apps like Titanium Backup, then follow our guide after the jump!




The root tool comes from developer xboarder56 over on popular forum for Android hacking / development XDA-Developers.

From XDA:

Hi,

guys this is a One Click Perm Root tool and its verified working. Even after reboot no more bricks like the old one Crack eyes made. It will root your phone and it will stay rooted after multipule (sic) reboots. Enjoy.

How To Root HTC Amaze 4G With One Click Permanent Root Tool

DISCLAIMER: Redmond Pie is not to be held responsible for any loss of data as a result of the malfunctioning of your HTC Amaze 4G in the following of this guide. Follow at your own risk.

Note: This root will be permanent or temporary based on the state of your bootloader. If it is locked, the root will be temporary and you will have to re-root every time you restart your device. However, if it has been unlocked, root will be permanent. You can follow this guide on XDA to unlock your bootloader.

Alright, so before we get down to it, we suggest you download these files beforehand so that the actual rooting process can be done quickly.

HTC Drivers [MultiUpload Link]
One Click Permanent Root tool [MultiUpload Link]
Although the process shouldn’t take more than 5 minutes to complete, be sure to ensure that your HTC Amaze 4G has enough charge to last through the rooting process. If your device runs out of battery during rooting, there is a chance that you might brick it.

Step 1: Install HTC Drivers on your computer so that One Click Perm Root can detect your HTC Amaze 4G properly.

Step 2: Connect your device to your computer through USB.

Step 3: Enable USB Debugging on your HTC Amaze 4G from Settings > Applications > Development.

Step 4: Extract Zerg_Root_OneClick.zip (which you downloaded before Step 1) to C:\ and launch ZergRushTempRoot.bat

Step 5: Your HTC Amaze 4G will now be rooted. The process will take up to 3 minutes.

Step 6: Reboot your device.



If you need help or have any queries, visit the official thread on XDA-Developers. on XDA-Developers.Good news, folks! The critically acclaimed HTC Amaze 4G can now be rooted! If you’ve got one and want to be able to install root-only apps like Titanium Backup, then follow our guide after the jump!






The root tool comes from developer xboarder56 over on popular forum for Android hacking / development XDA-Developers.


From XDA:


Hi,


guys this is a One Click Perm Root tool and its verified working. Even after reboot no more bricks like the old one Crack eyes made. It will root your phone and it will stay rooted after multipule (sic) reboots. Enjoy.


How To Root HTC Amaze 4G With One Click Permanent Root Tool


DISCLAIMER: Redmond Pie is not to be held responsible for any loss of data as a result of the malfunctioning of your HTC Amaze 4G in the following of this guide. Follow at your own risk.


Note: This root will be permanent or temporary based on the state of your bootloader. If it is locked, the root will be temporary and you will have to re-root every time you restart your device. However, if it has been unlocked, root will be permanent. You can follow this guide on XDA to unlock your bootloader.


Alright, so before we get down to it, we suggest you download these files beforehand so that the actual rooting process can be done quickly.


HTC Drivers [MultiUpload Link]
One Click Permanent Root tool [MultiUpload Link]
Although the process shouldn’t take more than 5 minutes to complete, be sure to ensure that your HTC Amaze 4G has enough charge to last through the rooting process. If your device runs out of battery during rooting, there is a chance that you might brick it.


Step 1: Install HTC Drivers on your computer so that One Click Perm Root can detect your HTC Amaze 4G properly.


Step 2: Connect your device to your computer through USB.


Step 3: Enable USB Debugging on your HTC Amaze 4G from Settings > Applications > Development.


Step 4: Extract Zerg_Root_OneClick.zip (which you downloaded before Step 1) to C:\ and launch ZergRushTempRoot.bat


Step 5: Your HTC Amaze 4G will now be rooted. The process will take up to 3 minutes.


Step 6: Reboot your device.






If you need help or have any queries, visit the official thread on XDA-Developers.

How To Root T-Mobile Samsung Galaxy S II On Android 2.3.5


Great news, folks! All variants of the Samsung Galaxy S II on US wireless carriers AT&T, Sprint and T-Mobile are now root-able. We’ve already covered how to root the Epic 4G Touch, and today we’ll go through the method with which you can root T-Mobile’s Galaxy S II variant.
20111020161559123
The root method comes from Rootzwiki – a popular forum for Android hacking/development – in a post from developer slayher where he goes through the different modalities of the whole procedure.
How To Root T-Mobile Galaxy S II On Android 2.3.5 Gingerbread
DISCLAIMER: Redmond Pie isGreat news, folks! All variants of the Samsung Galaxy S II on US wireless carriers AT&T, Sprint and T-Mobile are now root-able. We’ve already covered how to root the Epic 4G Touch, and today we’ll go through the method with which you can root T-Mobile’s Galaxy S II variant.






The root method comes from Rootzwiki – a popular forum for Android hacking/development – in a post from developer slayher where he goes through the different modalities of the whole procedure.


How To Root T-Mobile Galaxy S II On Android 2.3.5 Gingerbread


DISCLAIMER: Redmond Pie is not to be held responsible for any loss of data as a result of the malfunctioning of your Samsung Galaxy S II for T-Mobile.


Download the following files first:


Samsung Kies [Official Website]
ODIN v1.85 [XDA Thread]
ClockworkMod Recovery for T-Mobile Galaxy S II [Direct Link]
Superuser zip file [Goo-Inside Page]
Step 1: Install Samsung Kies on your T-Mobile Galaxy S II. This is to ensure that ODIN can detect your phone with correct drivers in the next step.


Step 2: Launch ODIN v1.85.


Step 3: Turn off your phone, hold Volume Up + Volume Down and plug in your device to a computer via USB cable.


Step 4: Once your device is recognized, select the PDA button from ODIN and navigate to recovery-cwm-hercules.tar. Click on Start. recovery-cwm-hercules.tar will now be flashed to your phone and it will reboot.


Step 5: After rebooting, pull down notification drawer and mount USB storage by tapping connect USB storage.


Step 6: Transfer the su-3.0.5-efgh-signed.zip you downloaded before Step 1 to your SD card.


Step 7: Turn off your phone once again and unplug USB cable. Hold Volume Up + Volume Down and click the Power button.


Step 8: You should boot into ClockworkMod (CWM) Recovery. From here, navigate to backup and storage > backup to take a nandroid backup of your device which may be used in case anything goes wrong. 


Step 9: From CWM, navigate to install zip from sd card > choose zip from sdcard > su-3.0.5-efgh-signed.zip


Step 10: Reboot your phone by choosing reboot system option from main menu.


If you followed the steps correctly, your T-Mobile Galaxy S II should now be rooted on Android 2.3.5 Gingerbread not to be held responsible for any loss of data as a result of the malfunctioning of your Samsung Galaxy S II for T-Mobile.
Download the following files first:
Step 1: Install Samsung Kies on your T-Mobile Galaxy S II. This is to ensure that ODIN can detect your phone with correct drivers in the next step.
Step 2: Launch ODIN v1.85.
Step 3: Turn off your phone, hold Volume Up + Volume Down and plug in your device to a computer via USB cable.
Step 4: Once your device is recognized, select the PDA button from ODIN and navigate torecovery-cwm-hercules.tar. Click on Start. recovery-cwm-hercules.tar will now be flashed to your phone and it will reboot.
Step 5: After rebooting, pull down notification drawer and mount USB storage by tappingconnect USB storage.
Step 6: Transfer the su-3.0.5-efgh-signed.zip you downloaded before Step 1 to your SD card.
Step 7: Turn off your phone once again and unplug USB cable. Hold Volume Up + Volume Down and click the Power button.
Step 8: You should boot into ClockworkMod (CWM) Recovery. From here, navigate to backup and storage > backup to take a nandroid backup of your device which may be used in case anything goes wrong. 
Step 9: From CWM, navigate to install zip from sd card > choose zip from sdcard > su-3.0.5-efgh-signed.zip
Step 10: Reboot your phone by choosing reboot system option from main menu.
If you followed the steps correctly, your T-Mobile Galaxy S II should now be rooted on Android 2.3.5 Gingerbread

Root Samsung GALAXY Note On Android 2.3.5 Gingerbread


No sooner does Samsung release its smartphone-cum-tablet Galaxy Note does it become root-able. With a 5-inch, 1280×800 screen with Super AMOLED HD Plus display, it certainly makes abig first first impression, and is a unique entry to the fiercely competitive mobile devices market.
samsung-galaxy-note-lead
Courtesy of the guys over at AndroidNZ, those owning the large yet small device can root it – and we’ve enclosed a simple tutorial to help you en-root.
How To Root Samsung Galaxy Note On Android 2.3.5 Gingerbread
PLEASE NOTE: Redmond Pie will not be held responsible for any loss of data as a result of the malfunctioning of your Samsung Galaxy Note. Follow instructions at your own risk! There’s currently no way to reset the flash counter, so by continuing, you agree to kiss any warranty goodbye.
With the formalities behind us, you’ll need assemble the necessary files:
Step 1: Install Samsung Kies on your PC (download link above) for your Samsung Galaxy Note, which will ensure that ODIN is able to detect your device.
Step 2: Launch ODIN v1.85.
Step 3: Switch your device off, hold Volume Up and Volume Down to place your device intoDownload Mode and plug in your device to your computer via USB cable.
Step 4: Once ODIN recognizes your device, click the PDA button and navigate to netchip-cwm-update2.tar. Click on Start. netchip-cwm-update2.tar will now be flashed to your phone and it will reboot.
Step 5: Once you’ve rebooted, press and hold Volume Up, the Home Button and the Power Button to enter recovery mode.
Step 6: If everything is running smoothly, you should now have entered ClockworkMod (CWM) Recovery.
Step 7: Navigate to install zip from sd card > choose zip from sdcard > su-2.3.6.1-ef-signed.zip
Step 8: Finally, Reboot your Note by choosing reboot system option from main menu.
Provided you followed the steps correctly, then congratulations – your Samsung Galaxy Note should now be rooted on Android 2.3.5 Gingerbread.

Saturday, 17 December 2011

Drupal 7 theme structure

I decided to create an explanatory graphic that ilustrate the different theming portions of Drupal 7 and how to access and modify them. This is not a theming tutorial but a quick guide to see the different parts of a Drupal theme.
Notes:
  1. Page.tpl.php is basically where your main layout is. If you are starting from an HTML file, you can do the same as me and rename it to page.tpl.php and start populating the necessary elements. You can see which elements here.

    This page needs to contain everything that goes inside the body (you shouldn't add the <body> tags here).
  2. In Drupal 7 everything that holds content is a region, even the region that holds the "content" block.
  3. Node.tpl.php is the themed representation of a content entry and when listing content this file will be called multiple times, one after another.
  4. A block is just a piece of content that can be plain HTML or be generated from a module. (Like the Login block)
  5. A region is what holds multiple blocks. These are the defined in the .info file and called in page.tpl.php
Worth mentioning:
  • When creating the theme.info file, starting from Drupal 7 you need a region called "content" or the theme will show up as incompatible in Appearance settings.
  • I'm not including all the TPL files but the ones I use the most.