rolling with a different distro: centos 7

Because they’re so cheap I bought another 1TB Western Digital Blue drive from a local big box electronics store, swapped it into my R580 notebook, and installed a few other Linux distributions on the blank drive, eventually stopping at CentOS (Community ENTerprise Operating System) 7. CentOS 7 is Redhat Enterprise Linux (RHEL) 7 with all the Redhat branding and logos stripped out as well as the RHEL licensing structure. What’s left is an enterprise class version of Linux without any of the paid for RHEL hand holding.

There are a number of key differences between CentOS 7 and Ubuntu 14.04. One that’s important to me is support for RPM (Redhat Package Management) install files as opposed to Ubuntu’s DEB (DEBian) files, and all the tools built around those formats. Truth be told I prefer rpm and yum to deb and apt-get, although when you compare them dispassionately there’s really very little difference between them. Those folks that claim there is are the “fan boys (and girls)” of their distribution. I’ll be honest enough to say that long years of experience make me more comfortable using rpm, but that doesn’t make it overwhelmingly better.

One language I use and develop with is Java, choosing to use the official Oracle releases, which are pushed out either as ZIP, TGZ, or RPM files. No DEB files. It’s far easier to install via RPM on RPM supporting operating systems, such as RHEL/CentOS, Fedora, and openSUSE. If I want to use Oracle Java on Ubuntu then I have to go through some additional gyrations unpacking the TGZ file, as I’ve documented in previous Ubuntu posts.

In order to use Oracle Java I have to completely uninstall the Open Java/Iced Tea variants that just about every distribution wants to install. I dislike all those variants because they’re incomplete, don’t operate as correctly as the official Oracle release, and are always a few releases behind. And every time I uninstall Open Java I’m also forced to uninstall Libre Office due to insane dependencies of Libre Office on Open Java built-in to the distro.

CentOS 7 was no different, but it was straight forward and fast, unlike openSUSE 13.1. After removing Open Java and Libre Office, I installed Oracle Java 8 update 20, then downloaded the latest Libre Office (version 4.3.2.2). Sometimes you need to bypass the repos due to version rot not only for the latest Java, but the latest Libre Office as well. The CentOS versions of Libre Office are at 4.1.4.2 as of the date of this post. The primary driver is that Microsoft Office compatibility in Libre Office 4.3 is much better than in version 4.1.

I just mentioned openSUSE 13.1. That’s because I tried out OpenSUSE 13.1 KDE before settling on CentOS 7. While openSUSE installed fairly well, it had enough oddball quirks to it that I eventually installed CentOS 7 over it. Biggest problem with openSUSE is KDE itself; it’s changed to the point where I don’t like it at all any more. That’s a shock from my early days of 2007, when I fell in love with KDE 3. OpenSUSE is now completely off my radar.

One thing I will say about the latest Linux distributions, and that’s how they all effortlessly handle hardware. With all distributions both screen and network were easily detected and used. The wireless chip set on the R580 was the most surprising success; in all cases the chip set was detected and enabled. All I had to do was pick my home network and give it the password. After that it just ran.

Another big surprise is how all the distributions have current browsers, and how the current browsers handle multimedia. You’re looking at Firefox 31.1 above running a YouTube cat video using HTML 5 (no flash here!), complete with audio. When something as conservatively hidebound as CentOS 7 can run YouTube cat videos without flash, without turning to running arcane post-install command-line tools or installing additional “non-free” software from “non-free” repos, then you know the apocalypse has truly arrived.

Once installed it ran smoothly and without any incidents. I installed Oracle Java as well as the latest Libre Office. I also installed a few tools, such as gcc and g++, and then forked and built the latest node.js off of Github. It all built cleanly, and ran as well as it has on every other OS I’ve dropped it on. I tried some other hackery and it all worked as expected. From a software development perspective, CentOS 7 is like Mary Poppins, practically perfect in every way.

As good as CentOS 7 might be operationally and internally, I do have a number of complaints about CentOS 7. The first is how it looks.

CentOS 7’s desktop, which is their version of Gnome 3, looks like a poorly implemented copy of Mac OS X 10.5 (see above). If I’d wanted that look I’d have bought myself a Mac. Back in 2008 or so. The shadowing looks better on Mac OS X, while CentOS 7’s desktop decorations seem to take up too much space, especially between widgets.

Other annoyances include the desire of the Gnome developers to remove features, such as Nautilus’ ability to show previews (it once did), or the Gnome terminal’s loss of transparency in Gnome 3 (in Gnome 2 it was really very nice), or the inability to select gedit’s color theme (I always go in and select cobalt). Thankfully, they’re features that are still available in the same tools under Ubuntu 14.04. These are the kind of operational issues that tend make people like me cranky.

It’s been interesting playing with CentOS 7 this weekend, and I’ve certainly learned a lot. There’s certainly much to appreciate in CentOS 7. But as much as CentOS 7 has improved over all other versions of CentOS, I think I’ll stick with Ubuntu for the time being. In the mean time the CentOS 7 drive goes into storage until such time as I might have need of it.

Posted in CentOS, Linux, Ubuntu | Leave a comment

building web applications with mongo db: an update

It’s been a while since I did anything with MongoDB, a NoSQL (Not Only SQL) open source database. My MongoDB rad skills[1] had gotten a little rusty as a consequence. So I moseyed on over to the MongoDB download site, grabbed a zipped up Windows x86-64 copy, plopped it down on my machine, and then started to follow the directions to “Building Web Applications with MongoDB: An Introduction.”

It’s a great little presentation, but it has a few little quirks that this posting is meant to smooth over. They are:

  1. His presentation is on Mac OS X. This update is for Windows 8.1 Update 1 64-bit.
  2. This update contains the full source code to the three web application files, with a few minor corrections.
  3. This update contains a MongoDB console correction.

This update is preparation to get everything set up on Windows 8.1 before running the presentation. When you run the presentation it will go a lot smoother for you. And you should run the presentation to get the full benefits of learning about MongoDB. But first the software we’ll need to install:

Software Version
Python 2.7.8
pymongo 2.7.2
bottle 0.12.7
MongoDB 2.6.4

Please note that these are the versions as of the time this post was published. If you come across this post at some point in the future, they may be different (i.e. higher).

First let’s install Python and the infrastructure tools for the MongoDB Python driver and web infrastructure you’ll need to run the presentation.

  1. Pick up the Python software from ActiveState’s ActivePython download page. Make sure to select a version 2.7 Python. Pick the 64-bit MSI installer, run the installer, and take the defaults. It will put all the binaries and tools into C:\Python27.
  2. After the Python installation open a command shell and cd into C:\Python27\Scripts. There you’ll find easy_install.exe and pip.exe. You can use either tool to install pymongo and bottle, but it’s easier to use easy_install. For pymongo type “easy_install pymongo” followed by “easy_install bottle”.

Next download the MongoDB database software from the MongoDB download page. Select the 64-bit zip file. What follows is how I have my sandbox set up for this. You can change it to suit your environment if you want.

  1. Create a local sandbox area. Mine is C:\Java (an historical artifact).
  2. Unzip the MongoDB zip file into C:\Java. My unzipped MongoDB application is located in C:\Java\mongodb-win32-x86_64-2008plus-2.6.4
  3. Create a directory structure for the MongoDB data store. Mine is C:\Java\data\db
  4. In the C:\Java\mongodb-win32-x86_64-2008plus-2.6.4\bin folder create a batch file called runmongo.bat
  5. In that batch file put the single line ‘mongod –dbpath C:/Java/data/db’. Now you can double click it in the file explorer and start up MongoDB pointing to where it should place all its data files.

Finally create a sub work folder to hold the application file. Mine is C:\Java\MongoDB. Place the following three files into that location. I use the MongoDB subfolder just to keep things straight, but you could call it Fred and it would still work. What follows are the three files to copy:

import bottle
import pymongo
import guestbookDAO

#This is the default route, our index page. Here we need to read the documents from MongoDB.
@bottle.route('/')
def guestbook_index():
    mynames_list = guestbook.find_names()
    return bottle.template('index', dict(mynames = mynames_list))

#We will post new entries to this route so we can insert them into MongoDB
@bottle.route('/newguest', method='POST')
def insert_newguest():
    name = bottle.request.forms.get("name")
    email = bottle.request.forms.get("email")
    guestbook.insert_name(name, email)
    bottle.redirect('/')

#This is to set up the connection.

#First, set up a connection string. My server is running on this computer, so localhost is OK.
connection_string = "mongodb://localhost"
#Next, let PyMongo know about the MongoDB connection we want to use. PyMongo will manage the connection pool.
connection = pymongo.MongoClient(connection_string)
#Now we want to set a context to the names database we created using the Mongo interactive shell.
database = connection.names
#Finally let our data access object class we built, which acts as our data layer, know about this.
guestbook = guestbookDAO.GuestbookDAO(database)

bottle.debug(True)
bottle.run(host='localhost', port=8082)

File: index.py

 

import string

class GuestbookDAO(object):

#Initialize our DAO class with the database and set the MongoDB collection we want to use.
    def __init__(self, database):
        self.db = database
        self.mynames = database.mynames

    def find_names(self):
        l = []
        for each_name in self.mynames.find():
            l.append({'name':each_name['name'], 'email':each_name['email']})

        return l

    def insert_name(self, newname, newemail):
        newdoc = {'name':newname, 'email':newemail}
        self.mynames.insert(newdoc)

File: guestbookDAO.py

 

<!DOCTYPE html>
<html>
    <head>
        <title>Welcome to MongoDB!</title>
        <style type="text/css">
            body { font-family: sans-serif; color: #4f494f; }
            form input { border-radius: 7.5px; }
            h5 { display: inline; }
            .label { text-align: right; }
            .guestbook { float: left; padding-top: 10px; }
            .name { width: 100%; float: left; padding: 3px; }
            .wrapper { padding-left: 25px; padding-top: 20px; }
        </style>
    </head>

    <body>
        <div class="wrapper">
            <h1>Welcome To MongoDB</h1>
            <div class="guestbook_input">
                <form method="post" class="form" action="/newguest">
                    Name: <input type="text" name="name"/>
                    Email: <input type="text" name="email"/>
                    <input type="submit" value="Add Guest"/>
                </form>
            </div>
            <div class="guestbook">
                <h3>Guests:</h3>
                %for name in mynames:
                <div class="name">
                <h5>Name:</h5> {{name['name']}},
                <h5>Email:</h5> {{name['email']}}
                </div>
                %end
            </div>
        </div>
    </body>
</html>

File: index.html

 

Copy these three files into C:\Java\MongoDB.

Go to the MongoDB presentation and follow along. When it comes time to start MongoDB double click the startmongo.bat file in the file explorer. When it comes time to start the MongoDB shell, double click mongo.exe. When it comes time to run the web application in C:\Java\MongoDB (comprised of those three files you should have copied there) open a command prompt, cd to C:\Java\MongoDB, and type ‘python index.py’ and hit return. Then follow the rest of the demo.

Note that when the demo talks about deleting records in your web application’s database, you should type ‘db.mynames.remove({})’ instead of ‘db.mynames.remove()’. MongoDB has advanced enough from the version used in the demo to cause some minor annoyance if you follow the speaker’s directions exactly.

[1] I guess I’m an old fart; I refuse to spell the plural of skills with a ‘z’.

Posted in MongoDB, Software, Web | 1 Comment

my buddies at jp morgan

Got another one in the old e-waste basket today. Here is is in all its awesomeness (sarcasm), complete with spelling errors uncorrected.

From JP Morgan Chase Bank
Mr. James Dimon CEO
Address: 2469 Hempstead Turnpike
East Meadow, NY 11554-1155
Email Address: james.dimon.jpmorgan@gmail.com

Attn: Beneficiary,
The United States of America Co-operation Management in Conjunction with United Nation Worldwide are pleased to inform you that you are Among the 10 Winners of our Annual Year Lotto Lottery Conducted in the United Sates of America held on 14th of January 2014.
Your Email Address was Attached to Serial Number S/N-00221 and Consequently Won in the First Lucky 10 Winner’s Lottery Category.
You are therefore been Approved to claim the Sum of Usd$6,500.000.00 only (Six Million Five Hundred Thousand United States Dollars) only payable in wire Transfer from Jp Morgan Chase Bank New York City 2469 Hempstead Turnpike East Meadow, NY 11554-1155. Be informed that every arrangement regarding your payment through Telegraphic Wire Banking transfer has been made by our mangement.
You will have to re-confirm your full information which will be used to set up the account on your name here in the JP Morgan Chase Bank New York 2469 Hempstead Turnpike East Meadow, NY 11554-1155
Full Names:
Your Complete Address:
Scan copy of your personal identification
Direct Telephone Number:
Mobile Number:Present Occupation:
NOTE: That you are requested to claim your prize without any further delay.
Thanks for your Co-operation.
Mr. James Dimon CEO
Address: 2469 Hempstead Turnpike
East Meadow, NY 11554-1155

Email: james.dimon.jpmorgan@gmail.com

From
Mr. James Dimon
Manager JP Morgan Chase Bank.

Things must be really tough at JP Morgan when the best their CEO can do is a Google e-mail address.

Posted in Scams | Leave a comment

working “in camera” and in black and white

going for a rideThis is a second photo from the Lab’s trip to McDonald’s yesterday. Any dog I’ve ever known or known about loves to go for car rides. The labs are no exception. When they know we’re going out, especially my wife, they’ll stand at the kitchen door looking up expectantly. Now that our children are out in the world, their chances of going on a car ride are a lot higher than before. Their chances of rides depend on the season, with the least number and shortest times in the height of summer; we never leave them in the car, even if the air conditioning is running, from July to mid-September.

This photo was taken with the Olympus E-M5 and the M.Zuiko 12-50mm kit lens and is JPEG Large Fine straight out of the camera. The kit lens was zoomed out to its widest at 12mm (e24mm). I stepped back a bit and centered on Ruby, then stepped to my left to pick up Max’s face (Max goes in first, an alpha to the end).

The exposure is a custom monotone, with contrast set to -2 and sharpness set to +1. The gradation is set to high key. The reason it looks low key in this exposure is because exposure is set -1 to drop the background shadows to a rich black. I was able to “pre-chimp” the look using the E-M5’s excellent electronic viewfinder. Going high key in-camera and manipulating exposure in this way gives me the “look” I want without having to play with the exposure sliders in post processing. The only thing I did in post was to crop, scale, and add my watermark for the web.

That leads to my second revelation. In digging into and growing comfortable with this camera, I no longer shoot just raw, or JPEG plus raw. I now shoot just JPEG, specifically Large Fine, the largest JPEG possible. Even with that level of resolution, a 16GB card is capable of holding over 1,800 images. With my style of photography that means I can go an entire week without having to change cards.

It’s interesting how I’ve come around to just JPEG these days. When I started using digital cameras, all I had was JPEG. When I purchased my first Olympus, the E-300, in 2006, I kept to JPEG because I couldn’t afford a copy of Lightroom (back in those days it was hundreds of dollars/copy, not the free giveaway with camera purchase it is today). When I finally bought Lightroom, it was in 2009, and it was marked down to half price. I bought it to use with my E-3 in order to handle my sister’s wedding that October. Once I started using Lightroom I toggled into using raw exclusively. Five years later I’ve just now come back around to using JPEG (almost) exclusively with the E-M5. The JPEG engine in the E-M5, with proper handling, is that good if not better.

Why am I doing this? Four reasons:

  1. Black and White. I started photographing the world in the 1960s with a Kodak Instamatic 104. Black and white film was all my parents could afford in those days, and that’s what everyone in my family used as well (Kodak and Polaroid). Later I learned the value of Tri-X and black and white film processing, as well as how to print black and white. Again, it was cost, as color processing and printing were expensive. Later in life I earned enough to go color (Kodachrome), and digital makes the choice pretty much irrelevant from a technical standpoint. But I grew up on black and white, and learned to appreciate it far more than color. My background includes art, which was pen and ink drawing primarily. And that was also monotone. I choose to use black and white because I’m just that way.
  2. Time. I just don’t want to sink the time into post processing anymore. I’d rather spend the time actually photographing, or if not photographing, then experiencing life in general. I don’t have to use the camera all the time just to enjoy life.
  3. My slow permanent shift from Windows to Linux. I’ve used Linux for decades, and I’ve kept both because I’ve had uses for both. Recently (within the last six months) I’ve been using a “rescued” notebook with Ubuntu 14.04 installed and I’ve noticed I spend a lot more time with it than my more expensive Windows 8.1 Samsung. I hit 60 this year and I hope to continue to be a computer user and programmer until the day I die. But I don’t want to be beholden to Microsoft. Microsoft’s licensing and control is too draconian for me, while Linux let’s me do whatever I want, from installation on up. The rescued notebook has Ubuntu because I couldn’t get another copy of Windows 7 to replace the one it came with, and that had become inoperative. I’m not virulently anti-Microsoft, but after 30+ years (since Apple adopted Microsoft Basic on the Apple ][), I’ve about had enough. With a simpler workflow, pulling the images I want straight out of the camera, I don’t need Windows-only tools (Adobe) for image post processing. Since the majority of this goes on the web these days, the workflow and tools I use are pretty much identical between Linux and Windows.
  4. My final reason is Adobe itself. Their push to Creative Cloud and the dropping of stand-alone tools like Photoshop leads me to the conclusion I don’t want to do business with them anymore. I believe in the power of the web, otherwise I wouldn’t have nor use this blog. But Adobe’s all-or-nothing mentality about Creative Cloud leaves me quite cold and a bit angry, considering how much I’ve spent on both Lightroom and Photoshop over the years. In a way I have Adobe to thank for pushing me to learn how to be “creative” in the camera (like it should have been all along) rather than after the fact in an Adobe tool.

A final comment about the 12-50mm: it seems everyone on the Internet loves to trash this lens (along with the M.Zuiko f/1.8 17mm) for absolutely no good reason other than to attract eyeballs to their web site. I have both and they’re both excellent. I’m here to tell anyone that’ll listen that the 12-50mm is as good a kit lens as you’ll find on any camera of any sensor size for any price, providing incredible utility for both still and video. It’s environmentally sealed, and when on the E-M5, makes for a compact and resilient documentary photographic tool. It’s often asked what single lens and camera would you take if that’s all you could take, and my answer would have to be the E-M5 and the M.Zuiko 12-50mm zoom.

Posted in Labs, Linux, Olympus, Photography, Ubuntu, Windows | Leave a comment

happy birthday max and ruby

ice cream chow downAugust is the birthday month for Max and Ruby. We make a big fuss over them by taking them for a ride in the car to a local McDonalds where we order a vanilla ice cream cone (no chocolate dip, thank you very much) and a napkins. Lots and lots of napkins.

Then we pull over to a parking slot and let the two eat their ice cream. That’s where all the napkins come into play. Keeps the puppy slobber and ice cream drips off the upholstery.

Max turned 14 this year. He’s not the oldest Lab we’ve ever had; that belongs to Katie (15 years) and the grand old man himself, Rhett, who was our first yellow and who lived to be 16.

Max is, however, unique in a number of ways. Max is the oldest lab who continues to want to go on walks. He’s no where near as fast, nor does he cover the same distance when he was younger. But he still goes out, day in and day out. Even when it storms he wants to go out somewhere.

And he’s “trained” Ruby to be just as demanding of a walk. She pushes for her walks just as much as he does. When we all go out together she’s always out front, pulling on the lead, while Max hangs back checking out all the smells.

It’s all part and parcel of owning dogs. We don’t dress them up, or treat them as little humans. But they do enjoy having them around, and they enjoy being around us. We make each other happy, and make life that much more pleasant. And in this day and time, it’s the most valuable gift we share.

Update

This marks my 100th post on Arcane Science Lab.

Posted in Dogs, Labs, Uncategorized | Leave a comment