Nuudelisoppa

  • Archives
  • Encryption and SSDs

    I’ve been contemplating on getting a SSD for my desktop. At the same time, I’ve been meaning to once again get my entire system partition encrypted (for now, I’ve only encrypted a directory within my home directory). I used to run an entirely encrypted system from a traditional hard disk, but I know an SSD is a different beast.

    According to Wikipedia, when software-based disk encryption (such as dm-crypt) is used, using the TRIM command reveals information about which blocks are in use. This means you either have to disable TRIM and risk performace degradation to gain security, or keep TRIM and risk exposing information about your data.

    And at least according to one user on StackExchange, even enabling TRIM won’t help protect the drive’s performance due to how software encryption works.

    So my best bet would be hardware-based encryption such as the one offered by the Kingston SSDNow V+ 100E Series. According to Kingston’s FAQ, the encryption on their disks utilizes the hard disk password feature of the BIOS. From what I gather, that password is used as the encryption key, which means unauthorized access cannot be gained by simply bypassing the disk’s locking mechanism, unlike in drives with no built-in encryption. (It also means once you lose the password, there’s no way to recover your data, as it should be in a truly secure system.)

    Edit: My ASUS M4A78-EM doesn’t seem to support setting a HD password, so it looks like I’m out of luck until I upgrade my motherboard. :(

    Edit: I flashed the mobo with ATA Security eXtension -enabled BIOS and now I can haz hdd passwords.

    2011/09/23
  • Darklock theme for WordPress

    Darklock is a WordPress theme which began as a brach of pinklock.

    Marginaali with Darklock theme The code is released under Creative Commons’ CC0 1.0 Universal license… Apart from the bits I stole from various other people. I’ve credited them sparsely with URL’s accompanying their code.

    As always, this is a work in progress, so it might punch babies when launched.

    Download: darklock-2011-09-19_15-03.zip (82 kB)

    2011/09/19
  • Fixing checkgmail in Ubuntu 10.04 (Lucid Lynx)

    Note: This is an as of yet untested solution. I applied it remotely and haven’t had a chance to verify that it actually works. Also, these aren’t the exact steps I took but a sketch. Please try to understand what you’re doing with each command before executing it.

    1. sudo checkgmail -update # answer yes to update
    2. wget 'http://ur1.ca/5284y' -O /tmp/checkgmail.patch # [1]
    3. sudo patch `which checkgmail` /tmp/checkgmail.patch

    I based this on the thread with the patch over at SourceForge and some other thread on Ubuntu Forums (I think), which I don’t have the link to right now.

    [1] The shortened url points to http://sourceforge.net/tracker/download.php?group_id=137480&atid=738663&file_id=423104&aid=3406322 (where the patch lies).

    2011/09/11
  • First notes of Drupal

    1. Contrary to what Quick install for beginners claims, Drupal does not require a “new, empty database”. Your old database with data from other apps such as WordPress will do just fine. Drupal will even allow you to set a table prefix during installation, so it’s not the database hog it’s made out to be by that claim in the installation guide.
    2. Pay attention to your choice of language during installation! Technically you can change it via the interface later on, but the change will be incomplete: some strings are generated during installation time and can only be edited by hand.
    3. Apropos, also the changing of an article’s language after publishing requires a bit of weird trickery.
    4. Displaying full articles instead of teasers: Home » Administration » Structure » Content types » Basic page » Custom Display Settings: Switch from ‘Teaser’ to ‘Full content’. (Not in a million years would I have deduced this from “Use custom display settings for the following view modes”.) You’re still stuck with the “Read more” link, however.
    5. Cache clearing button is in Home » Administration » Configuration » Development » Performance.
    2011/09/09
  • Pinklock theme for WordPress

    Pinklock is a WordPress theme which began as a brach of warlock.

    The code is released under Creative Commons’ CC0 1.0 Universal license… Apart from the bits I stole from various other people. I’ve credited them sparsely with URL’s accompanying their code.

    As always, this is a work in progress, so it might punch babies when launched.

    Download: pinklock-2011-08-28_13-10.zip (70 kB)

    2011/08/28
  • Mass re-uploading of media with WordPress and Cache Images

    For quite a while in the past, I was in the bad habit of uploading the media associated with my posts in a separate storage directory on the server. I didn’t even bother to categorize it much, just dumped the stuff in ad-hoc subdirectories and forgot about it.

    Over time, the storage directory became unmaintainable as stuff kept piling in and it was difficult to keep track of which pages each file was associated with. At the same time the built-in media handling in WordPress became quite efficient and accessible. So I switched to using that instead.

    But there was still the problem of past media, laying around in the old storage directory, uncategorized, linked to in god knows where. I began to manually fix old posts referring to the storage, but there were dozens and dozens of pages worth of posts to fix individually, so I soon grew tired.

    I was planning to write some one-time code to do the per-post re-uploading, when I discovered Cache Images. I quickly realized I could exploit it to my benefit in this case: using another alias for my server I could make Cache Images re-upload each file for me.

    I began with individual files to see if everything would work as planned. Turns out there was a slight cosmetic error in the upload: the files would go into the current month’s upload directory instead of the directory corresponding to the old post’s date. This was bug #16777 in WordPress’ tracker, and there was a diff file I could patch my WordPress installation with. Luckily, the patch worked just fine and now the images each went to their respective monthly directories.

    There’s still the issue of WP Smush.it not working properly. I’m told that Yahoo! are in the process of switching servers, which should hopefully fix the errors I’m getting, but in the meantime I’ve disabled smushing altogether. It’s too bad, it would’ve been good to get the pictures smushed en masse while re-uploading.

    2011/07/26
  • Warlock theme for WordPress

    warlock is a WordPress theme which began as a brach of nihil, but yet again with a different focus: to be an exercise in HTML5 and jQuery.

    Screenshot: Warlock applied to WordPress The code is released under Creative Commons’ CC0 1.0 Universal license… Apart from the bits I stole from various other people. I’ve credited them sparsely with URL’s accompanying their code.

    As always, this is a work in progress, so it might punch babies when launched.

    Download: warlock-2011-07-07_19-19.zip (74 kB)

    2011/07/07
  • jQuery-style function calls with callback parameters & parameter expansion defaults

    Disclaimers:

    1. I’m still learning my way with jQuery.
    2. Code here is pseudocode carved from functioning code (and even then only partly so), so it’s untested in real world.

    I was curious as to how jQuery does parameter expansion in event handlers with callbacks. Googling I could only come up with resources that would call their custom functions with parameters given as object literals, like so:

    myFunc({
      parameter1 : 12345,
      parameter2 : "foo"
    });

    , which, when using a callback parameter, would go something like:

    myFunc({
      parameter1 : 12345,
      callback : function() {
        return true;
      }
    });

    Now, there’s nothing wrong with that as such. What I wanted however, was to be able to call my custom functions in the elegant way jQuery does it, without the object literal brackets surrounding the parameters, like so:

    myFunc(12345, function() {
        return true;
    });

    Here’s how I could achieve this:

    jQuery.fn.myFunc = function() {
    	var options = {
    		parameter1 : (arguments[0] || 0),
    		callback : (arguments[1] || function() { return false; })
    	}
    
    	do_stuff_with_param1(options.parameter1);
            return options.callback();
    }
    2011/06/30
  • Bitlbee, Twitter, 403, base_url, “could not find setting”

    The 403 issue is fixed in a new release of Bitlbee, but those of us relying on third-party servers running older versions need to use a workaround. Comment #3 by wilmer on the tracker ticket says the workaround is to issue:

    ac tw2 set base_url http://api.twitter.com/1

    However, applying this to settings on my server running Debian Lenny took some effort, so I’m making a note of the working format here:

    account set 2/base_url 'http://api.twitter.com/1'

    (where ‘2’ is the number of my bitlbee account connected to twitter)

    2011/06/30
  • (Bash) command line equivalent of strip_tags()

    php -r 'echo strip_tags(file_get_contents($argv[1]));' file_to_strip

    And as an alias:

    alias strip_tags="php -r 'echo strip_tags(file_get_contents(\$argv[1]));'"
    2011/06/13
←Previous Page
1 … 9 10 11 12 13 … 214
Next Page→

Nuudelisoppa

Good Noodles.

Twenty Twenty-Five

Designed with WordPress