Recently in Technology Category

HP Photosmart C4585 and Linux

| 1 Comment | No TrackBacks
I hope I don't end up hating myself for this, but I have bought a new HP printer. I think it's been just over four years now since I actually had a printer at home. But, I figured I could use a decent scanner/copier/printer at the casa. Now, the primary objective was as always best value for money followed by functionality, since my requirements are very little for the printing world.

I must admit, I didn't do much preliminary investigation; because, I thought I could handle this quite well on my own based on experience. I mean, it just needs to be cheap and have good support for the Mac and at least I should be able to print from Linux as well. Everyone knows the primary cash cow for 'inkjet' type printers are the cartridges, anyway. Also, I wanted to avoid HP, because HP customer service is quite daunting. Just like BT, there is no face to HP really.

Well, enter Curry's. The Curry's on Ealing Broadway is just across from an Argos; so, I thought this would be a decent place to start in the retail world. Curry's didn't have the widest selection, albeit decent though. They carried Epson, Canon, Kodak and HP printers and all-in-one scanner/copier/printers. The particular one that caught my eye was the Canon Pixma MP 580. This model does not include WiFi or duplexing but does have a higher resolution and bluetooth. For the price of £88, it's not too bad.

They did not have the MP 620, however. That particular model includes WiFi and auto duplexing. But, Argos did for £146. I wasn't ready to spend that kind of money on a printer though; so, I turned back to Curry's and had a look at the HP C4585 which does have WiFi. Both the Canon and HP support Mac, and I figured the Linux drivers would be available for printing at least because of Cups. So, I went ahead and took the £68 on-sale HP. I went across to Argos and got a much better deal on the ink and headed home.

Installation on Mac was a snap, and I won't cover that here. Instead, after I had the printer setup , I wanted to at least be able to print from Linux, and using gnome's printer configuration made that a snap. It auto-discovered the printer on the network and default selected HPLIP driver. However, I was curious about the scanner and status functionality. So, I google'd HPLIP and came across this which indicates there is a GUI that does support scanning and status, e.g. ink levels.

I searched the Jaunty package cache 'apt-cache search hplip' and found the appropriate package and then installed it 'sudo apt-get install hplip-gui' which installed an HPLIP Fax utility under Applications > Office and an HPLIP Toolbox under System > Preferences. For the record, I have not tried the Fax utility, but the HPLIP Toolbox works very good for scanning and checking status such as ink levels. The options to align print heads, calibrate, and clean the heads are also available. So, it looks like I actually got more than I bargained for on this purchase.

Conficker and Submarines

| No Comments | No TrackBacks
From Wikipedia:

"The UK MoD reported that some of its major systems and desktops were infected. The worm has spread across administrative offices, NavyStar/N* desktops aboard various Royal Navy warships and Royal Navy submarines..."
I have to ask myself, WHY?!?!?!?!?!

Imagine you are a weapons operator on board one of her majesties finest submarines, the alarm comes over the general announcement circuit followed by "man battle stations torpedo", and at launch time there is a problem because the launch console cannot resolve the DNS query for the weapons launch console -- all because of Conficker!

This may sound like an unrealistic scenario, but I'm not so sure that it is. As a matter of fact, I think it's a very realistic scenario. Why, because you cannot stop oblivious people from clicking on things in MSN like, "Hey dude, how's tricks? Check out these pills! They helped me get lucky this weekend, ROFL LULZ!!!1!!!11!!11. Click here to check them out."

You cannot stop the same oblivious people from saving something on a USB stick from the same now infected computer and bringing that down to the boat no matter how hard you try. Why? Because these guys are gonna bring down pics of their naked girlfriends (or boyfriends) and letters from mum and anything else whathaveya.

In turn, you cannot stop the same people from finding SOME WAY to get those files on to the network. Yes, it may be a long shot that it ends up on the same VLAN or air-gapped network for weapons systems, but it only takes one nub to do it and then someone is gonna look stupid -- as if they don't already.

This follows the disturbing news from last year of the Royal Navy to up and use M$ Windows Battle Star Galactica Edition on warships (including submarines). I don't know what committee of half baked morons decided to approve something like this, but obviously there is a whole chain of people that were sleeping while this decision was made, or their input was simply ignored. Most likely it was the former.

Submarines require the utmost in quality. Some things, like people's lives and national security, require more attention than other things. I wouldn't step foot on any submarine that relies on code probably written by a bunch of .NET software developers that have not the first clue how an operating system assigns memory or how those processes are scheduled -- not to mention a base operating system from a company with wreckless security and quality nighmare of a record.

"Emergency blow!"

"Shit Captain, the BCP just blue screened!"

Godspeed to you sailors. 

 

Best UK Broadband

| No Comments | No TrackBacks
Choosing a broadband company is not a choice to be taken lightly. Consider that for the next several years, you will most likely not change it. Why? Simple, it's cheap, unobtrusive and something you come to take for granite. However, your choice of Internet service provider is one of the most important choices you have in utilities. When it comes to gas, electric, water, etc., you have very little choice. But, there are a plethora of options when it comes to the Internet.

Every day you surf the web, talk to friends and family, purchase things you want, pay bills and send emails perhaps for business or intimate personal details. But, interestingly enough, is your privacy being kept? Does your service provider care enough about you, the customer, to balk at intrusive governments (the UK ranking at the top) or the fortune seekers looking to profit off your every day life?

Unbeknown to most users, the amount of personal information the average person generates online is of considerable value to governments and revenue seekers. For something that costs so little, the social impacts are the most of any other comparable choice, and this is perhaps even more true than any other generation that has lived before. I only say this because in the UK, the largest service providers are turning to a company that has its roots in the lowest of the low human fortune-seeking dwellers.

This is only compounded by the fact the UK has brought forth and passed legislation that enforce various social networking sites and other Internet service providers to keep your personal data for some specific amount of time. Right now that happens to be 12 months. But, where does it end? For providers like BT and Virgin Media (the UKs largest providers by far), they have decided to partner with a company known as Phorm.

Phorm has its roots in the bottom feeding world of spyware. It was formerly known as 121media, but has tried to transform itself into a legitimate company, promising millions in ad-generating revenue to ISPs worldwide. If you are a subscriber to Virgin Media, Talk Talk or BT Internet, I have one phrase for you -- switch now!

These companies are actively using Phorm technology to eavsdrop on your every day web traffic and make that information available to targeted web advertisers among other things. They attempt to gloss over these privacy-invasive acts by saying it protects you from phishing and other malicious activity on the Internet. But, this is very laughable coming from a company that invented itself on activities considered outright shocking at best. A case was even brought forth to the US FTC against 121media.

I'll save the details and let you do some reading:

http://en.wikipedia.org/wiki/Phorm

The excuse "I have nothing to hide" is frivolous and lazy at best. While it is very easy for one to use this excuse, it is a violation of your responsibility as an honest citizen of this planet to condemn and protest activities of major organizations that infringe on basic human rights. The UK government is already well underway -- indeed a primary backer of EU initiatives in this realm -- to take away your privacy and force ISPs to log all data, including emails.

Just one other thing to put this in persepective -- the Russian Federation -- one of the more "European" countries to take a giant eye roll on human rights, hasn't even gone so far as to enforce legislation of this type. And, ISPs do not engage in this behaviour, either.

The last point I have to make is with customer service. As an American, I expect the utmost in customer service. When I have a £ to spend, someone better deserve it. Someone (or company) better make me feel special. They need to make me feel like they deserve my £. I can say that most large providers I have come into contact with -- the largest offender being BT -- that they don't give one single shit about your business.

In fact, companies like BT are in a situation where they simply don't have to care about you. Case in point, in a city like London, I made an appointment for a house move two weeks in advance. On the day of the appointment, I called and asked where they were. The lady told me they had knocked on the door and no one answered. Now, I know that was complete bullshit, but they refused to do anything about it. But, what can you do? BT Opengroup owns it all. Monopoly lock, stock and two smoking barrels -- but I digress.

After I finally got my BT line in place, I called BE Unlimited, my ISP, to do the house move. They told me it would be done in five business days (because of BT Opengroup union laziness). On the fourth business day, they emailed me to let me know the local exchange work had been done -- quite the surprise, actually, when dealing with BT extended lunch engineers. But, when I got home, alas there was no Internet. I called Be, and they told me it would actually be done the next business day.

But, since I had a DSL light on my router, I knew they could do better. So, I "challenged" them to get my DSL working. After two minutes, the engineer came back on the line and told me to go ahead and switch to dynamic IP and it would work for now. Voila, excellent customer service. That's what I call bending over backward to make me feel special.

But, to my first point, Be has made it clear that they have no intentions of working with companies like Phorm. As a matter of fact, when I have asked them about it, instead of getting the usual "I don't know", I get a very affirmative, "we have no plans to work with companies like Phorm or any kind of targeted advertising."

That's very reassuring. Personally, I think Be takes their broadband seriously. I have had the best in customer service, and I always get someone that knows what they are talking about. It simply works, but they give in to the more technically advanced of us out there. I know this sounds like a paid advert for Be, but to be honest with you, I'm just a user that takes my customer service and privacy seriously.

One last note, Be told me that what I should have done in retrospect is call and ask for a SIM code when I did the BT line move. In turn, you would then call and provide them this information, and you wouldn't have to wait an extra week for your broadband. Class.  


Editing Oracle's spfile with vi

| No Comments | No TrackBacks
The fact I would even post this suggests that I am not an Oracle DBA. Shamefully, I attended the Oracle Administrator I course a couple years ago but am no better off because I just can't find the time. Anyway, I find myself having to fiddle with Oracle on and off beyond the basic startup, shutdown and writing scripts to replace my DBA. Yes, I must admit, I don't micromanage, I just automate it >:-}

I wrote some scripts some time ago to do various things such as setting Oracle's db_file_name_convert and log_file_name_convert in a larger project that used Oracle's RMAN to automatically duplicate databases. Some time later, we added another database to the cluster. This exploited a "bug" in the code (mine, yes) which set the first parameter to db_file_name_convert empty. So, the bad entry in the spfile looked like 'db_file_name_convert = '', '/path/to/db'. Just to save some time, I will recreate what happened:

SQL> alter system set db_file_name_convert = '', '/opt/ora-three/DEVEL3' scope=spfile sid='*';

System altered.

SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00117: syntax error at ',' at the start of input
SQL> 

For some of us, you're in trouble. Why? Because looking up those error codes reveals very little information. After digging around for a while on Google, there were hints to something foul in the spfile. I opened up the spfile and noticed that erroneous line db_file_name_convert.

From previous experience, you cannot edit the spfile with a tool like vim because it is a binary file and vim somehow fouls this. I thought I'd be clever and do it with sed. But, alas, this did not work, either.

ORA-27046: file size is not a multiple of logical block size
Additional information: 1

The easiest way to fix this is simply use good ol' strings to make a pfile from the spfile and recreate the spfile. Apparently, besides the binary padding, the spfile is the same as the pfile. Maybe some Oracle DBAs will have something to say about this:

$ strings spfileDEVEL3.ora > pfile.ora

Now, edit this file with your favorite text editor and fix the erroneous line because a pfile is a plain ol' text file. After that, recreate the spfile from this pfile and start Oracle.

SQL> create spfile from pfile='/opt/ora-three/pfile.ora';

File created.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  788529152 bytes
Fixed Size		    2076008 bytes
Variable Size		  230687384 bytes
Database Buffers	  549453824 bytes
Redo Buffers		    6311936 bytes
SQL> 

My new iMac

| No Comments | No TrackBacks
Well folks, after six long years of pulling out my credit card only to have that little something inside me pull away, I finally did it -- yes I got an Apple computer. And, what do I think about it? Well, I can't believe I didn't do it six years ago!

I decided on the 20" iMac. It took a whole 30 minutes and I was drowning in the abyss of elegant computing. The UI is absolutely fantastic, applications just work, bluetooth just works, and it's really so simple anyone can make their way around within a short amount of time. Now, one of the niftiest features is Ctrl-Cmd-D while hovering over a word in a Cocoa application -- instant dictionary. Or, how about Cmd-Shift-D, insant search for your files, applications or whatever else you need to find.

I installed VirtualBox and immediately put Linux Mint in a VM, and Cmd-F, voila, now I'm full screen in Linux Mint! Anyway, these are just a couple of the cool features I've tripped across. I opened up a terminal to pleasantly find the BSD userland around me. All the familiarity was there -- Perl, Python, Bash, and on and on.

I look forward to discovering all the little niceties Apple has put into OSX and continue using all the open source tools I have been using over the last 12 years. One thing of interest is PyCocoa application development. Apparently, XCode supports this right out of the box.

What else should I be looking for...

Dynamic Bash Variable Names

| 1 Comment | No TrackBacks

I found myself in the middle of a rather large Bash project a little while back. Basically, I had defined several file paths in variable names and needed to access that information dynamically.

The scenario is this: a value would be supplied by the user, and I had to pull out some hard-wired information based on this value. So, suppose you were writting a script that referenced file types arranged by extenstions and was selected by the user at run time. This would be easily solvable in the following:

#!/usr/bin/env bash

# List of variables maybe in some other file
JPG_FILE_PATH="/opt/path/one"
DOC_FILE_PATH="/opt/path/two"
MP3_FILE_PATH="/opt/path/three"
XLS_FILE_PATH="/opt/path/four"

get_file_path() {
    local ID=${1-''}
    # Sets FILE_PATH to the desired value. If not exist then null.
    FILE_PATH=$(eval "echo \${$(echo ${ID}_FILE_PATH)"-''})
}

get_file_path "MP3" 
echo $FILE_PATH

$ ./test_pre.sh
/opt/path/three

The above snippet -- admittedly a bit humorous -- is very useful in several situations. I happened to use it in creating a shell library of functions and paths that are used by others in the easy creation of scripts around Oracle RDBMS.

Red Hat Certified Engineer

| No Comments | No TrackBacks
I took some time to sit in the RH300 this week. Basically, it is a five day course with exam for those with previous RHCE certifications or others with significant experience with RHEL. Its ultimate goal is preparing students for the RHCE exam on the fifth day of the course.

My experience -- and other's mileage will vary depending on the instructor -- was quite good. This was not the typical slideshow-break-slideshow-lunch with boring labs layout many of us have been exposed to from other vendors. It was quite intense with enough lecture, demonstration and labs to last two weeks -- packed into four days.

We were engaged from 0900 to 1730 every day with short lunches. Looking at the RHCE prep guide it is easily understandable as there is a tremendous amount of information to cover in such a short period of time. The instructor in my case was knowledgeable and provided thorough examples all throughout the course.

The labs are well planned, and the infrastructure Red Hat has designed for the classroom labs just works. The only problem we had was the first day when we discovered the workstations we were using had a broken ACPI implementation. For some reason we performed this course in a different venue than originally planned, so that was the only minor setback.

Unfortunately, I am unable to share the exam experience, but I will say that it is one of the more challenging things I have done in such a short period of time, and I am glad that I did it. Generally, I frown upon industry certifications and courses as I'm a firm believer that vendors should provide ample documentation and you can go it alone. I have relied on this most of my career. After all, most certifications are purely marketing and money gimmicks. But, Red Hat definitely shows that some training is worth the money and their certifications are notable.

So, I'm an RHCE now. And, I definitely enjoyed those beers Friday night!

Sensible Link Management in Movable Type

| 4 Comments | No TrackBacks
Please note the following has only been tested on version four of the software!

After I had installed my Movable Type blog software, I was quickly coming up to speed on some basics necessary to publish an aesthetically-pleasing and comfortably-navigated blog. However, I quickly noticed a feature that is not readily available: customizeable link management.

One must pose the question why this feature is not part of the standard build. But, thanks to the guys and gals in #movabletype on freenode, I was pointed to a plugin called LinkRoller. The author of the software, "arvind", pushed me in the right direction, and thanks to the modular design of Movable Type, I was up and running quickly.

If you want the ability to customize your links within your blog, this is what you need. First, download the software and follow the installation instructions. Installation for me was a breeze, and I encountered no issues. The brief video on the installer page will quickly demonstrate how to create links. At this point, you should go ahead and create a link such as this one following the video provided on the download page. Use a sensible tag and description fields. This will be demonstrated shortly.

Now you must somehow display your links on your blog. To do this, you need to create a widget and then choose where to display it. Navigate to Design > Widgets in the control panel.  Select "Create widget template" from "Widget Templates" and enter "LinkRoller" in the top form field. Next, choose one of the following examples:

If you simply want all of your links displayed in one menu (not sorted), copy and paste the following code in code form field:

<div class="widget-linkroll widget">
    <h3 class="widget-header">Interesting Links</h3>
    <div class="widget-content">
    <MTLinks>
    <MTLinksHeader>
    <ul>
        </MTLinksHeader>
            <li><a href="<$MTLinkURL$>"><$MTLinkName$>: <$MTLinkDescription$></a></li>
        <MTLinksFooter>
    </ul>
    </MTLinksFooter>
    </MTLinks>
    </div>
    
</div>

This is good, but not necessarily satisfying or flexible enough for some. Naturally, I, along with others, wanted a mechanism to classify the link entries in accordance with tags. Thanks to one clever poster this can be done as follows:

<div class="widget-linkroll widget">
<h3 class="widget-header">Interesting Links</h3>
  <div class="widget-content">
    <mt:Tags type="asset" sort_by="name">
      <ul class="widget-list">
      <li><h4><mt:TagName></h4></li>
      </ul>
      <MTSetVarBlock name="linktag"><mt:TagName /></MTSetVarBlock>
      <ul class="widget-list">
        <mt:Assets type="link" tag="$linktag">
          <li><a href="<mt:AssetURL>"><mt:AssetLabel escape="html">: <mt:AssetDescription></a></li>
        </mt:Assets>
      </ul>
    </mt:Tags>
  </div>
</div>

After choosing one of the two options -- or rolling your own -- click save and return back to the widgets page. Before publishing your blog so you can see your links, the final step is to place the widget in your selected widget set. Under "Widget Sets", select your layout and drag your newly created widget from "Available Widget" to "Installed Widgets". Once you have pressed "Save Changes" and the system finishes the update, you can now publish your blog.

link_roller_widget.gif
Happy linking!

Master Boot Record Oops

| No Comments | No TrackBacks

One of my colleagues has a laptop that dual boots with Windows XP (R) and Ubuntu (Hardy Heron). He received a new laptop and wanted to move the partitions from the old hard drive to the new laptop's hard drive.

The data migration went well, and the laptop would boot straight into Windows, so we needed to install grub back to the master boot record (MBR). Naturally, we booted off the Hardy CD, and I figured we'd just reinstall Grub to the MBR straight from the Grub menu.

Now, this is quite straightforward. You simply boot from a livecd, mount the root and/or boot partition(s), chroot and drop to the grub shell. Finally, do something like:

grub> root (hd0,0)
root (hd0,0)

or

grub> find /boot/grub/stage1
find /boot/grub/stage1
 (hd0,0)
grub> setup (hd0)

However, we received:

grub> find /boot/grub/stage1
Error 15: File not found

Well, that's not good! I considered trying

# dd if=/boot/grub/stage1 of=/dev/sda count=1

but didn't have the courage to do it and looking back on it now it wouldn't have worked anyway. So instead I ignorantly copied the MBR from the other disk as it was supposed to be a clone and applied it to the new disk using dd of course.

The outcome WAS NOT PRETTY! Grub could not find any partition. In short, the file allocation tables were all wrong. Not to worry, we just loaded up Winternals ERD and ran a lengthy scan on the disk. I figured the $2345245 software would surely bail us out of this mess. Wrong!

The solution was this gem of an open source beauty. I loaded this on a USB stick, booted off the Heron livecd, and ran the binary it ships with. Within minutes it found the correct partitions and we were able to restore the MBR with the correct file allocation tables.

However, we were just back to square one and needed to install Grub to the MBR. We figured out that what done us over in the first place was the fact the Ubuntu partition was not the active partition. Easily fixable:

# fdisk /dev/sda 
... 
Command (m for help): a 
Partition number(1-5): 2 
... 

At this point we were able to boot back into the livecd and run grub correctly. Lesson learned -- just because you've done something numerous times that should be straightforward -- backup!

About this Archive

This page is an archive of recent entries in the Technology category.

Random is the previous category.

Find recent content on the main index or look in the archives to find all content.

Pages