Category Archives: Tech

Tech

Firefox 13.0.1 for Linux Not Working With Flash Plugin?

I’ve been a little annoyed with how Ubuntu has been going lately (even though I think it’s a great distribution for new Linux users), and so I’ve been moving my systems back to Debian. My workstation, whose filesystem originated I think on Ubuntu 8.04 and was running 10.04, was the last one to go.

I had some issues because I run RAID1 for my system disks, and then some issues with crypto and booting, but finally I got it up and running, only to find that the brand-new Firefox 13.0.1. did not work with Flash. At all. I couldn’t even see the flash plugin in about:plugins. My searches were all confounded by apparent problems between the latest Flash and Firefox 13 on Windows. However, I’m partly writing this post to help change that.

This morning, my laptop (already running the same version of Debian) came due for its firefox upgrade, so I decided to see whether the same thing happened on upgrade. Sure enough, it did. I’m not sure why I didn’t think of this on Thursday with the workstation, but I checked the filetype of the firefox 13.0.1 binary, and found that it was 32-bit. This is a little funny if you’re an old hand at running 64-bit firefox on Linux, because it used to be the case that none of the plugins were 64-bit and required using nspluginwrapper to run them at all. In this case I had the opposite problem — most of my plugins were 64-bit, but I had a 32-bit browser that couldn’t link to them.

I’m not sure why the Firefox site always gave me the 64-bit download automatically before, and this time gave me the 32-bit download, but I’ll spare you the trouble of trying to find it yourself. Go here (the Mozilla ftp server in the Firefox releases directory), select your release (in this case 13.0.1), and then linux-x86_64. Then select your language (for me, en-US), and finally, the 64-bit Firefox download.

Once I loaded the 64-bit Firefox, sure enough, my plugins came back. Here’s some stuff to help others find this via search engines:

Debian firefox 13 libflashplayer.so linux 32-bit 64-bit flash plugin about:plugins

Extracting certain lines from a file using Perl

As often happens to me when processing data, I needed to extract a specific set of lines from many files. If the files are small or few, or the list of lines is short, this can be done manually. If the list of lines or number of files are large, well, that’s what computers are for.

As Google will reveal, there are a number of ways to hack this up with bash, grep, sed, and other command-line tools, but none (that I know of) are really designed for this.

Here’s my script. It’s designed around some heart model stuff, and we use base-0 (first line is line 0, second line is line 1, etc), while many other tasks require base-1 (first line is line 1, second line is line 2, etc), and I’m sure there are other numbering schemes out there. Therefore, I included an optional base parameter. Without that it assumes base 1.

Note: I have no idea if this works on non-UNIX-like systems (i.e. Windows).

Use it like:

extract_lines.pl <file with list of lines> <file from which to extract lines> [optional base number]

And now, the code:

#!/usr/bin/env perl

use strict;

unless(@ARGV == 2 || @ARGV == 3){
    die "Usage: extract_lines.pl <line number file> <source file> [base]\n";
}

open(NUMBERS, "<$ARGV[0]") || die "Failed to open line number file $ARGV[0] for read: $!\n";
chomp(my @numbers = <NUMBERS>);
close(NUMBERS);

open(SOURCE, "<$ARGV[1]") || die "Failed to open source file $ARGV[1] for read: $!\n";
chomp(my @source = <SOURCE>);
close(SOURCE);

my $base = 1;

if(@ARGV == 3){
    $base = $ARGV[2];
}

# sort inputs just in case
my @sorted = sort { $a <=> $b } @numbers;

# save mem
undef @numbers;

my $nextline;

$nextline = shift(@sorted);
my $currline = $base;

foreach my $line (@source){
    if($nextline == $currline){
        print $line . "\n";
        if(@sorted > 0){
            $nextline = shift(@sorted);
        }
    }
    $currline++;
}

Bug reports welcome, just leave a comment.

Bad experience with UNIXY.net

I erased the former writeup because UNIXY.net is taking steps to resolve the issues I had and refunding my money.

I think the lesson, in the end, is that if you want unmanaged hosting, don’t go with a managed hosting provider. You and the hosts will step on each other’s toes and it will not end well.

Using a Linode disk image on another machine (specifically a KVM guest)

As I mentioned the other day, before shutting down and deleting my Linode, I made a complete copy of the system image using dd per the instructions on the Linode site, using Finnux. I was a bit confused trying to access the contents of that image (EDIT: In a Linux KVM guest), but it turned out to be fantastically simple.

Someone pointed out here that the image produced using the dd command piped through SSH is simply a filesystem, the contents of a partition, and as such no partitions or partition table are visible. To load the image in my new web server and mount it I did the following.

On the guest:

sudo modprobe acpiphp

On the host:

virsh attach-disk <guest name> </path/to/lvm logvol holding the image> vdc --driver phy

On the guest again:

sudo mkdir /mnt/tmp
sudo mount /dev/vdc /mnt/tmp

Done. Hope this helps someone else as well.