Categories
Computers

Moving Linux to a New Hard Drive- a HowTo

About a week ago, I discovered that my primary hard drive was starting to enter its death throws. I was consistently receiving I/O errors and in one case, I had to reboot the system and perform an fsck on the root file system to repair the errors. Fortunately, the system was stable enough for long enough that I was able to come up with a replacement drive.

Yesterday, I set about migrating everything to the new hard drive. FWIW, it’s a 500GB, 3Gb SATA Barracuda from Seagate. Searching around, I came up with 2 articles (here and here) to guide me a bit. The hard part ended up being getting GRUB2 installed properly.

I’m happy to report that I’ve got everything running. After the jump is the process I used. The advantage for this process is that everything is done from the shell. There is no need to separately run an install program on the new drive or to figure out esoteric grub commands. If that sounds good to you, then let’s proceed…

Categories
Computers

Connectbot Is Awesome

I blogged this from my new Nook Tablet using Connectbot to ssh into my desktop and use my command line blog client, which relies on vi. Yes- I used vi with the Nook Tablet. Seriously, how cool is that?

That said, I won’t be doing it much. Just this short post was an exercise in tedium. The Tablet isn’t made for typing documents. Still, it’s useful enough.

More on that later.

Categories
Computers

Weird Apache2 Error

A couple of days ago, I was trying to update my older netbook, which is now the kids netbook, and I got a bunch of strange errors during the update. A little later that morning, I discovered that my internal web server had stopped working. It’s a pretty vanilla apache install from the debian/wheezy repo. The only mods I’d made were to allow for support of the public_html folder in user directories as well as setting it up for WordPress.

I’d performed an update over the weekend and my guess is that is when it got zooted. When I tried to restart the server I got the following error message:

/usr/sbin/apache2: 1: /usr/sbin/apache2: Syntax error: ")" unexpected
Action 'configtest' failed.

This meant next to nothing to me. I mean, it looks like an error in the compiled image, but that makes no sense. I had an even more cryptic error in the error.log file which I can’t reproduce because I deleted it in the process of getting it running again. But it read similar to the above with a bunch of what looked like Unicode characters after it- in other words, no text but a bunch of symbols. Very weird. Oh, and Google was no help. I seem to be the only one to have encountered this problem.

Ultimately, I was able to get it back by uninstalling and purging all the packages related to apache2. It’s possible it had something to do with the apache2.2-bin package, but I can’t really be sure. All I know is that until I removed everything webserver related, followed by reinstalling, I was unable to get it running again. Before I did that, I archived the configuration directories for apache, php and wordpress so all I’d have to do, hopefully, is replace the stock configuration with my archived settings. As it turned out, that worked.

Ultimately, not a very satisfying conclusion. But it’s running again, so I’ll take it.

Categories
Computers

Debian and Custom Certificates

I noticed yesterday that I was not receiving mail from one of my mail accounts. I’m a fetchmail user, so I immediately went to the log file. I won’t reproduce the exact message, but essentially fetchmail couldn’t validate the ssl certificate from the server because it didn’t think I had the appropriate root certificate.

And just like that, I was off on another expedition into the wonderful land of computer administrivia.

Categories
Computers

Carriers Behaving Badly

I don’t own a smartphone yet. That’s doesn’t mean they don’t intrigue me greatly. But the cold hard fact is the carriers make you pay a lot of money to own a smartphone. Personally, I’d like to own a smartphone without a data plan. I have WiFi here at the house and out an about there are plenty of hotspots to latch onto.

But carriers won’t let me do that. They require a data plan with your smartphone purchase. That’s only 1 of a number of examples of carriers behaving badly. The simple fact is they are bithaulers. That is, their service is really just a trumped up ISP at this point. But they don’t want people to know that, or think about that. They just want money once for moving voice bits over their pipeline, and a second time for moving data over their pipeline.

Wired has yet another example of carriers behaving badly. While I wouldn’t be using Google wallet now if I was a smartphone user, I think people should be allowed to do so if they choose. The convenience of the system is certainly alluring. But rather than compete in the “digital wallet” market, the carriers are using there gate-keeper position regarding phones in an anti-competitive manner.

It’s crap like this that give people little sympathy for the carriers.

Categories
Computers

Positive Reviews for ASUS Transformer Prime

I’ve stated before and I’ll reiterate- I think, hardware-wise, ASUS is Apple’s real competitor. The first Transformer (a tablet with a docking station that combined to form a nice netbook/laptop) was a big success. They’ve got the PadPhone coming, and now they’ve released an updated Transformer, called Prime, with a quad-core processor and it’s getting rave reviews, (the one blemish seems to be hinky WiFi performance on the eval units, ASUS says it’s a non issue.)

All told, the cost is $650 ($499 for the tablet, $150 for the docking station), so it’s still well out of my own league in terms of cost. But it’s right there when compared to an iPad2 and the Prime will also likely get an update to the latest Android software, making it even better.

Interestingly, the iPad2 still gets the nod from reviewers because of it’s App Store advantage. That’s a bit disappointing to me, as I’d really like to see a worthy competitor come up for the iPad2. But it’s also legitimate: if a customer is going to fork over $500+ for a tablet device, it ought to be easily capable of more than browsing and email. Obviously, the iPad2 is there. Not so much for Android based tablets.

Categories
Computers

Say what?

I read [Engadget’s comparison][1] between the Nook Tablet and the Kindle Fire and that’s what I thought when I read their conclusion that the Fire best the Tablet. Up to that point, they gave the Tablet an edge in form factor, performance, display, reading and specs. The only thing that gave the Fire an edge was Amazon’s cloud services. Even there, with Hulu Plus, Netflix and Pandora the tablet isn’t exactly blown away by the Fire. Despite all that, they prefer the Fire. Again, say what?

For my part, I was in the area and stopped by a Barnes and Noble to checkout the Nook Tablet. The nickel version of my impressions are- I liked it. A lot. Almost bought it on the spot. If it weren’t for my unusual ability to resist technology products (despite my enthusiasm for technology and computers), I probably would’ve brought one home. Then spent the evening trying to justify it to the Wife.

Anyway, if interested, read on after the break for more details.

Categories
Computers

Amazon Disappoints

While out and about today, I stopped at a Staples on the chance they’d have a Kindle Fire to check out. Somewhat to my pleasant surprise, they did have the Fire there to play with.

But even more to my disappointment was that the unit was a demo. No, not just a demo unit, a demo period. The only interaction with it was through some kind of flash application that simulated their UI that I’ve been reading about. But I couldn’t launch browse or really try anything else. What’s more, I couldn’t figure out a way to break out of the app to just get to the raw Fire functionality.

A salesperson came over and I asked him if it was possible. He verified that it was not and when I replied that was extremely lame, he agreed. He’d even tried to figure out how to shut down the app so that people could actually use the device, like the other tablets they had on sale there. But to no avail.

I left at that point, since there was no way I’d purchase a Fire without the ability to actually exercise it. Perhaps I’m just being persnickety. But it struck as extremely poor marketing on Amazon’s part.

Categories
Computers

All Hopes on the Nook Tablet

Reading this review of Amazon’s Kindle Fire, it would seem my best bet for a tablet in the short term rests with the Nook Tablet. My overall impression from reading the review is “you get what you pay for.” It almost sounds like the Fire is about the equivalent of the Nook Color performance wise, with some pretty annoying UI deficiencies in addition. I’ll still be curious to play with it, but I’m now thinking either the Tablet will be the way to go or the way to go will be to wait.

Categories
Computers

Liking the Nook

The tablet market really hasn’t interested me to this point. But lately, I’ve started thinking a small “on immediately” device for browsing and reading in general would be nice. A stop at Best Buy revealed no shortage of options to select from; which was a surprise to me. My impressions from what I noted online was the options were pretty slim. I was clearly mistaken in the shear number sense. Although I wasn’t wrong in the cost sense- I think the least expensive tablet I looked at was $300+. A bit more than I’m willing to pay for how I see it being used.

Which brings me to the other tablet I looked at, the Nook Color. Overall, I had a very favorable impression. The interface was simple enough that in the short time I played with it at the demo counter, I felt pretty comfortable using it. Unlike a number of the other tablets I tried, there were no “hiccups” like trying to launch an app and nothing happening, or getting confused by the navigation buttons. The Nook a single hardware button a la the iPad/iPhone/iPod, and then a soft button that dead center on the screen just above that button. Using those two buttons, moving around is easy to figure out.

It had a nice heft to it and fit comfortably in my hand. I was a little surprised that it weighs under a pound, but that’s probably a good thing. The other thing I was pleasantly surprised by was the utility of the 7″ screen. Not having done any in-person research previously, I’d just assumed that the conventional wisdom about 7″ displays (too small) was correct. Having actually played with the Nook Color now, I’d say that assessment is incorrect. I had no trouble reading the display (even with small font sizes) with the device at arm’s length. The Color’s picture quality was excellent as well.

My only criticism would be there was a general sluggish feel to the operation, particularly the browser. The fella behind the counter felt the problem was the WiFi at the store. I’m not so sure about that assessment.

At $200, the Color was by far the best buy I saw out there for tablets. That said, I didn’t get one for the obvious reason- the Kindle Fire and the Nook Tablet are yet to come out. If the Tablet is just a faster version of the Color, and based on the specs that seems likely, it just might be worth the extra $50. But I won’t know that until I get a chance to play with it.

Categories
Computers

Dennis Ritchie- 1941-2011

A tough time for giants of the computer industry.

Dennis Ritchie was a co-creator of the C language, easily the longest lived (outside of assembly) and most prevalent programming language around. He’s also co-author of the best intro book to a programming language, simply titled *The C Programming Language”.

Categories
Computers Lua Programming

lua and require

A cool little feature I just came across with lua is that the require function can be used as part of the actual working code. For instance, an optional piece of functionality can be required based on an option flag. The benefit is unnecessary code is only loaded when it’s wanted.

I just wrote an IMAP4rev1 parser to help with making sure imap commands generated by luaimap are syntactically correct. The idea was to eliminate a potential point of confusion when working with the library. Of course, the checker is pretty green at this stage, so it may give a false negative. But at least is give a starting point to the would be developer.

Typically, I’d just require the module at the top of my code, like so:

local chksyntax = require("parser")

And then the parsing function can be invoked in the usual way.

But in this case, I figured the checker should really be part of the IMAP object that luaimap creates. Then I thought, wouldn’t it be nice if I only loaded the module when syntax checking was desired? That way, after a debug and proving out phase, syntax checking could equally be turned off resulting in fast execution. So I added an options table to the new method and then inserted the following lines of code:

       .
       .
       .
if options then
    if options.syntaxchecking then
        o.__checksyntax = require("parser").parse
    end
end

The other cool thing here is that lua allows for grabbing the parse function reference inside the module. In other words, since require returns a table, I can immediately add the parse element for the assignment without generating a syntax error. This is also because lua treats functions as first class values, so they can be assigned just like other variables.

Now, elsewhere in the IMAP object, I can use the parser like so:

if self.__checksyntax and not self.__checksyntax(cmd) then
    error("I can't in good conscience send this command to the server: "..cmd)
end

Anyway, I thought this a somewhat novel (for me) insight into lua usage, and figured I’d pass it along.

Categories
Computers

luakit- A Minimal Browser that Works

Browsers are one of those software programs I’m always on the lookout for something potentially new and interesting. In particular, I have a soft spot for the minimalistic browsers. The ones that have small executable sizes and are, generally speaking, very quick. In the past I’ve tried uzbl and jumanji, in addition to all of the big boys like firefox, chrome, epiphany, safari and opera.

The problem with the smaller browsers is there always seems to be a page or site that just doesn’t work. Either iti the browser crashed, or something wasn’t supported properly, or the page didn’t render correctly, or the changes were happening to quickly to make it worth the time to customize the browser, only to have everything change and be back at ground zero.

Admittedly, some of that is my fault. That’s the price paid for early adoption.

So when I found luakit, I was intrigued but hesitant. I’m quite familiar with lua and the concept, using lua as a configuration language around a fast, compiled core browsing engine, seemed a good one. I did a little looking around and found pretty overwhelmingly positive reviews. Since luakit was already packaged in the debian system, I decided to give it a go.

And I’m pleasantly surprised to say, I haven’t used any other browser since. First off, it’s very uzbl like, right down to the spartan look of the status bar and command prompt. I don’t mind this at all, since it maximizes the viewing area. It’s highly geared towards keyboard based browsing, including link following. In fact, it’s possible to achieve all browsing without the use of a pointing device. Many standard features are provided like bookmarks, history, tabbed browsing, and quickmarks (basically, like bookmarks except it works with a couple keystrokes).

But what separates it from uzbl is the fact that luakit is tied together by lua. It uses webkit(the browsing library behind safari) and interfaces to gtk widgets for presentation purposes. The result is a browser with a fast, compiled core exposed by bindings via lua. All of the high level functionality is provided by lua code. So if, for instance, I don’t like having a statusbar on the bottom of my screen I can change a couple of lines of code and move the status bar to the top. Or, I can change the way bookmarks are displayed.

What’s nice is, I don’t have to edit esoteric configuration files, or worry about how to make a python module talk to a bash script. Everything is modifiable right in the lua code. What’s more, all of these changes can be accommodated without affecting the main program. A series of configuration files related to windows, key bindings, modes and options are all designed to be user configurable. So modification of actual source code is unnecessary.

There are other nice things about luakit (more on that in a future post), but the best complement I can pay it at this point is it’s the first browser of it’s kind I’ve used where I don’t have to keep going back to a standby. Flash content, ssl, cookies are all handled well enough that they work on all the sites I use frequently without any loss of browsing experience. As I stated earlier, I’ve used it exclusively (on both my 1015PN and my desktop) for several week now. I can’t say that about any other browser I’ve tried. I’ve always ended up back as an opera user.

I mean, let’s face it, tinkering with browser stuff can be fun, but at the end of the day it’s still got to work if I’m going to stick with it. Luakit does just that.

Categories
Computers Lua Programming

bogotrain.lua

My spam filter of choice has been bogofilter for many a year now. For the mail I receive it got to be very accurate quickly and it has remained so ever since. It is one of the Bayesian variety of spam filters and requires “training” to keep it properly classifying email.

I use an IMAP server for working with my mail so integrating bogofilter with the server is less than ideal, which would be to use a keystroke and immediately reclassify the mail. Instead, I’ve assigned a couple of training folders that I then farm out to a script run as a cron job. Specifically, for misclassified spam (i.e. mail that’s actually good but was misclassified as spam) I created a spam2mail folder and for misclassified good mail (i.e. mail that’s actually spam but is classified as good) I use the Junk folder. The script, using IMAP, interrogates the mail folders, retrains bogofilter on the mail, and then places the mail in the appropriate final destination, either my spam folder or my INBOX.

Originally, I wrote the script in question using perl and IMAPtalk. Since I wrote an IMAP library in lua, I figured it appropriate to rewrite the script in lua using my library.

After the break is the code.

Categories
Computers

Streaming with the 1015PN

After Thursday’s debacle with streaming from ESPN3, last night was a bit of redemption. I watched the entire Michigan/ Notre Dame game streaming it through my 1015PN onto our 41″ Sony Bravia.

On the downside, I had trouble getting good video quality. The Nvidia ION graphics processor defaulted to 1080P resolution. The video was very choppy, and it often seemed like it “degraded” to the point where I was just getting stills every 10-15 seconds or so. When I was getting motion, the picture was very blurry. Also, using the Opera browser, the full-screen mode did not work at all. It would give a bigger picture, but it was not full-screen. Rather, it was “window” centered in the screen with a picture that wasn’t centered properly.

I was tempted to lay these issues at my ISP’s door, but I decided to try fiddling with the resolution (per the Wife’s suggestion) to see if that would improve the picture. I also tried a different browser. The results were dramatic.

First, I switched to Google’s Chrome browser. That fixed the full-screen problem.

In conjunction with that, I modified my xorg.conf to limit the resolution the ION was outputting through the HDMI to 720p. I managed that with the following two lines added to the Screen section:

Options "TVStandard"   "HD720p"
Options "MetaModes"    "1280x720"

The TV indicated it was still receiving 1080p over the HDMI connection, but when I relaunched X and reconnected to the game using Chrome, the picture quality was outstanding. Also, I noticed that my statusbar from the window manager was much larger, indicating that I was getting a different resolution. As for the video, it was basically crystal clear with excellent motion. There was a just a little choppiness in the motion, and the occasional blurry patch for certain colors (yellow in particular, no idea why). But overall, the game was completely watchable.

Given those successes, I’ll definitely be doing the streaming thing again. I was quite pleased that the 1015PN proved itself capable, with a little tweaking. The only other thing I need to figure out is how to stop it from suspending. Having to touch the trackpad every few minutes was a nuisance.

Categories
Computers

Updating flashplayer

Last night I had the house to myself for a time so I figured I’d stream the Arizona/ Oklahoma St. game and watch it on our flatscreen TV. I hadn’t had the opportunity yet and it seemed a good one to test out the HDMI port on my 1015PN.

So I configured my 1015 to use the Nvidia ION graphics, plugged in the HDMI cable to make sure both screens were recognized when X started and then brought up ESPN3’s website. But when I clicked on the link to view the game, flashplayer refused to run properly.

So I went through a bunch of steps to try and get it working. I installed chromium, I went to Adobe’s website to test the flashplayer (it was working), I even tried disabling the WiFi and connecting via ethernet. All to no avail.

The only other thing I noticed through all my efforts was that I wasn’t running an up-to-date version of flashplayer. It wasn’t immediately obvious how to update flashplayer either. The plugin package that I have for Opera was properly up-to-date, but there isn’t a repository package to make sure flashplayer is current.

Once again, google and the debian wiki’s saved the day. Updating flashplayer is as simple as running the following command as root:

update-flashplugin-nonfree --install --verbose

For those interested, this command is run as a post install hook when the plugin package is installed.

After running the update command, my flashplayer was updated to RC1 for version 11. I restarted Opera and lo-and-behold, ESPN3 came up and worked.

Too bad the game was over by then.

Categories
Computers

gnucash 2.4.7 on Windows

I’ve spent the last day or so updating the Wife’s desktop to Windows 7. It’s gone pretty smoothly, although it’s taken more time to install “updates” than it did to install the OS. Whatever.

After I reinstalled gnucash, I attempted to setup the online banking stuff. I figured I should be able to get it to work since it had been working just fine with a previous version of gnucash. Unfortunately, I couldn’t get any joy, even with all of the info from the previous install. I even tried to build the data files to configure accounts and users, to no avail.

Today, I finally solved the problem. When setting up a “user”, which is basically the bank’s routing number along with some other important info, there is an “Expert Settings” section under the OFX tab. In that section are an APPVER and ‘APPID’. I had to set those to ‘1600’ and ‘QWIN’ respectively. Then I was able to get account information and download transaction info. I’ll add that we use Bank of America.

Categories
Computers

Check Your Drive Boot Priorities

I don’t normally reboot my Linux machine. But this morning I was forced to because I installed a hard drive that the Wife’s desktop machine was no longer recognizing properly. It’s a 1.5TB Caviar drive from Western Digital. I installed it many moons ago (at this point) to store some of her home video work. At the time, it worked fine. It was only ever a backup drive so usage was minimal and somewhere along the way, Windows refused to recognize it as anything more than a 500GB drive that was inaccessible because Windows wanted to reformat it. This may or may not be related to the computer’s BIOS, which also only recognizes it as a 500GB drive.

Rather than be so hasty, I figured I’d try it out on my machine to see if the drive itself was bad, or if Windows was bad (my money was secretly on Windows.) So I shutdown my computer, installed the drive, plugged in all the cables and rebooted.

And was summarily dumped into grub rescue mode with a wonderfully cryptic message “Symbol not found: grub_divmod64_full.”

My initial reaction was … unprintable. All I can say is there was no physical violence, though it was touch and go for a couple seconds. Alas, the same cannot be said for my mouth.

On the chance that the newly installed hard drive was at fault, I powered down and disconnected the power and the data cables. Unfortunately, I ended up in the same place after re-powering.

After calming down, I futzed with things for a bit and quickly concluded that the problem was that grub was not attempting to boot the correct drive. I was somewhat flummoxed as to how that happened, but it seemed clear enough. The whole circumstance felt eerily familiar.

I had actually resolved myself to fixing the problem via a USB stick install medium. Towards that end, I rebooted into the BIOS setup to check the boot priorities. The computer was already configured properly in terms of device, so then, on a lark, I checked the hard drive boot priorities.

There is where I found my problem. The hard drive boot priorities had been shuffled and the drive with grub on it was no longer the 1st device. After ordering the drives properly, I rebooted and was happy to see a proper bootloader screen followed by everything loading up without issue. I can only conclude that installing the new drive caused the BIOS to shuffle the drive priorities around thus, breaking my system.

On the plus side, the hard drive works great. I don’t think I’ll be un-installing it any time soon though.

Categories
Computers

HDMI on the 1015PN

Necessity is the mother of invention. In this case, it’s the mother of learning how to make HDMI work on my netbook.

If you’re a fellow traveler eschewing desktops like Gnome or KDE for the relative compactness of a window manager this post might be of interest. I wasn’t really surprised to learn the HDMI port didn’t “just work” on my 1015PN. I was surprised at how straight forward it ended up being. It just took a fair amount of research, and a little luck following links from Google searches. I’ll skip the blow-by-blow and get right to the point describing the setup.

Categories
Computers

A Failed Experiment

We purchased a Roku over the weekend. The motivator was our cable bill. Our service provider is Charter and they are basically our only cable option in this corner of the world.

Charter provides our internet and phone (via VOIP) in addition to the boob tube stuff. We’ve been very happy with the phone and internet, but we just don’t feel like we’re getting any value from our TV service. And, to be clear, we have just what I’d call a basic service where we get TWC, USA, TNT, Discovery and those sorts of channels. No HBO, no Starz, etc. Charter just instituted another rate hike and we finally decided enough.

Enter the Roku.

The original idea was to nix cable TV entirely, rely on an antenna for the “networks” (ABC, CBS, etc.) and use streaming services for any other needs. In particular, we’ve been very pleased with Netflix. The only piece we weren’t sure about was what network shows we might be able to get via streaming services.

The shows we are mainly interested in, like NCIS and Criminal Minds, are not available via streaming. Even from the CBS website, the options are slim. Further, our initial investigations into reception without cable were bleak, to say the least.

The upshot of all this is that the Roku ended up not being much of a problem solver. That’s not to say it doesn’t show some merit and promise. We established an account and got everything without any problems and we were streaming without issue pretty quickly. But working against the Roku was the fact that our Blue Ray player has several builtin streaming applications, including Netflix. So why did we need 2 boxes for basically the same service? Also counting against it is my 1015PN, which has an HDMI output. I could just as easily hook it up to our TV and stream stuff from any website, not just the ones the Roku allows.

So we’ve packed it up and will be returning it in a couple of days. Even so, I think it’s something to keep an eye on. Somewhere down the road, it seems clear that most viewing content will be available via a stream from somewhere. Perhaps we’ll revisit it then.