Dirk's blog

Shrinking InnoDB files

On one of my Typo3 installations I found an unusually large InnoDB file (Typo3's indexed_search being the culprit).

dev.mysql.com/doc/refman/5.1/en/adding-and-removing.html is a bit more complex. Instead of mysqldump (step 1 per documentation) I ran this SQL statement, following Nickolay Pelov's suggestion.

Here are the SQL statements I used to create the scripts to shrink this file:

use information_schema;

Technology:

Installing Ubuntu Jaunty Jackalope on a Asus A8V-MX motherboard with SATA drives only

Note to self: if you want to install Jaunty Jackalope (Ubuntu 9.04) on a Asus A8V-MX motherboard and you have SATA drives only, they will not be recognized unless you load the kernel with these options:

irqpoll noapic pci=nomsi

These options should be added to your grub boot configuration as well.

Technology:

Typo3 4.1.8 and PHP4

Running Typo3 4.1.8 with PHP4 is a bit more involving that stated on the Typo3 download page.
Follow the instructions here: http://bugs.typo3.org/view.php?id=10214 .

Technology:

Impersonate as the Googlebot

The second most stupid thing is reconfigure your webserver so that it acts differently when the Googlebots comes along. This is called cloaking and Google cleary doesn't like it: Cloaking, sneaky Javascript redirects, and doorway pages

There are sites that provide to-pay-for content or that want you to register so that they can associate surfing behaviour with a pseudonym. It may e. g. be the web presence of a high-profile magazine with a small circulation and a high subscription price. Such content is highly valuable to a small group of people. Their content would cleary rank highly for some specific keywords on Google.

So what do these people do to remain relevant on Google?

They reconfigure their webserver to let the "user agent" Googlebot access their site without registration.

So here's my first SEO hack: become the Googlebot once in a while. Download the Firefox Extension "User Agent Switcher" and add a user agent Googlebot whose user agent field simply reads "Googlebot". Surf as the Googlebot and be surprised on some sites.

How to find those sites through Google: if you can't locate the preview snippet on the page itself and the cached version of the page is vastly different from the found page - you know this webmaster is trying to cloak Google.

Technology:

Migrating an OSCommerce shop to Drupal ubercart

Here are my notes from migrating an OSCommerce installation to a Drupal ubercart system.

Firstly dump all the products with their names and ids from the OScommerce database. Then import this data with the node import module. I've imported the id field into the description because at this point in time I couldn't figure where the sku was stored.

Technology:

Typo3 indexed_search and tt_news - index_rel growth

The Typo3 extension tt_news is causing problems with indexed_search. The table index_rel grows quickly to an enormous size, 28 million rows on one of my sites. This caused two problems:

  • the nightly backups took a lot of time, the automated restore on the standby machine wouldn't even finish anymore.
  • Typo3 search generated huge SQL queries that would bring down the MySQL server.

There is a lot of content on this site, but nowhere near 28 million "items" (whatever is in index_rel I do not know).

Technology:

Ignore newline style and whitespace with svn diff

I frequently work in environments where people rather use Notepad than Emacs and then freely commit their changes to the subversion repository. If you then diff your file against the one in the repository, you would get a diff for each line. Subversion can ignore newline style and whitespace diffs with this command:

svn diff -x --ignore-eol-style

Technology:

Copy your ssh public key to another machine

If your flavor of Unix doesn't come with ssh-copy-id - does only Debian have it? - , then create a file called ssh-copy-id in your $PATH with:

cat ~/.ssh/*.pub | ssh $1 'mkdir .ssh; chmod 700 .ssh; cat>>.ssh/authorized_keys'

You can then copy your public key to another machine by running ssh-copy-id remoteuser@remotehostname.

Technology:

Oracle: Duplikate in einer Datenbanktabelle entfernen

So entfernt man Duplikate in einer Oracle-Datenbanktabelle mit Hilfe von "Analytical SQL":

delete from
tabelle
where rowid in
(select rowid from
(select
rowid,
row_number()
over
(partition by feld1,feld2 order by feld1, feld2) dup
from tabelle )
where dup > 1);

Technology:

Subscribe to RSS - Dirk's blog