cvs, Oracle, Subversion, MySQL, Typo3, ssh, Links, OpenACS, Debian, Linux, Emacs, Java, Mac OS X, Safari, Web, Drupal, SEO Hack, Google, Liferay, PHP, irssi, irc, Ubuntu

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;

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.

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 .

Downloading an Entire Web Site with wget

wget --recursive \ --no-clobber \ --page-requisites \ --html-extension \ --convert-links \ --restrict-file-names=windows \ --domains website.org \ --noparent www.website.org Found in Linuxjournal 10/2008

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.

lsof - examples

lsof /bin/bash lists all processes that use the bash shell lsof -p PID lists all open files of the process with the given PID lsof +D /tmp lists all open files in "/tmp" and its subdirectories without paying attention to symbolic links lsof -u user lists all files that are opened by the given user lsof -u ^user lists all opened files that are not opened by the given user lsof -d txt process list a la ps aux lsof +L1 lists all deleted files, that are still opened and use up disk space (files with less than one link) lsof -i network-relevant files lsof -i -P -n all network-relevant files without spelling out the port numbers as services and without resolving the hostname lsof -i6 ipv6-related files lsof -i|grep '\->' lists all active connections lsof -a -i -u www-data lists all network files opened by the user www-data (boolean and with -a)    

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.

Drupal - delete content items of a particular type

  • Put this as a file into your drupal root directory
  • Log on as an admin
  • Call the script from a webbrowser

 
<?php
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

$type="product";

$query= db_query("SELECT nid FROM {node} AS n WHERE type = '%s'",$type);

while ($row = db_fetch_object($query)) {
  print_r($row);
  node_delete($row->nid);
}
?>

 

Syndicate content