Stephen Smith's Blog

Musings on Machine Learning…

Posts Tagged ‘linux

Refurbishing an Old Laptop

with one comment

Introduction

My wife typically used an HP laptop running Windows 10. This laptop is probably about three years old now. Unfortunately she dropped it off the bed onto a cement floor (she claims one of the dogs pushed it off the bed, but I’m suspicious). She actually broke its fall with her foot which is very bruised now, and then it hit the floor after her foot. The laptop then stopped working. She took the laptop to a coffee shop and spilled coffee on it. This didn’t help. She then gave it to me to see if I could get it working. I took it apart to see if it was just a matter of some wires coming loose. Sadly this wasn’t the case. This blog article recounts my attempts to disassemble and repair the laptop, which I successfully accomplished. I’m writing this article on said laptop, while my wife now uses my MacBook Air.

Diagnosing the Problem

On bootup the laptop displayed a text message prompt saying no boot device present. To me this meant that the screen and processor were still working and that the likely problem was the hard drive. After all the harddrive is mechanical with moving parts and likely to be damaged by a shock such as hitting the floor (or a foot). So my first thought was to take it apart and ensure the cables connecting the harddrive were in place.

Opening the Case

It turns out an HP laptop is held together by a lot of screws and many of the screws are hidden behind plastic plugs, the laptop’s feet and various other sneaky bits of plastic. Plus there is a bead of glue around the case that needed to be broken. My first attempt to remove all the screws didn’t allow me inside. Fortunately for doing DIY repairs, there is YouTube. Doing a quick search revealed lots of videos on opening HP laptops and showed a lot of complaining about how HP makes this unnecessarily complex. Anyway watching one of the videos revealed to me where to look for the additional screws (behind some nondescript covers) and allowed me to get the case open.

I removed the hard drive, made sure all the cables were snug and put it back together. And the same result. So I assumed the harddrive was either physically broken or the boot sectors had somehow been erased. So I thought I may as well try installing Ubuntu Linux and repurpose the laptop as a Linux machine. After all running Windows 10, the laptop has been getting slower and slower, so giving up on Windows 10 seemed like a good idea.

Installing Ubuntu Linux

I downloaded an ISO image of Ubuntu Linux for desktop computers. And then installed this onto a USB key to make a bootable USB with Linux. I did this on a really old AMD Windows 7 laptop. Its slow but it’s always been reliable and since I’ve uninstalled nearly everything from it, it works fairly well. Anyway Ubuntu has really good instructions on how to do this at their website. You just download the ISO image and then use the Rufus utility program to copy it to the USB making it bootable.

I then put it in the damaged laptop and booted it up. At this point I could run Ubuntu Linux from the USB or run the Ubuntu installation program. That both of these worked gave me more confidence that the only problem was the laptop’s hard drive. Anyway I went ahead and tried to install Ubuntu Linux, which goes quite a long way before it finally tries to format the hard drive. This failed. So I concluded the harddrive was physically damaged and useless.

Fortunately I have a couple of other laptop hard drives lying around from even older laptops which I could try. The first one I tried didn’t work, so I guess that one is toast as well. But the second one I tried worked. The Ubuntu installation program was able to format the drive and the installation finished successfully. My impression is that installing Linux is now even easier than installing Windows. It didn’t ask too many questions. The screens were simple and easy to understand.

Now I had the laptop restored. Even using the old harddrive, my impression is that the laptop is much faster now running Ubuntu. Of course now I don’t need to run all that Windows stuff that slows computers down so much (like Windows Defender).

Adding Programs

Ubuntu, like Raspbian is based on Debian Linux so anything I’ve blogged about installing things on my Raspberry also works pretty much the same. Plus Ubuntu comes with Firefox, LibreOffice and a number of other useful programs already installed. I was able to quickly add Chrome, Macchanger, Gimp and Tensorflow. For amateur radio there is a program called Chirp that can be used to program most radios. I never got Chirp to talk to my radio from my MacBook due to supposed driver incompatibilities with the USB to serial cable. But when I added Chirp to Ubuntu, it just worked and communicated with my radio no problem, first try.

With my MacBook I use an external drive to hold my photo library since its so large. I use one that is formatted for the MacOS filesystem, so I wasn’t sure it would work connected to Ubuntu, but when I plugged it in, Ubuntu recognized it and automatically mounted it with no problems. I imagine this is since both operating systems are Unix based and their file systems are compatible. I’ve never tried to make this work with Windows, because the instructions are rather daunting and require quite a bit of extra software to be installed.

Summary

The end result of all this is that I have a new refurbished laptop which I’m now using as my regular laptop running Ubuntu Linux. My wife is happily continuing writing her novels on the MacBook Air. And at least for now we don’t need to buy a new laptop. Perhaps we will down the road if we see a really good deal, but it isn’t an emergency. I never feel rushed to buy a new computer since they keep getting better all the time, plus prices are bit high right now because of the run on graphics cards by people doing BitCoin mining. Might be nice to let this run its course first.

 

Advertisements

Written by smist08

February 1, 2018 at 9:48 pm

Posted in Life

Tagged with , , ,

The Road to TensorFlow – Part 1 Linux

with 12 comments

Introduction

There have been some remarkable advancements in Artificial Intelligence type algorithms lately. I blogged on this a little while ago here. Whether its computers reading hand-writing, understanding speech, driving cars or winning at games like Go, there seems to be a continual flood of stories of new amazing accomplishments. I thought I’d spend a bit of time getting to know how this was all coming about by doing a bit of reading and playing with the various technologies.

I wanted to play with Neural Network technology, so thought the Google TensorFlow open source toolkit would be a good place to start. This led me down the road to quite a few new (to me) technologies. So I thought I’d write a few blog posts on my road to getting some working TensorFlow programs. This might take quite a few articles covering Linux, Python, Python libraries like Pandas, Stock Market technical analysis, and then TensorFlow.

Linux

The first obstacle I ran into was that TensorFlow had no install image for Windows, after a bit of Googling, I found you need to run it on MacOS or Linux. I haven’t played with Linux in a few years and I’d been meaning to give it a try.

I happened to have just read about a web site osboxes.org that provides VirtualBox and VMWare images of all sorts of versions of Linux all ready to go. So I thought I’d give this a try. I downloaded and installed VirtualBox and downloaded a copy of 64Bit Ubuntu Linux. Since I didn’t choose anything special I got Canonical’s Unity Desktop. Since I was trying new things, I figured oh well, lets get going.

Things went pretty well at first, I figured out how to install things on Ubuntu which uses APT (Advanced Packaging Tool) which is a command line utility to install things into Ubuntu Linux. This worked pretty well and the only problems I had were particular to installing Python which I’ll talk about when I get to Python. I got TensorFlow installed and was able to complete the tutorial, I got the IDLE3 IDE for Python going and all seemed good and I felt I was making good progress.

Then Ubuntu installed an Ubuntu update for me (which like Windows is run automatically by default). This updated many packages on my virtual image. And in the process broke the Unity desktop. Now the desktop wouldn’t come up and all I could do was run a single terminal window. So at least I could get my work off the machine. I Googled the problem and many people had it, but none of the solutions worked for me and I couldn’t resolve the problem. I don’t know if its just that Unity is finicky and buggy or if it’s a problem with running in a VirtualBox VM. Perhaps something with video drivers, who knows.

Anyway I figured to heck with Ubuntu and switched to Red Hat’s Fedora Linux. I chose a standard simple Gnome desktop and swore to never touch Unity again. I also realized that now I’m retired, I’m not a commercial user, so I can freely use VMWare, so I also switched to VMWare since I wondered if my previous problem was caused by VirtualBox. Anyway installing TensorFlow on Fedora seemed to be quite difficult. The dependencies in the TensorFlow install assume the packages that Ubuntu installs by default and apparently these are quite different that Fedora. So after madly installing things that I didn’t really think were necessary (like the Gnu Fortran compiler), I gave up on Fedora.

So I went back to osboxes.org and downloaded an Ubuntu image with the Gnome desktop. This then has been working great. I got everything re-installed quite quickly and was back to being productive. I like Gnome much better than Unity and I haven’t had any problems. Similarly, I think VMWare works a bit better than VirtalBox and I think I get a bit better performance in this configuration.

I have Python along with all the Python scientific and numerical computing libraries working. I have TensorFlow working. I spend most of my time in Terminal windows and the IDLE3 IDE, but occasionally use FireFox and some of the other programs pre-installed with the distribution.

gnome

I’m greatly enjoying working with Linux again, and I’m considering replacing my currently broken desktop computer with something inexpensive natively running Linux. I haven’t really enjoyed the direction Windows has taken after Windows 7 and I’m thinking of perhaps doing most of my computing on Linux and MacOS.

Summary

I am enjoying using Linux again. In spite of my initial problems with Ubuntu’s Unity Desktop and then with Fedora (running TensorFlow). Now that I have a good system that seems to be stable and working well I’m pretty happy with it. I’m also glad to be free of things like App stores and its nice to feel in control of my environment when running Linux. Anyway this was the small first step to TensorFlow.

Written by smist08

August 23, 2016 at 11:40 pm

Linux is Everywhere

with 4 comments

Introduction

It’s been a long running joke that at the beginning of each year, probably for the last twenty years, someone prognosticates that this will be the year of Linux. Often this is prefaced by the year of the Linux desktop or the year of the Linux server. But somehow in spite of all the hype, most desktops are still Windows as are a good number of servers.

I don’t really want to prognosticate that this will necessarily be the year of anything in particular, but recently it appears that everywhere I turn, I see Linux.

Telikin

My wife spent November and December in Arizona with her parents who are snowbirds, since I had quite a bit of business travel going on. Since she was there for 2 months she was determined to get her parents on-line. So they could Google things themselves rather than phoning her, so they could e-mail and use Facebook. So off they went and bought a shiny new Lenovo Windows 8 laptop with a touch screen and all the bells and whistles. This turned out to be quite frustrating and they had all sorts of learning and usage problems. The big one being that the touch interface didn’t work well. So they returned it and got a large screen Windows 7 laptop, which my wife thought would be easier since she knew it better and there was no touch stuff. Didn’t go so well. Then they saw an ad for a Telikin PC which was a special purpose PC for seniors with a touch screen as well as a mouse, with special easy to use software which included senior friendly features like large fonts and large graphics.

Telikin-TLMS18T3202W-PC

This actually worked out quite well. They could do e-mails, browse the web, print, upload photos from their camera and use Facebook. They then asked me about recording audio, so I got a freeware program and went to install it. I imagined that the senior friendly software was just a shell over Windows, and I just needed to figure out how to exit that or run a CMD prompt. No luck. I then Googled the computer and to my surprise found out it was powered by Linux! Apparently Linux is making it into the Desktop in a number of special purpose PCs. I then had to point them to a web site that allowed you to make audio recordings and away they went. Further they seem to be able to keep using it now that they are on their own again, since we returned home.

Android

Of course I couldn’t write an article about Linux taking over without mentioning Google’s Android operating system for phones and tablets. Last September, Google announced that 500 million Android devices have now been activated. That’s an amazing number. Basically Android is proving to be the market leader in both smart phones and tablets. Samsung has experienced tremendous growth with their Android devices.

ChromeOS

For laptops, Google is promoting their ChromeOS which is a minimal Linux based computer that is more oriented being a web browser. Surprisingly ChromeOS based laptops have topped the Amazon best seller lists for laptops in recent months. These are special purpose devices, but are gaining quite a bit of traction.

Tizen

Tizen is another open source Linux based smart phone operating system. This is being promoted as even more open than Android. It is being picked up by several Chinese phone manufacturers as well Samsung has announced they will be releasing Tizen based phones. Partly this is in reaction to Google shipping Google branded devices in competition to their hardware partners.

Ubuntu

Ubuntu has been a leading Linux distribution that has gained quite a bit of traction on the desktop. It is a full distribution of Linux and not one of the special purpose limited sets. Now Ubuntu is developing a smart phone version of their Linux version. The idea is that when the phone is mobile it runs a limited set of programs in a manner similar to Android or Tizen, but when you dock the phone and it’s connected to a monitor, keyboard and mouse, then you get the full Ubuntu distribution. This way your phone is also your laptop and tablet.

This is rather an interesting idea that the phone is your computing core with all your files and programs on it. Then depending on the hardware, connectivity and power you get the subset that is appropriate for that usage.

Raspberry Pi

The Raspberry Pi is a $25 computer that is oriented to hobbyists. It is based on the ARM CPU and runs Linux. The Raspberry Pi doesn’t even come in a box. But since it just recently went on sale, it’s already sold 1 million units. This has certainly woken up the home hardware hobby industry and I suspect the core design of this will end up in many other devices.

800px-RaspberryPi

Everything Else

At the recent CES show, there seemed to be a plethora of special purpose Linux based appliances from intelligent fridges to Linux being the operating system for your car. I don’t know how many of these will be successful but it appears that nearly everything is getting a CPU, memory and connectivity. Whether these have any lasting value or are short term gimmicks is yet to be seen.

Programming

As a programmer we want all our programs to run in as many places as possible. These days the market has become quite fragmented between Windows, MacOS, iOS and then all the Linuxes. One way to program for all these devices is to use HTML5/JavaScript since they all have Internet connectivity and good browsers like Firefox or Chrome. Another way is to use Java which runs on all these as well. For Windows, Linux and MacOS you can also use C/C++ and just isolate the operating system dependent parts in separate modules to handle differences in things like mutexes and file locking. Unfortunately besides using HTML5/JavaScript the preferred native way to create User Interfaces is completely different on all of these and tends to lead to very different ways of doing things.

Summary

It seems that Linux has been making inroads slowly in all sorts of places. Now all of a sudden it seems to be everywhere. I think this is a great tribute to what can be accomplished with open source software and how a great many profitable ventures can be based on it.

Written by smist08

January 19, 2013 at 5:55 pm