Remove a list of files as held within a file
An example file called 'list.txt' may contain the following:
/tmp/jar.png /mike/www/* /var/www/html/test.php
To remove them simply enter:
for f in $(cat list.txt); do rm $f done
Or if you don't have any patterns, then it can be done using xargs:
xargs rm < list.txt
Disk Usage on Unix System
du -hd1 (-h human readable, -d1 depth 1-level)
Replicate remote server file directory onto local server
rsync -av user@
e.g. rsync -av mike@66.39.204.501:/usr/www/users/mike/websites/ford ford
Exposed filter change Year to Any
Within Views module when using Date module how to change exposed filter 'Year' to something else like 'Any'.
1. Edit date module file: date/date_api_elements.inc.
2. Insert the line below within the "function date_select_process($element, $edit, $form_state, $form)" and before "return $element;"
$element['year']['#options'][''] = 'Any';
Original Ref: http://drupal.org/node/1145552
Change <Any> within Views Exposed Filter
Within the Views module edit handlers/views_handler_filter.inc
Change the occurance of
Not the perfect solution - but it works.
Customise block.tpl.php
The default block.tpl.php resides at:
modules/system/block.tpl.php
This can be copied and placed within the 'theme' directory. Afterwhich, this version will be used.
Customise block.tpl.php by block
To make specific to a particular block simply include the 'blockname' as follows: block-blockname.tpl.php.
e.g. block-views-news-block_1.tpl.php
Customise block.tpl.php by Region
To make specific to a region where the block is located simply include the 'region' as follows: block-region.tpl.php.
Create variable for use within page.tpl.php
Within the template.php file add something like below:
function phptemplate_preprocess_page(&$vars) {
$vars['random_descriptor'] = rand(1,2);
$vars['sample_variable'] = t('Lorem ipsum.');
$vars['random_key_message'] = rand(1,3);
$vars['faq_terms'] = theme('links', $variables['taxonomy'], array('class' => 'links inline'));
// To remove a class from $classes_array, use array_diff().
//$vars['classes_array'] = array_diff($vars['classes_array'], array('class-to-remove'));
}
Then within the page.tpl.php add something like below: