Eric's blog

Blackberry trouble - stupid hackers, or a clever scam?

My BlackBerry ID account has been locked twice in the last 2 days by BlackBerry.  They did this because of numerous failed attempts to guess the password.  The messages were  a complete surprise to me because I haven't even attempted to log in for over a month. 

Every time this happens I get an email telling me the account is locked and a link to BlackBerry's web site to enter my email and request a reset of the password.  That results in a second email with the link to actually reset the password.

At first, I thought that these password guessing attempts are really stupid.  Perhaps some 'script kiddie' randomly guessing or trying out email address and password combinations nabbed in the Gawker Media leak   After thinking about it for a few minutes I realized that they might be about to try a very clever scam.

The scenario I envision is this: after multiple times of trying to hack the account and me being forced to reset the password, I'll receive an identical looking email with the same message - but this one will be a 'phishing' email designed to trick me into revealing my password.  The email will look the same, the web page will look the same, but it will be BrackBerry.com or some equally inane domain to try to trick me.

Time will tell if my suspicions are correct.  I will update this post either way in the near future.

UPDATE - 7 Sept:

I have not received the anticipated 'phishing' email.  Of course, it's likely that gmail filtered it out as spam.  No proof either way.

Drupal, devel themer, and missing files: ui.draggable.js and ui.mouse.js

I'm starting a new Drupal 6 site so I begin by installed a number necessary modules and themes.  I use drush from the command line for these tasks because it's the quickest way.  When I went to the status report I received the following warning messages:

warning: file_get_contents(sites/all/modules/devel_themer/ui.mouse.js): failed to open stream: No such file or directory in /svr/www/drupal/includes/common.inc on line 2400
# warning: file_get_contents(sites/all/modules/devel_themer/ui.draggable.js): failed to open stream: No such file or directory in /svr/www/drupal/includes/common.inc on line 2400.

A quick search found this discussion on drupal.org, last updated in May of 2011.

It turns out the solution is simple: after you install jquery.ui you simply copy the ui.draggable.js file into the devel module folder like this:

cp sites/all/libraries/jquery.ui/ui/ui.draggable.js sites/all/modules/devel/.

A refresh of the status report shows the problem is solved.  Apparently, ui.mouse.js no longer exists but once draggable was there the error went away.

Presumably, there will be a fix at some point.  For now the solution is trivial.

Installing Asciio in Ubuntu

Several times a year I need to create a diagram - usually a flow chart or network diagram - in a form known as "ASCII art".  This is because I typically use text-only email and for simple diagrams it's easier to include a small piece of "ASCII art" than it is to create an image and attach it to the email.  Let me note that I'm not talking about ASCII art like the ASCII rendering of the Mona Lisa or Barrack Obama. Instead I mean an ASCII diagram like this:

                   .---------------.
         .---------| This is a box |-------.
         |         '---------------'       |
         |                                 |
         |                                 |
         |                                 |
         v                                 v
  .------------.        .-------------------------------------.
  | This is a  |        | This is another child box with even |
  | child box  |        | more text than the first.           |
  '------------'        '-------------------------------------'

It can be tedious to create an ASCII diagram - a lot of typing and revising go into even a simple block diagram.

Fortunately, there is an easy-to-use graphical tool for vreating and editing ASCII diagrams.  It's called Asciio - a play on the name of the Microsoft tool, Visio.  It's not too hard to install Asciio but you do have to delve into the command line to get it installed.  Since you're working in ASCII art, the command line is probably not unfamiliar to you.  Even if you have not installed a program like Asciio from the command line before you'll find it's straightforward and, in this case, rewarding.

Here, then, is a brief guide to installing Asciio.  This is installed in Xubuntu but works just as well for Ubuntu and Kubuntu.

  1. Open a terminal window
  2. Become the root user by typing:
    sudo su -
    and then enter your password.
  3. [Optional] To prevent getting a harmless complaint about YAML not being installed:
    apt-get install libyaml-perl
  4. Start perl's configuration:
    perl -MCPAN -e shell
  5. Start installing Asciio:
    install App::Asciio
  6. Now you will have to watch for about ten minutes as Asciio is installed. You have to watch because every time perl comes to a decision it asks for your approval.  For example:
    N/NK/NKH/Directory-Scratch-Structureed-0.04.tar.gz is just needed temporarily during building or testing. Do you want to install it permanently? [yes]
    The "[yes]" means the default answer is 'yes' so if you just hit 'enter'  you'll get the default.  I just end up hitting 'enter' a dozen (or two dozen) times.
  7. At the successful completion you'll be back to the cpan prompt, cpan[7]> and if there are no errors, Asciio is installed!
  8. Type
    exit
    to get back to the root user shell.
  9. Type
    exit
    to get back to the user shell.

Now that you have Asciio installed it's time to make a sample diagram. 

Updating Drupal using drush

Updated 23 Dec 2010: changed the hard-to-read red text to the slightly-easier-to-read yellow and added the note in step 5.

Drupal, like any other software system, needs to be updated from time to time.  As a heavy user of the command line I went looking for a way to apply updates to the core of Drupal using only the Drupal shell, drush, and other Linux (shell) commands.  After a bit of research and experimentation I tested and refined the following procedure until it worked flawlessly on the sites that I maintain.

Later, I discovered that the newer version of the drush update command will update the Drupal core automatically.  Unfortunately, my testing showed that it was not able to update the core in all circumstances.  I got errors and had to resort to this manual procedure to get the job done. While I work on why that happens I'll stick with this procedure which I know will work

Here, then, is a complete procedure for updating the core of your Drupal site entirely from the command line.  As usual, some user command-line competence is assumed.  

For the examples in this procedure the document root directory is /var/www, the Drupal version to be installed is 6.19 and the file ownership is devel:www-data.

Please let me know how it works for you and send me your enhancements, comments, and/or corrections.

  1. Make sure you have a current backup.  That includes your .htaccess and robots.txt files which I rename:
      cp .htaccess .htaccess.custom
      cp robots.txt robots.txt.custom

    Also, if you have any modules that required customizing individual configuration files (CKEditor and CKFinder - I'm looking at you) then be sure to back up those files.  
     
  2. Download the latest version of the core:
      drush dl
     
  3. Change the ownersip of the new drupal version to match your site's policy
      chown -R eric:www-data ./drupal-6.19
     
  4. Now set your site offline:
      drush vset --yes site_offline 1
     
  5. Use rsync to update the installation:
      rsync -vorltD /tmp/drupal-6.19/ .
    NOTE: if you do this as the root user you'll make your site inaccessible unless you go back and set the permissions.
     
  6. Make sure database updates are applied:
      drush updatedb  
     
  7. Confirm the version is as expected:
      drush status 
    returns (in part)
      Drupal version    : 6.19
     
  8. Replace the distribution versions of .htaccess and robots.txt with your custom versions:
      cp .htaccess.custom .htaccess
      cp robots.txt.custom robots.txt

    Replace those other custom files that you backed up.
     
  9. Put your site back on line:
      drush vset --yes site_offline 0
     
  10. I always remove (or rename) the downloaded drupal files in /var/www/drupal-6.19 for security reasons.
      rm -rf  /var/www/drupal-6.19