Skip navigation

App Engine StringListProperty and merge join queries offer the ability to perform searches for a variety of purposes.

Read More »

Finally, a simple explanation of @staticmethod vs @classmethod.

Read More »

Want to Grep through the files of a directory and sub directories recursively?

Read More »

How to redirect a form in drupal 6.

Read More »

This is the best Drupal blog tips I’ve ever seen. It’s got simple to understand Drupal Developer tips which are presented in an easy to read manner.

Read More »

Want to add all new SVN files recursively?

Read More »

If you’re having issues with search engine friendly URL’s in K2 you can use the Artio JoomSef component with the Artio JoomSef k2 extension. Read More »

Drupal 6 node.save uses different methods for saving taxonomy for different taxonomy types.

For multiple select based taxonomy:

(php)

$nodeObj->taxonomy = array(2=>array(15,19));

(python)

nodeOb['taxonomy']['2'] = [15,19]

For tags based taxonomy:

(php)

$nodeObj->taxonomy = array(
  'tags' => array(
         2=>'military,navy'
   )
);

Nginx fastcgi cache with php-fpm can be a super fast of serving WordPress Mu.

Nginx WordPress Mu FastCgi_Cache Conf Rewrites are an interesting thing to get set up because of the cookie situation. You also don’t want to have wp-admin php files cached either. Read More »

Assuming you’ve downloaded ./configure && make && make install the latest nginx and have mysql, svn already installed. More info on installing svn and setting up svn here.

Read More »

import email, getpass, imaplib, os

detach_dir = '.'

### directory where to save attachments (default: current)

m = imaplib.IMAP4_SSL('imap.gmail.com', 993)
m.login('username@gmail.com','password')
keywordsSearch = 'bananas oranges'
searchString = "(ALL SUBJECT '%s')" % keywordsSearch

### m.search(None, "(ALL SUBJECT 'bananas oranges')")
resp, items = m.search(None, searchString)
items = items[0].split()
for emailid in items:
    resp, data = m.fetch(emailid, "(RFC822)")
    email_body = data[0][1]
    mail = email.message_from_string(email_body)
    if mail.get_content_maintype() != 'multipart':
        continue
    print "["+mail["From"]+"] :" + mail["Subject"]
    for part in mail.walk():
        if part.get_content_maintype() == 'multipart':
            continue
        if part.get('Content-Disposition') is None:
            continue
        filename = part.get_filename()
        counter = 1
        if not filename:
            filename = 'part-%03d%s' % (counter, 'bin')
            counter += 1
        att_path = os.path.join(detach_dir, filename)
        if not os.path.isfile(att_path) :
            fp = open(att_path, 'wb')
            fp.write(part.get_payload(decode=True))
            fp.close()

There is an issue with Drupal 6 menu router rebuild which causes Drupal to time out with 404 pages or internal 500.

The following fix worked for me:

Install Drupal Tweaks, increase php memory, and mysql recommendations etc

http://drupal.org/project/drupal_tweaks

Download the following patches:

http://drupal.org/node/251792#comment-1831346


http://drupal.org/node/317775#comment-1491208

From command line copy patches to your root drupal directory.

cd to your root drupal directory and then apply the patches. Each time you will be asked where the file is for the patch and the actual path to the files to be patched will be provided in the command line. Just copy and paste each file path as presented into the prompt.


cp *.patch /home/drupal_directory/
cd /home/drupal_directory/
patch < no-router-blob-317775-56-D6.patch
patch < lock-251792-163-D6.patch

|--- includes/bootstrap.inc (revision 7577)
|+++ includes/bootstrap.inc (working copy)
--------------------------
File to patch: includes/bootstrap.inc

So in the above text you can see it gives you the path ‘includes/bootstrap.inc’. Just copy and paste that to where it says ‘File to patch:’. For each file it will provide you the correct path to the file assuming you are in the drupal root directory.

The final thing to do is to cp the lock.inc file which is created to includes/

Thematic is a pretty cool theme development framework for WordPress although I believe it can be improved.

Read More »

The fix (change to whatever language or version of english you’re using eg en_GB):

apt-get install language-pack-en-base


export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

Read More »

First install imagemagick.

sudo apt-get install imagemagick

Then cd to your folder with your jpg images and type the following:

mogrify -quality 75 *jpg

Image optimization quality is defined by the number after -quality. In this example 75%.

Sometimes wordpress plugins can interfere with the basic functionality of wordpress such as uploading files.

Read More »

The fundamental blog layout can be pretty crap for converting visitors unless you have exceptional content that can’t be found anywhere else.

The ‘above the fold’ (top of the page before scrolling) area on most blogs is usually taken up by one story and a bunch of basic links in a sidebar. Layouts like Smh homepage are optimized to get a user to click on an article with a selection of images associated with articles.

Hot images can really help increase ctr. The band of images near the bottom of the fold on the shm is a proven converter.

Read More »

If you’ve created a new larger elastic block store volume from a snapshot with more disk space and size you will need to also resize the partition.

Read More »

Update: Forget Wine. Virtualbox from Sun is free and far superior. You can run Ie6, Ie7, Ie8. You’ll need to go to the following page and follow the instructions. It’s important that you read down the comments to get everything set up as needed.

Main article, and comment.

If you get a blue screen of death on start up you will need to start safe mode by (frantically) hitting F8 at Windows boot and choosing safe mode. Once in safe mode run regedit and change Start value to ’4′ for the following then restart windows:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Processor

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Intelppm

Further References Ubuntu ie6, ie7, ie8, Bluescreen fix.

How to install and run Ie6 on Internet Explorer on Ubuntu Ibex with Wine Tricks.

Read More »

If you’re moving or copying MySQL Binary files be sure to do the following:

Read More »

Hilarious excerpts from SlashDot – a nerdy tech site on an article about male fertility:

Read More »

I looked at different ways to “Search and Replace” Text in Files Recursively using the Linux Command Line.

Read More »

Here’s an explanation of a desktop setup for Ubuntu Intrepid Ibex.

Read More »

Here’s a nice post on setting up Nginx with PHP-FPM, Xcache on Debian Etch.

Read More »

If you’d like to include scripts that get run on boot for Ubuntu Desktop you can use synaptic manager to load BootUp-Manager. 

Read More »

Follow

Get every new post delivered to your Inbox.