Posts

Showing posts from 2010

Missing files and VirtualStore on windows 7

7-zip dumps files it cannot create in folders like C:\ into C:\Users\user-name\AppData\Local\VirtualStore

Avoiding alias commands in linux

Avoiding alias commands in linux For ex: Use \cp instead of cp

Latest update of openssl breaks Parallels Panel Plesk on Centos - fix

from kb.parallels wget -c http://kb.parallels.com/Attachments/12669/Attachments/sw-cp-server-1.0-6.201004011130.centos5.x86_64.rpm rpm -Uhv sw-cp-server-1.0-6.201004011130.centos5.x86_64.rpm

PECL uploadprogress on Centos

yum install gcc yum install make yum install php-devel yum install php-pear pecl install uploadprogress from http://drupal.org/node/456686

Updating to PHP 5.2 on Centos

wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh yum upgrade mv /etc/php.ini.rpmnew /etc/php.ini mv /etc/httpd/conf.d/php.conf.rpmnew /etc/httpd/conf.d/php.conf /etc/init.d/httpd restart from http://www.atomicorp.com/wiki/index.php/PHP

Win7 vs Snow

Win7: Maximizes windows Crashes less More compatible software Better text editors Uses less memory OSX: Spotlight much better Less frustrating, responds much faster Hangs less Looks awesome Better keyboard shortcuts

Drupal migration process

Turn off clean-urls Set to maintenance mode Enable default themes, set to garland (else also causes blank screens like memory issue) Download app code and DB Install just drupal on new server and test Disable clean urls, uninstall drupal, truncate DB Restore app DB Clear caches Restore app code Enable www redirection in .htaccess if required Modify app settings file, set permissions Set permissions on folders default and files Enable clean urls Check update.php, increase memory in PHP.ini to 32/64 if insufficient Remove from maintenance mode

drupal cache clear all

TRUNCATE   TABLE   cache ; TRUNCATE   TABLE   cache_content ; TRUNCATE   TABLE   cache_filter ; TRUNCATE   TABLE   cache_menu ; TRUNCATE   TABLE   cache_page ;

MSSQL Cannot drop database because it is currently in use

USE   Master ; GO ALTER   DATABASE   AnnoyingDb   SET   SINGLE_USER   WITH   ROLLBACK   IMMEDIATE GO -- and finally DROP   DATABASE AnnoyingDb ; GO

Avoiding a cursor in mssql, with a loop

set   @LoopIndexer   =  1 set   @LoopId   =  1 -- loop through each item while  ( @LoopIndexer <= @CountTtbwsid ) begin -- find the next available row, avoiding a cursor while   not   exists   ( select   @LoopId   from   #ttbwsid   where   id   =   @LoopId ) set   @LoopId   =   @LoopId   +  1 -- work to be done inside cursor -- value for row can be retrieved with a simple select set   @LoopIndexer   =   @LoopIndexer   +  1 set   @LoopId   =   @LoopId   +  1 end

Stop spam on drupal sites

stopforumspam's bannedips.zip gives a latest list of know spam ip addresses - about 37,000 of them. SpamDrupalCsv.zip is csv port of that file that can directly be imported into the 'access' drupal table from cpanel/PhpMyAdmin. This should stop all spam from all those 37k ip addresses. But note that this will render the page yoursite/admin/user/rules unusable since that page does not support paging.

windows 7 sync disable

Can be easily done by clicking on the "disable offline files" button in properties. System will prompt for a restart.

Regex to pull out only integers from a string and ignore floats and fractions

Regex OnlyIntegers =  new  Regex( @"(?<![\.]|[0-9]/)\b[0-9]+(?![\./][0-9]+)(?=[a-zA-Z]*\b)" ); string  InputText =  "the 12mp 2. 00.200 00300 .4500 float values /34 1-1/2 22 33/55 or 3/2 are in the range of 55 mm .555 or 0.550,0.5,-3.000 and the values are 10.44,24.553,1.023, 5.67,2.34" ; Output: 12 2 00300 34 1 22 55

Essential 6x Drupal modules

Very nice list !

Enable clean URLs for Drupal 6.x on Snow Leopard

Enable clean URLs for Drupal 6.x on Snow Leopard

Archive

Show more