Red X next to Dell DAT72 tape drive in libraries container

Our tape backups haven't been working properly for a few months. I've been really busy and we have nightly off-site backups anyway so I haven't taken a look at it until now.

Initially I thought the backup script had gone crazy and relabeled all the tapes with the same GUID: it complained about tape 1 being in the drive whereas it expected tape 2. Tape 2 was in fact in the drive. Same happened with our other tapes.

After poking around ntbackup and the RSM I noticed that the tape drive had a big red X next to it under the "Libraries" container in Computer Management -> Storage -> Removable Storage. That made me realise that the GUIDs hadn't actually been overwritten, just that the last tape's GUID (and that would be tape 1) had been cached in the RSM's database from before the red X appeared.

After inspecting the backup script's log I noticed the date it stopped working was close to the date I had removed the server's virtual machine snapshots (in a very roundabout way due to constrained disk space, I ended up with a new virtual machine). That made me realise that I hadn't added the tape drive to the new snapshot-free virtual machine's configuration. A couple of clicks after and the backups are working again, yay!

Posted in Uncategorized | Leave a comment

Close frozen SSH session without closing terminal

The VPN connection to my university often drops, leaving me with frozen SSH sessions. I've found out how to close the connection without closing the terminal window. One just has to press these keys in sequence:

ENTER ~ .

Source: Terminate a a frozen SSH session

Posted in Uncategorized | Leave a comment

Ubuntu middle dot compose key sequence

I use Programmer Dvorak as my keyboard layout and can never remember the compose key sequence for the middle dot (or interpunct) character "·". The key sequence is

Compose-key ^ .

Note: it's the circumflex character, not the control key.

Posted in Uncategorized | 1 Comment

Thunderbird and S/MIME certificates: fixing "Unable to sign message." error

I had to generate some SSL certificates and use them to sign emails for a class recently. After creating the PKCS#12 file and importing it into Thunderbird I tried sending an email, which resulted in an error message:

Sending of message failed. Unable to sign message. Please check that the certificates specified in Mail & Newsgroups Account Settings for this mail account are valid and trusted.

First I tried adding the Certificate Authority that had signed my SSL certificate into Thunderbird's Certificate Manager, under the Authorities tab. Thunderbird complained about it already being in the list though. So I searched the list for it (why the hell isn't it filterable? There's tonnes of Authorities ugh) and after quite a while —I wasn't sure whether it was going to be listed under the SSL cert's OU, the CA's OU or the root CA's OU— I finally found the cursed CA under the root CA's OU. Along with the root CA.

Upon clicking "Edit" on both CAs I got a lovely window with three unchecked options:

  • This certificate can identify web sites.
  • This certificate can identify mail users.
  • This certificate can identify software makers.

I guess that's why Thunderbird wasn't able to sign my test email. Checking the second one fixed my problems.

Just as well Thunderbird didn't ask me whether I trust the CA (and its parent CA) that issued my SSL cert when I added it. It might have been a painless experience.

This post brought to you by

Some UX superhero or something?

Posted in Uncategorized | 2 Comments

Date formatting not working after installing qTranslate

I just installed qTranslate to have multilingual entries. It's a really good internationalization plugin, I've used it on other WordPress installations before with great results.

After installing it with WordPress 3.0.1 though, the date format for posts wasn't being parsed, showing instead the raw format:

Posted on %e de %B de %Y by johnny

I found a solution for this on the qTranslate forums:

  • Edit qtranslate_utils.php, line 143 from this:
    $date_parameters[] = '#%#'; $strftime_parameters[] = '%%';
    to this:
    $date_parameters[] = '#%#'; $strftime_parameters[] = '%';

It seems the extra percentage sign makes it so the percentage sign in the format gets interpreted as literal percentage signs and therefore they don't get parsed by strftime().

The formatting in Spanish and Catalan isn't completely fixed though, spurious "02UTC" strings are being added after each date component.

Resources

Posted in Uncategorized | 23 Comments

Merge Excel spreadsheets with common columns

Today I had a problem that is a non-starter when dealing with relational databases: I needed to do an inner join on two sets of data.

Instead what I had was two Excel spreadsheets, and it ended up taking much more time than I would have liked.

I wanted to "join" the spreadsheets based on a common email column. I thought this would be easy: there must be a built-in Excel wizard to do just that, right? Seemingly not, and the solution I ended up finding was to treat Excel like some Frankenstein SQL database.

At first I thought the "Consolidate" feature would accomplish what I needed. I wasn't managing to make it do what I wanted after looking at a few "How to use Excel consolidate" guides though. The guides I was finding were very "point-here, click-that, there you go—magic", without explaining what pointing here and clicking that actually did. I gave up on it.

Then I tried searching for "join tables excel" and got a lot of relevant add-ons that did exactly that, but they all cost money.

Finally I stumbled across a Microsoft article explaining how to do exactly what I wanted with Microsoft Query.

The only problem(s) with the article are:

  • It is aimed at mail merges in Word.
  • I wasn't able to add more than one Excel file as a data source, as they are able to do in the article.
  • It's a ten year-old article. Also it seems the Microsoft Query interface hasn't been updated since Windows 3.1.

It took me some back-and-forth between the article, Excel and Microsoft Query to get the results that I needed so I'm documenting the steps for posterity.

Get the data in the same place

All the data has to be in the same spreadsheet; I didn't find a way to add more than one spreadsheet to Microsoft Query.

In my case, I was trying to end up with the rows from Spreadsheet 1 whose email was the same as in Spreadsheet 2. I just copied the email column from Spreadsheet 2 into Spreadsheet 1.

Define names to use as tables

Microsoft Query uses names defined in Excel to create its "tables". I needed two of these "tables": one for Spreadsheet 1's information (id and email) and one for Spreadsheet 2's information (email, which I'd pasted into Spreadsheet 1).

To create the first table I selected the two columns I wanted and then clicked "Define Name" in the "Formulas" menu, "Named cells" panel. I called it "emailsall".

The second table was created the same way, except selecting the "emails" column that I had pasted in from Spreadsheet 2, and naming it "emailsshort".

Query the "tables"

To get the results of the faux join I wanted I created a new Excel spreadsheet and then clicked on the "Data" menu, then on "From Other Sources" inside the "Get External Data" panel, and finally "From Microsoft Query".

At the "Choose Data Source" screen I selected "Excel Files" and opened Spreadsheet 1. In "Choose Columns", I added the two "tables" that had just been created. When clicking "Next" the Wizard complained about not being able to join the tables itself and they had to be manually joined. I clicked "OK" and in the Microsoft Query window clicked the little "SQL" button.

In the SQL window I edited the query to do an inner join and got the results I needed. The query went something like this:

SELECT emailall.id, emailall.email
FROM emailall emailall
INNER JOIN emailshort on emailall.email = emailshort.email

Finally go to the "File" menu -> "Return Data to Microsoft Excel"

Resources

Posted in Uncategorized | Tagged , | 9 Comments

How to check database type of subversion repository

Doing some maintenance on my Subversion repository --namely taking out a directory and creating a new repository with only that directory-- I wanted to find out how to check what type of database (FSFS or Berkeley DB) my current svn repository uses.

After some searching all I came up with were pages talking about the two database types, not what database type an existing Subversion repository uses. I decided to look around the file structure of my repository and found an aptly-named file called "fs-type". Calling cat on the file told me what I needed:

$ cat {PATH_TO_REPO}/db/fs-type
fsfs

Posted in Uncategorized | Tagged | 2 Comments

Select boot device key on Sony Vaios

Most BIOSes nowadays have a feature whereby pressing a specific F key brings up a one-time boot device selection menu, handy for operating system (re)installs. The BIOS on my new Vaio didn't display any information regarding keys (not even how to get into the BIOS). After blindly trying escape and del, F2 got me into the BIOS. There was no one-time boot option in the BIOS so I did a google search. A random post in a random thread said to try F11, which cycles the boot device through the available media.

I was trying to boot from USB: the first time I pressed F11 during boot the laptop tried booting from the empty CD drive. The second time (I can't remember if the laptop rebooted itself, or if I had to) I pressed F11 it successfully booted from the USB.

Resources

Posted in Uncategorized | Tagged | 23 Comments

Find XPath to any element quickly with FireBug

Edit: I found out that right clicking on a tag in Firebug's HTML tab and clicking on "Copy XPath" is a much quicker method.

I just discovered a way to quickly find the XPath to any element on a webpage with Firebug. This will help me a lot in the development of my Greasemonkey script HorariGlobal.

  • Right-click on element.
  • Click on "Inspect element" entry.
  • Go to HTML tab in the Firebug frame then the style tab on the right.
  • Right-click on empty space in that frame, select "Edit element style"
  • Hover mouse over the text item "element.style {" that has just appeared.

I imagine there is a tool somewhere out there that will do this in one step, but this will do me for now.

Posted in Uncategorized | Tagged , | 1 Comment

"Logon failure: unknown username or bad password." when trying to access Windows XP share from Windows 7

After a recent Windows Update I could no longer access the folders on my Windows XP file server. A window popped up asking for a username and password even though they are both the same on the two computers. The error message each time was "Logon failure: unknown username or bad password."

I typed in my username and password five times. It reached the point where I thought I had gone crazy and was typing in the wrong one: it kept on coming back to me with the dreaded "Logon failure: unknown username or bad password.".

I quickly returned to my senses and guessed something was up with the authentication between XP and Windows 7. A few Google searches later I found out that a Local Security Policy needs changing.

  • Open the Start menu
  • Type "Local Security Policy" in the search box
  • Open Local Security Policy
  • Navigate to "Local Policies" -> "Security Options" and then locate the entry named "Network security: LAN Manager authentication level". Double click on it.
  • In the dropdown list choose "Send LM & NTLM - use NTLMv2 session security if negotiated
  • Click OK

It seems that a recent Windows Update has changed that policy's settings to be undefined, which —from what I can tell— forces NTLMv2 session security always. My XP installation mustn't have NTLMv2 capability and that is why I kept seeing "Logon failure: unknown username or bad password." errors.

After changing the local policy I was immediately able to connect to my network shares again.

Links

Posted in Uncategorized | Tagged , , | 62 Comments