Updates from November, 2009

  • AssignToMe Bookmarklet

    1:14 pm on November 23, 2009 | 0 Permalink

    I’ve been trying to cut down on the number of addons I run. Previously I blogged about my Bugzilla “assigntome” ubiquity command. Turns out it is really easy to turn it in to a bookmarklet. Just drag AssignToMe to your bookmarks toolbar.

    Code:

    javascript:(function() {
        var logout_re = /[\s\S]*Log.*out.*[\s]\s*(.*)\s/m;
        var links = document.getElementById('footer').getElementsByClassName('links')[0].getElementsByTagName('li');
        var user_name = links[links.length - 1].textContent.replace(logout_re, '$1');
        var evt = document.createEvent('MouseEvents');
        evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
        document.getElementById('bz_assignee_edit_action').dispatchEvent(evt);
        document.getElementById('assigned_to').value = user_name;
        document.getElementById('commit_top').click();
    })();
    
     
  • WordpressMU: changing domain names.

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

    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.

     
  • My Life is a Little Bit Easier Now

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

    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.

     
  • MediaWiki: HttpAuth Plugin

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

    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

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

    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