Updates from oremjmozillacom RSS

  • WordpressMU: changing domain names.

    oremj 12:12 pm on October 27, 2009 | 0 Permalink | Reply

    Unfortunately, changing domain names in WordpressMU is a manual process. It’s something I’ve come across often and have to look it up each time. Here’s what I did, so I don’t have to look it up again. Original idea from Boris Masis.

    1. Drop and run this script in the root wpmu directory:

    <?php
    define('WP_INSTALLING', true);
    require_once('wp-load.php');
    
    $old_domain = 'olddomain.com';
    $new_domain = 'newdomain.com';
    
    $query = "UPDATE wp_site SET domain = '$new_domain' where domain = '$old_domain'";
    $wpdb->query($query);
    
    $query = "UPDATE wp_blogs SET domain = REPLACE(domain, '$old_domain', '$new_domain')";
    $wpdb->query($query);
    
    $querystr ="SHOW TABLES LIKE 'wp_%_options'";
    
    $tables = $wpdb->get_results($querystr, ARRAY_N);
    
    echo count($tables);
    $query = "";
    if ($tables){
      foreach ($tables as $table){
        $query = 'UPDATE '.$table[0]." SET option_value = REPLACE(option_value,'$old_domain','$new_domain')";
        $wpdb->query($query);
      }
    }
    ?>
    

    2. Edit wp-config.php and set “DOMAIN_CURRENT_SITE” to the appropriate domain.

    That’s it, everything should work properly.

     
  • Operations Status Dashboard

    oremj 10:37 am on September 21, 2009 | 5 Permalink | Reply

    Often when we have an operational issue or outage confusion occurs. We are taking a step to resolve this confusion by creating a status dashboard similar to Google and Twitter. It is mostly a prototype at this point. How can we make this service more useful? Feedback is greatly appreciated.

     
  • Speedup Firefox with VACUUM

    oremj 1:34 pm on August 20, 2009 | 22 Permalink | Reply

    I’ve seen a few posts about VACUUMing Firefox’s sqlite database for better performance, but each requires Firefox to be shut down.

    Here is a way to VACUUM your places database from within the browser.

    1. Go to Tools -> Error Console
    2. Paste the following in the “Code:” text-box: Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsPIPlacesDatabase).DBConnection.executeSimpleSQL("VACUUM");
    3. Press Enter

    Your UI will freeze for a bit while the vacuum runs.

    Resources:

    Cross post from my personal blog.

     
  • Mediawiki Google Search Appliance Integration

    oremj 3:15 pm on October 15, 2008 | 0 Permalink | Reply

    Recently, I was given the task of integrating our old Google Search Appliance with MediaWiki and wrote about it too.  How does that affect you?  If you are using the intranet wiki you should notice the search results are much more relevant.  If you don’t have access to the intranet wiki and would like to integrate mediawiki with your own Google Search Appliance see my post.

     
  • My Life is a Little Bit Easier Now

    oremj 2:56 pm on September 12, 2008 | 1 Permalink | Reply

    Lately, I’ve found the process of assigning a bug to myself slightly cumbersome and wanted to speed up the process. I happen to be a fan of Ubiquity, so I decided to write a command.

    The command assigntome, by default, changes the assigned to field to your user. The whole process can be automated by tacking on the submit noun, which will simulate clicking the “Commit” button.

    To install assigntome subscribe to my Ubiquity feed.

    Cross-post from blog.oremj.com.

     
  • Efficiently Updating Web Sites on Web Clusters

    oremj 10:29 am on March 14, 2008 | 1 Permalink | Reply

    Recently, we ran in to a problem with our web content sync setup.

    Old Setup:

    • Host all web bits on two admin servers
    • Pull via rsync from admin01 server to the apache servers on 5 min staggered cron

    That setup worked fairly well for us for quite a long time, but it doesn’t scale. At about 18 or 20 apache servers pulling at 5 min intervals the admin server was constantly pegged from all the rsync processes scanning the file system.

    We needed something with state, but something that was simple. Revision control has state, but would the operations be quick enough to be useful? It turns out Git was pretty well suited for the task.

    New setup:

    • Host all bits on admin servers
    • Commit bits on admin01 on a 5 minute cron in to git
    • Pull commits via Git to apache servers

    This new setup scales very well, because we only need one file system scan per 5 minutes instead of 20+. The Git fetches are very fast.

    Initial installation:

    admin01:/etc/xinetd.d/git-daemon:

    service git
    {
    disable = no
    type = UNLISTED
    port = 9418
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/git-daemon
    server_args = --inetd --export-all --verbose /www
    log_on_failure += USERID
    }

    Admin01: Import /www:

    cd /www
    git-init
    git-add .
    git-commit -m 'Initial Import'

    Apache Servers initial setup:

    git-clone git://admin01/www

    Commit Cron on admin01 (add any new files and delete any removed files from the repo):

    #!/bin/bash
    lockfile="/tmp/git.lock"
    if [ -f $lockfile ]; then
    if kill -0 $(cat $lockfile); then
    echo "$0 appears to be already running."
    exit 1
    fi
    fi
    echo $$ > $lockfile
    cd /www
    /usr/bin/git-add .
    /usr/bin/git-commit -a -m "AUTO COMMIT: `date +%FT%T`"
    rm -f $lockfile

    Fetch Cron on the apache servers (fetches origin and then resets the /www to origin):


    #!/bin/bash
    cd /www;
    /usr/bin/git-fetch && /usr/bin/git-reset --hard origin;

     
  • Libc Man Pages

    oremj 11:58 am on May 17, 2007 | 6 Permalink | Reply

    I spend about 5 minutes searching for the libc man pages every time I install Debian or Ubuntu.

    The package is ‘manpages-dev’; now I won’t forget!

     
  • MediaWiki: HttpAuth Plugin

    oremj 8:29 pm on January 29, 2007 | 8 Permalink | Reply

    Using MediaWiki behind http authetication was always slightly annoying in the past. One would have to:

    1. Login with their htpasswd credentials
    2. Create account if it did not exist already
    3. Login with their wiki credentials
    4. Remember both sets of credentials

    This extension reduces the previous four steps into one simple step.

    1. Login with htpasswd credentials

    The extension can be downloaded at http://people.mozilla.com/~oremj/HttpAuthPlugin.php and setup instructions at MediaWiki.

     
  • SimpleCaptcha Plugin

    oremj 3:46 pm on December 28, 2006 | 0 Permalink | Reply

    The other day spent several hours searching for a Wordpress MU(WPMU) compatible captcha plugin with no success. I didn’t care about a robust spam fighting packages with Bayesian filtering etc; all I wanted was very simple and accessible plugin. Yesterday, I came up with SimpleCaptcha. So far SimpleCaptcha seems to be working very well against spam bots.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel