Monday, April 14, 2014

Installing Programs in Linux

Yep! All Tech this time. Well, almost all Tech. Maybe some Cats and Food later!

Ont of the worrying things about starting using a new OS is how to add programs. In Linux this ends up as being both transparent and easy. The transparent part can be a little frightening at first, but the easy part should get your confidence up!

Installing Programs in Linux  --  Firebird

As you probably know, while I use Windows at work, I use Linux almost exclusively at home. So, to encourage all you users of Windows XP out there who might be wondering about what to move to not that Microsoft has finally given up on supporting you, I've decided to write a few Help articles to show how easy some things can be in Linux.

This little article is an introduction on how one goes about adding programs to a Linux system. You'd think that big programs would be more difficult than small ones, but really the following is the same for almost any program in Linux. The programmers add the program (including a list of everything it needs in order to work) to a Package Repository, and the Package Manager on your computer goes there to find the software you're asking for, download it, and install it. In this example I'm going to install FireBird, a database server, so not a particularly trivial piece of software!

Once upon a time there was a little company in Groton, CT (yes! - where they build the submarines) that created a database engine (the program that handles the data) called InterBase. There's a good article on Wikipedia here that explains the history and gives a good explanation of the way InterBase handles Concurrency (when two users want to change the same piece of data at the same time).
In the 1980s they sold out to Ashton-Tate (of dBase fame) who were bought by Borland in 1991, really for just one reason - InterBase. Borland already had Paradox, a desktop database that was superior to both dBase and Access. Since then InterBase has been both open-sourced and developed (by Embarcadero), and the open-source version is called FireBird. Interbase runs on Solaris systems as well as Windows, is a really nice database with an amazingly small footprint (it'll run from 500 KB on disk! When was the last time you saw anything measured in kilobytes??!).

So let's get to it!

Here I am running Synaptic Package Manager to install the database.

What happens is that I click on the check-box beside the name of the program I want to install. For each selection I have to confirm my choice and the program checks it off, along with any other pieces that it needs but that I don't yet have. At the end I can click on the Apply button at the top of the program window and all will be installed.

At the end of it all I even get a nice reassuring status message:

That's nice, of course, but where's the program? Well, the first item in the second block of green in the first screen-grab is FlameRobin, which is the GUI interface for FireBird, so I can go to the menu system and look for it.I'm using Linux Mint, so the menu system looks like this and if I select Programming from the list of categories I see FlameRobin here. I can click on it to start it.


After starting FlameRobin, telling it where to find the database that FireBird is managing, and giving it all the right names and passwords, here I am!


So, you can see that installing even quite a complicated program into a Linux computer is not that frightening after all. The neat thing about a Linux program is that you get it from a package manager. Your system tells the package manager what release you're running, and the package manager tells your system what other pieces of software it'll need to have in order to run the piece you are asking for.

There are, of course, times when you just can't run a piece of software, usually because your OS version is too old. In that case you are told as much, and you update. Updating is, surprisingly, more like installing a Windows service pack than moving from Windows XP to Vista, for example!

So, let's imagine that you're leaving Windows XP for the wilds of Linux. First, go down to your local Barnes & Noble and get a Linux magazine with a  DVD in it / on it. On that DVD will be a number of "Distributions" of Linux - the basic beast with various bundles of goodies to make it easier to use. Alternatively, go to one of the sites I mention below, download a "live" disc image ("live" means one that you can boot and run, not just install from) of the product.

Put that in your DVD drive and boot your machine: you should be able to select to boot from the DVD (if not there'll be a setting in your PC's BIOS to let you) and you'll get a menu offering you a list of the various distributions on the DVD. Select one and your computer will boot into that distribution - it may be Ubuntu, or Mint, or even Zorin (which can be made into a very XP-looking system indeed). The system will be somewhat slow, as you can imagine, as it'll be reading from the DVD every time it wants to do anything, but you'll be able to see two important things:

  • Does it work with your hardware? Does it work with your wi-fi, with your printer and scanner, and other things you may have attached.
  • Do you like the way it looks?
  • Now you can add the programs that will do what you want to get done, leaving Windows behind!
TTFN

Monday, April 07, 2014

Virtual Windows

Yep! Another All-Tech this time.

The subject of this blog is taking Windows XP virtual. The idea is to stop using Windows XP, for reasons that I explained in my "XP is an Orphan - What Next" post. However, some of us can't just stop  using Windows XP. The system has been out there for 12+ years, and there's good software made for it that, because the publishers went out of business or were bought up, just isn't going to get upgraded to work with Windows 7. There's lots of software that small businesses use that would cost the proverbial arm-and-a-leg to replace in Windows 7, and there's also lots of hardware that isn't getting driver software written for it for new operating systems. Now I'll not say that any system is perfect in this regard - Linux in particular has problems with Canon gear, as Canon have historically been reluctant to offer Linux drivers. There are ways around this, but they're geeky and complicated.

So one more possible drawback to moving to any new operating system is that you lose the use of some vital parts of your hardware, and that it'll then cost you a fortune to upgrade that too! Therefore, if you need use of some specific piece of hardware, ensure first that the new operating system - be it Linux, Windows, or Apple - can happily talk to your hardware.

Theory
What this means is to use a program that runs on your operating system of choice and which pretends to be the hardware of a computer!

Looking at the diagram above, the main box is what your current operating system sees as its "world". The green bit is the free space it has to put programs in - there's one in there already, called "Program" (sorry! - imagination is running short today!) and, within this Host OS, there are some extra bits, called "Driver Software".
There's one bit for your monitor, one for your printer, one for your wi-fi, and even some for things like keyboards, mice, and hard drives. Some come in the BIOS, so you can start your machine, and some are added later when you buy new things, like printers, scanners, and wi-fi.

So you can see that the operating system that all your programs talk to in order to get to do things like print, or show things on the screen, or accept keystrokes from the keyboard doesn't really talk directly to these pieces of hardware either! It talks to very specialised little bits of software that, in turn, talk to the hardware.

Because of this, one can write a program that pretends to be a computer, and load it up with an operating system (called the Guest OS). So long as the program can accept instructions to do things with all the hardware that an operating system expects to talk to and give back the right answers then the operating system won't know any better!

Practice
There are two parts to the practice - one is to get your Guest System and the other is to get it to run inside your Virtual Machine program that you run on your Host system.

Getting your VM
You can use the VirtualMachine program to create a Virtual Disc for you (essentially just a large file), or you can get a pre-built one.
If you build your own (a matter of a few mouse-clicks actually - nothing difficult!) then you'll need to bring your own operating system (Windows, MacOS, or Linux) to run in it, as all you'll have is what you get when you buy a ne hard drive and pop it into your PC - a PC that's willing to boot but doesn't have anything to boot from!
Alternatively you can go pre-built. You can download pre-built discs from a variety of sites, including here and also at Oracle's Developer Network site. If you're coming from a Windows environment you can download a Microsoft program called disk2vhd, available free from several places, including Microsoft! You can use this program to create a copy of your Windows system disk (or any other disk, for that matter) that can be booted from by your Virtual Machine.

Installing your VM
This is a pretty easy task - you just have to attach the disk image and go!

I'm going to show you here using Oracle's Virtual Box running on Linux. Virtual Box works pretty much the same on all three major platforms, so using it means that you have minimal trouble if you move from Linux to, say, Apple as your Host system.

Here's what I have to start with (right) - you'll see at the bottom a Nautilus (a File Manager) window open on the folder holding the disk image I want to mount as my C: drive in my new Virtual Machine (VM for short). It's called SQLServer 2012.vdi, as it's hosting a copy of SQL Server 2012!

First, I have to create a new machine (Machine | New from the menu) - see left - and then walk through the chain of prompting dialogs, answering a series of simple questions.
This one asks me for a name for the machine and the operating system I'm going to run inside it.


Next I have to tell VirtualBox how much RAM I'm going to give the VM for its RAM. To do this I can type in the amount (being a geek I know all the appropriate powers of two, but if you don't then just slide the bar slider. You can't go too far - see the brown area at the right to show where my physical memory tops out! I'm giving this machine 8 GB of RAM to play in.




Step three is to add your hard drive. In my case I already have one made, so I selected the third option and found my file. If you don't already have a disk file ready to go you can select the second option and create one, here-and-now.



On the left you can see the list of machines that I can launch after I added my new SQL Server 2012 machine, which has an entry at the bottom, highlit in green.


Before I start I need to make one major addition - connect the Operating System inside the VM to the Host machine. I can do this by sharing a piece of my Host's hard drive, in this case a folder called Public. It will appear inside a Windows machine as a mapped drive.

Fairly soon you'll be able to log in to Windows. As you can see on the right the Windows running inside the VM looks totally normal (yes, I keep my task bar up the right-hand side of the screen!).

If you look closely at the bottom-right of the screen-shot to the right you'll see some icons on the status bar. Here they are, enlarged (below).



These tell you what's going on in your machine - the fourth along, for example shows network activity (i.e. internet traffic). The legend "Right Ctrl" indicates that your Guest and Host machines are sharing the mouse: if it gets caught by the Guest machine then the right control key will release it back to the Host machine








to be extended very soon!


XP is an Orphan - What Next?

Windows XP was released to manufacturing on August 25, 2001. It replaced Windows 2000 (right) in the line of "new technology" products (that had started with Windows NT 3.5), and Windows ME in the line of consumer products stemming from Windows 95.

Windows XP was Microsoft's effort to bring the undoubted benefits of the NT operating system to the customers who were using a Windows shell sitting on a DOS base, very similar in many ways to the way in which Windows 3 had been a program running on DOS 6.

Finally, twelve years and seven months later, after three separate offerings of replacement operating systems, Microsoft is calling it a day and saying "enough!" for Windows XP.

But "why?", you may ask. "It works very well! Why change what isn't broken?".

Well, aside from Microsoft needing to earn money to pay its programming staff (sorry for the burst of cynicism there!), it has become apparent over these last twelve years that things could have been done better in Windows XP. Believe it or not, Vista (January 2007) really was a better OS, despite being vilified like few other products in history! Vista's problem was really that it needed more powerful machines than were running Windows XP machines at the time, so people had a bad experience and returned to XP.

Aside from that, here's the reply I recently made to someone who asked why they should move on from Windows XP:

All non-trivial systems have flaws. Mostly the systems operate fine and the flaws go unnoticed. An example is a steam engine with a pressure guage linked to a pressure-release valve. While you have a careful operator the pressure never rises too high, so a blocked valve is no issue. However, if a new, inexperienced operator is introduced then the pressure may rise, not be relieved by the valve, rise further, and lead to a violent release of pressure in unplanned ways (aka an explosion!). 

Likewise, operating systems all have flaws - some do a better job of hiding them than others. Windows has far more users than the other operating systems, so more opportunities for careless or malicious users. 

With Windows, Windows XP is simply one member of an ongoing family of products, starting with Windows NT 3.51 and currently offered in Windows 8.1. The large majority of the code in one version (Windows XP, for instance) is also present in the next (Windows Vista). This means that if a problem is found in Vista (or 7, or 8, or 8.1) then the chances are high that it was also present in Windows XP (and 2000, and probably NT 4, and possibly NT 3.51). 

With millions of Windows XP users still out there as targets, any problems that Microsoft fixes with Vista, 7, 8, etc. will immediately become pointers that malware writers will use to locate the same problems (if they exist) in Windows XP. If the part of, say Windows 7, with a problem is new since XP then an XP user is ok. If on the other hand, the code was there in Windows XP too then the malware writer has just been told (by Microsoft!) what the flaw is, where it is, and how to exploit it! 

That is the problem with staying with Windows XP. 

My suggestions: 
    If you want to stay with Windows then go to Windows 7 
    Else move to Linux Mint. 

If you really need to stay on Windows XP, try to move to Mint and run your XP in a virtual machine that doesn't access the internet. You can easily achieve this using Oracle's VirtualBox by turning off internet access in VirtualBox (so that XP has no way of turning it back on!) and by allowing the contained XP system access to a small part of one of the host system's disc drives. 

Now lets look at what's on offer as systems to move to.

Windows 7
Windows 7 was released in July 2009 and, aside from doing away with some features that geeks like me use but which the general user-base of Windows XP does not, is definitely an improvement over Vista and a huge improvement over Windows XP.

To the right you see an example of how you can hover over a task bar icon and see live thumbnails of the instances of the program that are running, so you can select between them.
Above is the Windows 7 taskbar, with the rather nice feature of being able to pin often-used tasks to it for easy re-use. It's always been possible to get into the menu system and reorganise it, but this feature alone takes away much of the need for messing with the menus.

Windows 7, for my money, is definitely a far better system than Vista and, if you're going to move from Windows XP but stay with Microsoft, is the place to go to. Extended support for Windows 7 is expected to end in 2020, so you should be ok for a while there!

Windows 8
Then there's Windows 8. Good for phones and tablets. Somewhat of a pain for desktops.

Apple
You could move to an Apple operating system, but you would have to jettison your computer and search out all new programs for everything you do.

Linux
Linux is a kind of a half-way house between staying with Windows, moving to 7 from XP and departing the Windows fold completely and buying a Mac and all new programs. Yes, it's a very different operating system, but it has lots of features that make it an easy move from Windows XP. You don't jettison your computer but you do look for new programs (well, a lot of them).

One thing you should realise when you start looking at Linux is that while it's very different under the hood, there's so much variety that it can be made to behave in a way that's comfortable for you. Rather like moving from a petrol-fueled car - you can go to diesel (Audi, Mercedes, VW, for example), or electric (Nissan, Tesla), or hybrid (Toyota, Ford, Nissan, ...) - so you can almost certainly find a car that'll suit you! Similarly to there being lots of car makers, there are lots of different Linux Distributions ("Distros"). Most can be personalised to a great extent.

Let's take a look at an average user; here are some problems that people think that they have:
  1. Hardware. If you're using an older XP system or a net-book (here or here) then Windows 7 or Windows 8 may simply be too demanding for your computer. There are several varieties of Linux, OTOH, that are specifically designed for smaller, older machines. For an example, look at Puppy Linux.
  2. My machine is quite old, but I really like the Windows XP interface. Try looking at Zorin (which is a Linux that can be made into a very XP-looking system indeed)
  3. My machine is new, but I really need Windows XP for some programs that aren't being upgraded. Here you could go to Windows 7 Professional, which has an XP Emulation package, or, if you have a nice powerful machine, like the one I'm writing this on, you can get a free program from Oracle called VirtualBox and run a copy of Windows XP, along with your programs, inside it. I'd really recommend that you try to get a replacement for your program, though, as replacing old software tends to get more expensive the longer you leave it!
  4. I really need iTunes. Well, that one really is a showstopper for Linux - there isn't a version of iTunes for Linux. Don't forget, though, that you can download directly to your device from iTunes online.
  5. I'm always on the web. There are lots of browsers for Linux - Firefox, Chrome, and Konqueror are just three that spring to mind. Personally I use Chrome on Windows, Linux, and ChromeBook systems and they're all constantly synched.
  6. How do I know if I'll like it? With Windows you look over someone else's shoulder. With Linux there aren't so many users, so you can get what's called a "Live Image" - either on a DVD from a magazine or by burning one downloaded from a Linux distro site. Then you can boot your PC from the CD or DVD and get a Linux instead of Windows. It'll be slow, because it'll be forever reading the disc, but you'll be able to see if it works on your machine and if you like it. 
  7. I have software that runs on Windows XP that I must have, but that doesn't run on Windows 7 or Apple or Linux!!  This seems like a real problem, but it can easily be surmounted, as I mentioned in the answer I gave elsewhere (in the box above) by moving from Windows XP but not moving from Windows XP! :
  • move your system to any of the three major options (Windows 7, Apple, or Linux), 
  • install a virtual machine on your new OS (VMWare, Parallels, or VirtualBOX, respectively, are all good choices), 
  • create a new Virtual Machine, 
  • install your Windows XP system into your Virtual Machine, 
  • disable the internet 
  • enable a shared drive between Windows XP and your host system, 
  • install your programs, 
  • go on with your life.
Next time: Creating a new Virtual Machine (for Windows XP, in Linux).

Resources
For those still cautious about the idea of moving from Windows, you can read about my first essays into living in the land of Linux here.
For programs in Mint to replace your Windows program, try looking here.
Ziff-Davis have prepared what amounts to a super-sized version of this blog post here.
TTFN

Wednesday, April 02, 2014

Soup !

This post is all about soup!

As almost everyone who lives in America will know, this last winter has been really bad, especially in the north and north-east of the country. Every week from before Christmas until late March brought one or more snow- or ice storms. Even just last week Maine got almost a foot of snow!

So, it's been weather for soup.

Potato Leek Soup
So far as we're concerned, there is no better that Alton Brown's Potato Leek Soup.This soup uses equal weights of leeks and potatoes, mixing them with cream, buttermilk, and white pepper, to make an ivory-coloured creamy-smooth soup.

We've also found that the cream-buttermilk mix doesn't affect my wife much, whereas she is very lactose-intolerant with milk - we drink soy milk with our cereal in the mornings!

I've used onions in place of the leeks (weight-for-weight) and found that the onions certainly don't overwhelm the mix, so Potato Onion Soup is a  good replacement at times when leeks aren't available.

Snert
Officially this is "day-old split-pea soup"; the name and recipe come from The Netherlands and this holds the award as "The Acceptable Face of Peas" for my son, who seriously hates peas!

Ingredients

  • 1 lb bag of dry split peas.
  • A chicken boullion cube.
  • A medium-sized leek, chopped and then well washed (no sand please!).
  • Two medium onions, chopped.
  • A large pork chop or a pig hock or two.
  • Two large smoked pork sausages (e.g. Kielbasa). Don't slice up!.
  • Five rashers of thick-cut smoked bacon. Don't chop up!.
  • Four sticks of celery, chopped.
  • A handful of small carrots, chopped.
  • A large potato, peeled and chopped.
  • Two quarts of chicken broth.
  • For a garnish when serving, the young fresh inner leaves of the celery, chopped, or else chopped parsley.
Method

  1. Put the peas, the bouillon cube, the pork chop, and the broth into a large pot, put the lid on, and bring to the boil. Turn down the heat and simmer for about tree-quarters of an hour to soften the peas (they'll probably look like a sludge by the end - that's good!). Stir the mix every few minutes to prevent the mix from "catching" (sticking to the bottom of the pot and burning).
  2. Take out the chop. If you have used a chop with a bone, cut off all the meat and discard the bone (Don't give cooked bones to animals: the bones can easily splinter and cause serious damage!).
  3. Add all the vegetables and the bacon. Cook for another 30 minutes, stirring at least every five minutes. If it looks like getting too thick then add some water periodically. 
  4. For the last 15 minutes add the sausage.
  5. Slice the cooked meat from the pork chop into thin pieces of a size convenient to eat.
  6. When the vegetables are tender use tongs to pull out the sausage and bacon. Slice the bacon small and the sausage into rings.
  7. Add all the meat back to the soup, saving a little sausage to use as garnish.









8.  Serve in bowls garnished with a few rings of the sausage and some chopped celery leaves.


General verdict: Lekker!!!







Sweet Corn Chowder

Ingredients

  • 2.5 lb peeled-weight potatoes
  • 1 cup frozen sweet corn
  • 2 teaspoons chopped garlic
  • 1 quart chicken broth (I use low-sodium)
  • Half pound of grated cheddar (preferably sharp)
  • A third of a cup of flour
  • 1 cup of buttermilk
  • A pinch of salt
  • Half a teaspoon of ground black pepper


Method

  1. Peel and chop the potatoes into about half-inch cubes
  2. Put them into a large pot and just cover with water.
  3. Bring to the boil and then simmer until soft - about 15 minutes
  4. Drain water from potatoes and return them to the pot.
  5. Remove 1 cup of the potatoes, mash them well, and return them to the pot.
  6. Add the chicken broth, salt and pepper, and garlic, and bring to a boil.
  7. Add the flour to the buttermilk and mix well.
  8. Reduce the potato mix to a simmer.
  9. Gently add the buttermilk/flour mixture, stirring well.
  10. Add the cheese, in small amounts, stirring well all the while to mix in one batch of cheese before adding the next.
  11. Add the sweet corn and stir in. 


General verdict: Surprisingly good. The buttermilk gives it a faint tang which contrasts well with the sweet of the corn.

All these soups taste as well if not better the next day, and can be frozen for later.

Eat well and keep warm!

TTFN

Found Food

I have published quite a few recipes here on my blog over the last few years, and I hope that all my readers have tried at least some of the...