Recent Updates RSS Hide threads | Keyboard Shortcuts

  • Speedup Firefox with VACUUM

    oremj 1:31 pm on August 20, 2009 | 3 Permalink | Reply
    Tags: Firefox,

    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:

     
  • Command line pastebin

    oremj 2:53 pm on July 16, 2009 | 1 Permalink | Reply
    Tags: , Python,

    I have been frustrated with copying/pasting command line output to pastebin lately.  To solve the problem I’ve whipped up a simple script to pastebin stdin. Check it out.

     
  • Custom-User-CSS - Wordpress Plugin

    oremj 3:54 pm on February 11, 2009 | 6 Permalink | Reply
    Tags: ,

    I hacked up a new wordpress plugin that gives users more control over the appearance of their blogs.  This plugin is especially useful for WordpressMU maintainers and users.  Read more about it or visit its wordpress.org home.

     
    • sethb 9:18 am on February 12, 2009 Permalink | Reply

      Thanks, Jeremy. I hope to use this to practice some basic CSS experiments with my blog. It’ll be very helpful and I really appreciate your work.

    • Frederick 3:12 pm on February 15, 2009 Permalink | Reply

      Hello and thanks.

      I have a few recommendations for this plugin, especially when used on WordPress µ.

      First of all, add the menu page under the Appearance menu. This can be accomplished with
      add_theme_page('Custom CSS Options', 'Custom CSS', 'switch_themes', __FILE__, 'custom_user_css_options');
      as opposed to the current call under the custom_user_css_menu() function.

      Secondly, when installing for WordPress µ, it is wise to place the plugin folder under /wp-content/plugins/ BUT also to move the main plugin file to /wp-content/mu-plugins/. This will enable the Custom CSS feature for all blogs and users. It is necessary to rewrite the include() function so that the menu page, which exists in /wp-content/plugins/custom-user-css/, can be included or required by the plugin file.

      Hope this helps the plugin.

      Regards,
      Frederick

      • oremj 11:00 am on July 16, 2009 Permalink | Reply

        Thanks for the advice. I’ve moved the options page to the appearance menu and fixed a couple of other bugs in version 0.2.

    • Philip M. Hofer (Frumph) 5:51 pm on March 26, 2009 Permalink | Reply

      custom_user_css.php line(52)

      $css_val = $wpdb->escape(strip_tags($_POST[ $opt_name ]));

      ….
      Yeah I know, redundant, but still helpful. Makes it extra secure.

    • Philip M. Hofer (Frumph) 5:59 pm on March 26, 2009 Permalink | Reply

      function custom_user_css_menu() {
      add_submenu_page(‘themes.php’, ‘Custom User CSS’, ‘Custom User CSS’, 8, ‘Custom User CSS’, ‘custom_user_css_options’);
      }

      This puts the Custom CSS inside the Appearance Menu for users.

    • Wayne 5:02 pm on August 3, 2009 Permalink | Reply

      Do you know whether it’s possible to have a slide-out menu that contains a tag cloud or some other way to browse an archive?

      It would be something like this:

      ARCHIVE (top menu item)
      > TAGS
      >> (all tags listed as slideout)
      > CATEGORIES
      >> (all categories listed as a slideout)
      > MONTH
      >> (all months listed as a slideout)

  • Simple bash locking

    oremj 7:33 pm on December 2, 2008 | 1 Permalink | Reply
    Tags: , IT,

    I often need to create lock files in my scripts, so crontab doesn’t spawn more than one process.  This is a simple bash lock file function I like to use:

    function create_lock {
            LOCK_NAME=$1
            if [[ -e "$LOCK_NAME" ]]
            then
                    OLDPID=`cat $LOCK_NAME`
                    if ps p $OLDPID > /dev/null
                    then
                            return 1
                    fi
                    rm $LOCK_NAME
            fi
            echo $$ > $LOCK_NAME
            return 0
    }

    create_lock doesn’t handle race conditions, but it is typically good enough for me.

     
    • cp 9:57 am on January 14, 2010 Permalink | Reply

      You can avoid the race condition by using “set -o noclobber”. Like this:
      if ! (set -o noclobber; echo “$$” > “/tmp/lock”) 2> /dev/null; then
      echo “locking failed”
      exit 1
      fi

  • Mediawiki Google Search Appliance Integration

    oremj 3:07 pm on October 15, 2008 | 1 Permalink | Reply
    Tags: ,

    I was given the task of integrating our old Google Search Appliance with our internal wiki.    It turns out MediaWiki offers a couple of different ways to alter search functionality: $wgSearchForwardUrl and $wgSearchType.  The $wgSearchType variable accepts a SearchEngine class name and enables custom search back-ends.  SimpleXML and the GSA XML API then allowed me to fetch and process the search results.  After a few hours of tweaking I am pretty happy with the result, a tightly integrated full text search.

    If you are interested in setting up your Google Search Appliance with a mediawiki instance, installation is simple, download or checkout the extension and follow the installation instructions.

     
  • My Life is a Little Bit Easier Now

    oremj 2:42 pm on September 12, 2008 | 3 Permalink | Reply
    Tags: ,

    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.

     
    • DRORASSEMYDAY 9:34 am on October 1, 2008 Permalink | Reply

      Hi
      Nice site!

      G’night

    • ClarkT 8:26 am on December 18, 2008 Permalink | Reply

      Wow, what a coincidence I hate ubiquity feeds as well. I am so glad you developed this amazing tool. Where can I find more of your work.

  • MediaWiki: HttpAuth Plugin

    oremj 7:21 pm on September 7, 2008 | 2 Permalink | Reply
    Tags: ,

    All HttpAuth Plugin development has moved here from my work blog.  Mozilla’s internal wikis have been using the extension without issue.  Is anyone aware of issues that need fixing?

     
    • joe 7:38 am on December 4, 2008 Permalink | Reply

      If you could put the snippet from your diff that goes in to LocalSettings.php into the mediawiki article on your plugin, that’d be swell. The directions for which hook to change didn’t parse too well in my head, I’m afraid.

    • Yranac 4:42 am on July 23, 2009 Permalink | Reply

      Hi, i’m trying to use your extension, y log in the apache popup window and all is ok, the wiki loads, but i’m not logged in the wiki and the user is not created, what i do in the wrong way??

  • SimpleCaptcha Update

    oremj 4:52 pm on September 4, 2008 | 1 Permalink | Reply
    Tags: ,

    I’ve decided to move SimpleCaptcha development to my personal server.

     
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