Temporary Securing Drupal through Basic Auth in settings.php

We needed to protect our production site from prying eyes for a while with a basic authentication. Using apache basic auth settings seemed not enough. Or actually was too much. We wanted the theme to blend in. So these files were not supposed to get protected. Only our Drupal pages should.

The solution came from http://php.net/manual/en/features.http-auth.php. Adding the following to sites/default/settings.php makes the customer happy and drush too.

Dumping all tables with drush

I want a clean database without clicking.

echo "\
SELECT concat('drop table ', table_name, ';') \
  FROM information_schema.tables \
  WHERE table_schema=schema()" \
| `drush sql-connect` \
| grep "^drop table " \
| `drush sql-connect`

This work only for single drupal / single schema installs.

Updating drupal core

I never tried to do an core update on the command line. Today I tried it.

Get the latest drupal version

drush dl

Check your download

ls
drupal-6.x

Checkout svn drupal-6-core

svn --username=build2be chechout http(s)://my-svn/drupal-6-core/trunk/

Step into drupal version to update

cd trunk/www

Apply the patch

diff -ru ./ ../../drupal-6.x/ | patch -p0

Is this all?

Manage your sites with svn externals

After having worked with subversion for a while I finally got time to restructure my repository layouts. What I want is a simple way to update all the sites I maintain and I want those sites under version control.

Steps I took

  1. Make a drupal core repository
  2. Create your project repository
  3. Reference to the drupal core

Directory layout

In order to get a nice update-able project directory tree we choose a layout listed below.
www/
This contains only drupal core code will live.

Blog tools.

Searching on terms 'blog editor linux' I found these somewhat outdated links Five Desktop Blog Editors for GNU/Linux Users and Five More Desktop Blog Editors for GNU/Linux Users

Having a list is better then having zillions google links.

* GNOME Blog Entry Poster

* Drivel Journal Editor

* BloGTK Blog Editor

* ScribeFire Firefox Extension

Modules I have to check

Modules:

* dhtml_menu

* extlink

* pagination

Themes:

* waffles

Firefox extensions I use atm

This is my list of Firefox extensions.

* CodeBurner for quick lookups for HTML and CSS

* Cooliris nice image wall

* CoolPreviews previews a link hoover

* DownThemAll a much better download manager

* DrupalForFirebug explains enough

* Ghostery for the paranoids among us

* Grab Them All for having full browser screenshots. Is a little arcane to use

* Pixel Perfect for overlaying a design on the development version

* Quick Translation

* SenSEO

* Session Manager for quickly switch browser tabs

grep your heart out

I'm still learning to use more command line options.

Today I wanted to apply Hide machine readable name of menu by default. so I had to search for the context around the drupal #attached_js form tag.

So I type man grep and search for context. And bly me there is an option :)

grep --context=4 -r "attached_js" *

Which is _cool_

Finally I can blog remotely

It took some time and effort to configure but now I found the time and annoyance to give it a try.

Well not quite. The gnome-blog-poster is way to simple. Anyway it works.

The annoyance today is about eclipse. I need eclipse integration with trac and it wasn't working on eclipse 3.4.

So I installed eclipse 3.5 which is the third installation of eclipse in 1 week time sigh. Enabled mylyn and downloaded the trac integration plugin.

From _en_ into a translatable _en_

On a multi language site it is desirable to translate the drupal English into the customers Englich likings.

Steps taken

  1. Goto /admin/settings/language/add
    1. Add a custom languages with language prefix en, name en-ours, english English @ Our place and native English @ Our Place
    2. Make your new language the default.
    3. Disable drupal's en
    4. Change the name en-ours into en