Archive for the ‘Red Hat’ Category.

How to make a Makefile?

Most software compiled on BLU (BSD/Linux/Unix) operating systems is done using make.

The simplest Makefile

The simplest Makefile compiles one single executable. Think of your simplest “Hello, World!” project.

HelloWorld.cpp

#include <iostream>
using namespace std;
int main() {
  cout << "Hello, World!";
  return(0);
}

Of course, for one file you don’t need a Makefile. You could simply run this command that will compile hw.cpp

g++ -o HelloWorld HelloWorld.cpp

So even though a Makefile seems useless for a single file, here is how you would do it.

all:
	g++ -o HelloWorld HelloWorld.cpp

Notice that you have a label and the same compile command one line below the label.

Important! The syntax requires the second line to start with a tab.

Adding objects to your Makefile

Lets assume instead of one file, you have the three file HelloWord.

  • Main.cpp
  • HelloWorld.h
  • HelloWord.cpp

Main.cpp

#include <iostream>
#include "HelloWorld.h"

using namespace std;

int main()
{
  HelloWorld hw = HelloWorld();
  cout << hw.Text << endl;
}

HelloWorld.h

#include <iostream>

using namespace std;

class HelloWorld
{
public:
  HelloWorld();
  ~HelloWorld();

  string Text;
};

HelloWorld.cpp

#include "HelloWorld.h"

HelloWorld::HelloWorld()
{
  Text = string("Hello, World!");
}

HelloWorld::~HelloWorld()
{
}

This simple project can also easily be compiled without a Makefile using this command line.

g++ -o HelloWorld Main.cpp HelloWorld.cpp

However, even with only three files you can start to see how it is much easier to type make than the lengthening command above.

Makefile

all:
	g++ -o HelloWorld Main.cpp HelloWorld.cpp

This is not perfect however, as this compiles both files every time make is run. If changes are made only to Main.cpp there is no reason to recompile HelloWorld.cpp. We can accomplish this by compiling HelloWorld.cpp to a HelloWorld.o module.

all: HelloWorld.o
	g++ -o HelloWorld Main.cpp HelloWorld.o

Similarly if you make changes to HelloWorld.h or HelloWorld.cpp, why do you need to recompile Main.cpp? So you can make it a module too.

all: Main.o HelloWorld.o
	g++ -o HelloWorld Main.o HelloWorld.o

Now only the libraries that have been modified will be recompiled when you run make. This can save significant build time when the project size increases.

Using variables in your Makefile

Mistakes are annoying.  Having to type the same thing in multiple places often leads to mistakes and typos. If you look at the above, there is duplication that is unnecessary.

Makefile with duplication

all: Main.o HelloWorld.o
	g++ -o HelloWorld Main.o HelloWorld.o

Makefile using a variable to avoid duplication

objs = Main.o HelloWorld.o
all: ${objs}
	g++ -o HelloWorld ${objs}

We can even add more variables which may not seem useful now, but are useful later.

CXX = g++
CXXFLAGS =
objs = Main.o HelloWorld.o
Outfile = HelloWorld

all: ${objs}
	${CXX} ${CXXFLAGS} -o ${Outfile} ${objs}

Think about it. Right now you only have one build command, but someday on a huge project you may have dozens and possibly hundreds. Could you imaging changing the CXXFLAGS everywhere? We don’t even have one listed yet, but of course, with the variable you only have to change it once in one place and it will work everywhere you used it.

Adding make clean to your Makefile

It is very common to want to delete all build files and build again. This is often done with the make clean command. But to get make clean to work you have to create a section or label in the make file called clean.

Because we already have variables, it is easy to configure the Makefile to support make clean.

Makefile with clean

CC = g++
CXXFLAGS = -W
objs = Main.o HelloWorld.o
Outfile = HelloWorld

all: ${objs}
	${CC} ${CXXFLAGS} -o ${Outfile} ${objs}

clean:
	rm ${objs} ${outfile}

So simple, we just use rm to delete the files we created, which are all in variables so we had a nice clean short command.

Adding debugging to your make file

There are two schools of thought for debugging.

  • All builds should be release builds unless you run make debug.
  • All builds should be debug builds unless you run make release.

I am not going to tell you which school of thought you should have.  What matters is that you can configure the Makefile to perform how you want it to.

This make file will always build without debugging (release) unless yous specify make debug.

CXX = g++
CXXFlags = -W
objs = Main.o HelloWorld.o
Outfile = HelloWorld

all: objects build

objects: ${objs}

debug: clean
CXXFLAGS += -g
LDFLAGS += -g

debug: objects build

build:
	${CXX} ${CXXFLAGS} -o ${Outfile} ${objs}

clean:
	rm -f ${objs} ${Outfile}

Notice we set LDFLAGS but we never actually call it. It is a special variable that is called automatically by the linker when creating the objects. Yes it must be capitalized.

BSD Licenses good, GPL bad: Microsoft Bans Some Open Source Licenses from WP7 Marketplace

Microsoft is not going to allow GPL onto their phones.
Microsoft Bans Some Open Source Licenses from WP7 Marketplace

Microsoft has stated that its Windows Phone 7 marketplace will reject any apps that use the GPL (GNU General Public License) and similar licenses.

“The Windows Phone Marketplace supports several open source licenses, including BSD, MIT, Apache Software License 2.0, MS-PL and other similar permissive licenses.  We revise our Application Provider Agreement from time to time based on customer and developer feedback, and we are exploring the possibility of modifying it to accommodate additional open source-based applications in upcoming revisions.”

Microsoft is doing the right thing and cannot be blamed in the slightest. The GPL is often termed a viral license and for good reason. Once you use it in your code everything is infected by it. Others say it is a spiderweb license, that once you are in the spider’s web, you can’t get out. The BSD license instead of the GPL is probably the single biggest reason to use FreeBSD over Linux, especially for enterprise business such as Microsoft, Apple, and others.

I don’t like the entrapment of the GPL. Students often first encounter the GPL in college, where they hear that the GPL is free and start using it. Only later do they realize they are trapped. Some don’t mind, wish they would have understood the license better.

Here is a simple rhyme to remember which license to use:

If you want your software to really be free,
    license it with BSD.
If you want your software to be in license hell,
    use the GPL.

This post shows that Microsoft feels the same as many of us who are anti-GPL.

Obviously they don’t want to have those who write their apps ever accidental depend on another app, only to find out the app they depended on is GPL, so their entire work must be GPL as well. They are doing what humanity tries to do with any virus, eradicating it and prevent infection by eliminating the virus, just as we have done with small pox, from the world.

For more information on the differences between the BSD License and the GPL, read this post.
Differences between the BSD/FreeBSD Copyrights and the GNU Public License (GPL)

Russian Government going Open Source…and the future

Well, I have seen governments claim they are going to open source before, but not from Russia, and not with such a realistic plan to migrate over a few years.

Here is a link to the article via Google translate:

Putin ordered the transfer of power on Linux

The now

Business drives software development.  Open Source communities help, but even today much of the ongoing development for Linux is driven by businesses such as Red Hat and Novell and others.  If you think your Linux code is being written by unpaid developers in their spare time, you are somewhat correct but only partially.  Most changes are made by developers who are paid.

While communities are nice, they can’t match the hours or output of experienced developers working forty to sixty hours a week.

Looking Ahead…the Apps…and C# (Mono)

The more open source is used in business, the more development power it will have.  But it is not the open source Operatings Systems that prevent people from moving to Linux or BSD.  Ubuntu, SUSE, Fedora, CentOS, PC-BSD, and numerous others are all very usable desktops that are user friendly.  It is the software that runs on them that everyone is waiting for.

The market is already there to make millions extra if you application runs cross platform, one Windows, MAC, Linux, and BSD.

But most the applications written for Windows, the business desktop of today, are using .NET Framework. So naturally those companies are going to want to make their code cross platform.  And they are going to find it is easier than they thought to move their applications between platforms using C#.  I have recently decided that C# is the future of applications on all platforms.

Some MAC and Linux users don’t like Microsoft and will fight off the idea of a Microsoft provided development platform such as C# (Mono) on their systems.  But when a corporation decides that you must run software X, and software X requires .NET, and you have to either give up your MAC or Linux box for a Windows box, or use C# (Mono), then users will come around.

If you are a company writing software for Windows only today and using C#, you need to take a look at Mono. Even if the return on investment of developing a C# (Mono) based version of your product is a slight loss to break even, it is an investment in the future.  Once written, maintenance costs will be less than the original development costs and that slight loss to break even margin will turn to a small profit.  And with the experience, you next app will migrate to C# (Mono) that much easier and soon, all you apps will run anywhere that C# (Mono) can run.

This is going to take off in a way Java hasn’t because developers for windows prefer and will continue to prefer .NET over Java.  And when it comes to business apps, Java just isn’t the language of choice.  Business applications are written in C#.

FreeBSD or Linux

Ok, so if you have been on my site, you know that I started with Red Hat and never really got into it, and then, settles on FreeBSD.  Why would I choose FreeBSD over Linux? It fit me better.

I actually think that everybody needs to use what suits them.

This is NOT a FreeBSD versus Linux post.  It is a site to help others who are trying to decide whether to use FreeBSD or Linux see some pros and cons and get my recommendation.

FreeBSD

FreeBSD is not Linux or Unix exactly.  It is BSD. It has its own bsd kernel and an is surrounded by a base system.

Here are a list of positives about FreeBSD

  • It is open to proprietary code that just can’t be used in Linux, such as Sun’s ZFS.
  • It is easy to get a small install of just the base system with minimal to no features installed. (Security! Attach surface area is minimized when less software is included.)
  • Jails
  • The ports tree for compiling from source is unmatched by any Linux operating system, but if you prefer binaries, yes, it has them too.
  • Installing software has less problems as you compile it on the system, with the settings you need (rather than get binaries that may have been compiled for a different system or without the settings you need).
  • The documentation is far better than most other open source projects and better than most projects commercial or open source for that matter!
  • OS X chose to use much of FreeBSD in its underlying operating system and so when combining the OS X and FreeBSD market share, FreeBSD code is actually used on more systems than any operating system other than Windows.
  • There are not that many BSD distributions, and the ones that exist have clear focusses different than the others, that later they share.  FreeBSD is a solid server. PC-BSD is a desktop focussed on avoiding dependency problems with its software. OpenBSD is extremely securee. NetBSD is extremely compatible with lots of hardware.  They contribute back to each other often.
  • The License is free and gives everyone who uses it true freedom.
  • The License is free for commercial use.
  • Easy Editor. Newbies can actually use this editor included in the FreeBSD base system.  Don’t forget to learn vi though.
  • Patching is as simple as running freebsd-update.

Here are a list of negatives about FreeBSD

  • Hardware companies tend to make drivers for Windows and Linux first and often don’t include FreeBSD, though most hardware is soon supported.
  • There is not a native Flash Player in FreeBSD, instead the Linux version of Flash must be used.
  • There Desktop options for FreeBSD are not as rich as those for Linux (Example: KDE network settings doesn’t work on FreeBSD, but PC-BSD has their own settings now.)
  • IT/Developers forFreeBSD are harder to come by.

Linux

Linux was originally just a kernel.  The userland was separate.  Now there are plenty of projects that make a nice complete operating system using the Linux kernel and a nice base system surrounding it.

Here are a list of positives about Linux

  • It has a large user base.
  • Free to use.
  • There are plenty of distros to choose from.
  • It is no longer just a kernel but many different groups put out an actual system: Red Hat/Fedora, Debian/Ubuntu, CentOS, SUSE, Arch, Gentoo, etc…
  • A lot of work is going into the desktop environment
  • Development for any Linux platform could benefit all Linux platforms.
  • More and more hardware companies are including Linux drivers
  • Some Software companies make Linux software as well, and the number is increasing
  • Strong commercial backing (which doesn’t make sense for software licensed under the GPL)

Here are some negatives

  • There is often a lot of binary packages that just don’t work.
  • Lack of consolidation.  There are a lot of distributions of Linux and they are not the same. Which one do you choose.
  • Many Linuxes (not all) are now installing desktop software by default, and no longer are minimalistic. (Security! Attach surface area is increased when more software is included.)
  • The inability to write and distribute software that touches GPL software, without having to release your software as GPL too.
  • If you hope to do anything other than use the software or help the community, you need a lawyer to figure out how to interact with the various versions of GPL.
  • The security settings are usually not easy to use and are result in users just turning them off (i.e. SELinux)
  • Are Red Hat and SUSE open source or commercial, they sell support but the software is free, except you can’t get updates without buying support…confusing!
  • IT guys who claim to know Linux usually have done little more than run Ubuntu for a few days.

This is not a flame post and any responses that appear to be trolls will be deleted.

My recommendations

Ok, so what would I recommend if I were paid by a company for consulting?

Server (LAMP)

For a Server running Apache, PHP, SQL, often mis-termed LAMP (Linux Apache MySQL PHP) but really means any OS, Web Server, SQL, Script language.

Recommended OS: FreeBSD

Commerical Appliance

If you work for a company and you need a commercial appliance. Stay away from the dangers of the GPL, just don’t go there.

Recommended OS: FreeBSD

Open Source Desktop

For a quick desktop for a home user that has PC hardware but doesn’t have a license for Windows and doesn’t want to buy one.

Recommended OS: Ubuntu

Note: Sorry PC-BSD friends. Keep working on it.

Commerical Desktop for Employees

If you want a good commercial desktop, you should go with one of the following depending on certain factors, the primary being that some software you may need to use only runs on these two platforms.

Recommended OS: Windows 7 or OS X

However, Ubuntu, Red Hat, SUSE, Fedora, PC-BSD, are all very usable replacements depending on the situation.

Point of Sale (POS) Device

If you need to have to have a POS device for handling sales.

Recommended OS: Depends on needs

Share your thoughts

Hey, please comment.  No flame wars though.  I repeat, this is not a FreeBSD versus Linux post, but a FreeBSD or Linux post, with just some information from my experience. I appreciate all technology and any rude comments will be deleted.  However, feel free to challenge and provide facts, demand facts, etc…

Utah Open Source Conference 2010

Hey all,

The Utah Open Source Conference 2010 was pretty fun.  It was really my first open source conference.  Yes, I have been into open source for 10 years, specifically FreeBSD, but somehow I haven’t really attended the conferences.

I will probably attend conferences more often.

What was there about FreeBSD?

PC-BSD and the folks as iXSystems sent me with some swag.  Howard Logsdon helped me man the GUBUG booth.

There was a great presentation on FreebSD Jails given by Chris Edwards. (http://www.utosc.com/presentation/157/) Supposedly they are going to post a recording of the presentation. Until then, check it here: (http://wiki.zelut.org/doku.php/presentations:freebsd-jails)

Who else was there?

So Novell SUSE brought some nice laptop bags, and they were pretty good.  I have a nice Ogio laptop back pack, so I am giving this laptop bag to my wife.  It is just big enough to fit her 17″ HP laptop.

There was Fedora, Ubuntu, KDE, and GNOME.  There was a boot on XDMC and MythTV.

There was a very cool company there called Fusion-IO.  They have an awesome hard drive, though they are not cheap. 7k for the cheapest drive. But for some companies, it would be worth it.
When is the next Conference?

You can go here to see upcoming events: http://www.freebsd.org/events/events.html

There is the Meet BSD California 2010 conference November 6 and 7th.

To see when the next Utah Open Source Conference is you should go to the site and register so that when the date is announced, you will be informed.

Are you using BSD or Linux and you don't even know it?

Hello everyone,

I have had two Open Source experiences with average non-geeks that I would like to share.

Experience 1 – The in-laws are using Linux
I spent Easter at my in-laws and while I was their I of course took some time to “fix” their computers. Doing some maintenance to their computers is a regular task for me. However, they had recent purchased a new netbook and it was the only computer that they didn’t need me to work on.

“You got a new Netbook?”, I asked in surprise. Not that they consult me before every purchase but I usually hear about it. “Can I see it?” I asked.

My father-in-law, a retired seminary teacher who does real estate on the side, went and got the new little Netbook.

I booted it up and while the average person couldn’t tell it was running Linux, I immediately recognized the KDE interface despite the fact that it was tweaked to look as much like windows as possible.

I pressed “Ctrl + Alt + Backspace and sure enough Xorg restarted.

The Netbook is a pretty cool system. It is featured more like a smart phone than a computer, in that it has a tabbed window and you have a limited amount of icons on each tab, including needed items such as a browser, a documentation suite (Google Docs), etc…

My son’s grandparents are using Linux and they don’t even know it. While my curiosity told me to figure out how to enable the root account and start hacking around, I pushed aside the temptation because it was pleasure enough to know that my predictions are coming true.

I said, “By 2010, Linux will be above the watermark of requirements for the majority of users, and will start taking the market by storm.” And I am telling you it has begun.

Well, you might argue that this one purchase by my grandparents doesn’t mean this is true.

Well, I would retort that it isn’t just this one incident.

  • Netbooks are very popular and selling fairly well among all walks of life, not just to my grandparents.
  • There are many Google phones that are running Android, based on the Linux kernel.
  • Slashdot has a story where Ubuntu is claiming 12 million users and Fedora claims 24 million.
  • My company, LANDesk, continues to get an increased amount of request to support Linux flavors.

Experience 2 – A friend of a friend needing to compile an open source app on OS X
My favorite Operating System is FreeBSD, which has a great desktop version PC-BSD. While these are not exactly Linux, they are open source and actually more free than Linux (see my post on licenses). The rise in the use of FreeBSD and PC-BSD is also increasing rapidly.

Windows is the most used operating system by far. Did you know that the second most used operating system is FreeBSD-based. Yes, Macintosh users, underneath the hood of your pretty graphical user interface (GUI), you have a system that is derived in a large amount from FreeBSD.

Yes, if you are running OS X, you are running a system that is, underneath the hood, very similar to FreeBSD. It has a nice ports system called MacPorts that is a very similar system to FreeBSD’s ports system.

Well, as a replacement for a Visio diagram, I used the program Dia so that some of my friends could have the ability to modify and change the diagram (which happens about once a quarter) as desired without spending way too much for Visio when they otherwise would never ever use it. Well, a friend of a friend called me and wanted to use it.

Unfortunately at this time, Dia doesn’t have a version for OS X, but can be installed using MacPorts. So I found myself showing the average user how to install MacPorts. Unfortunately, I don’t have a Mac, so I couldn’t write a walk-thru of doing this and I don’t know if the friend of a friend was successful in installing Dia on OS X, but still, this average user wanted to do it and wanted this open source app that was available to him only because his system was derived in large part from FreeBSD.

Differences between the BSD/FreeBSD Copyrights and the GNU Public License (GPL)

The FreeBSD Copyright and the BSD Copyright

You may notice that FreeBSD uses the term Copyright while GNU uses the term License.
http://www.freebsd.org/copyright/copyright.html

The FreeBSD Copyright is free as in you don’t have to buy a license but you can do pretty much anything. The BSD Copyright is almost the same.

What you can do:

  1. Use it at home for no cost.
  2. Use it at work for no cost.
  3. Use it at work for a publicly accessible server that you make money on for no cost.
  4. Add or change code at no cost.
  5. Distribute the entire source code at no cost.
  6. Distribute the entire source code with your changes at no cost.
  7. Build binaries at no cost.
  8. Distribute binaries with your source at no cost if you also give it away at no cost.
  9. Distribute binaries without also distributing the original source and your changes.
  10. Write code that uses or links to this code and license your new code however you want.
  11. Embed the binaries in software you sell, at no cost, even if you don’t provide the source.

Note: This list was created by me based on my understanding of what people would want to do with the code.

Do I need a lawyer?
No. Basically, there is almost no instance in which you have to pay a fee to anybody to use a FreeBSD Copyrighted or BSD Copyrighted piece of code.

However, while 100% free in cost to use it, it is not 100% free. Notice I italicized the word almost in the above sentence.

For the FreeBSD Copyright, also known as the New BSD Copyright, there are two requirements you must meet.

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

And for the BSD Copyright, there are four requirements listed, but as mentioned on the BSD Copyright web site, the third requirement is no longer required.

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software must display the following acknowledgement:

This product includes software developed by the University of California, Berkeley and its contributors.

4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

So you can do anything you want with FreeBSD licenses and BSD licenses at no dollar cost, but you have to spend some time and resources to make sure you display some text as required.

I guess if you didn’t want to follow the 2 or 4 steps, you could find someone to pay so you didn’t have to, but the steps are so simple I doubt anyone would choose to try to license the software to not have to follow these steps.

The The GNU Public License or GPL

The The GNU Public License or GPL is not completely different but yet don’t be fooled. It is not the same and is far more restrictive than most realize. And it is harder to explain or describe, especially since there is GPLv1, GPLv2, GPLv3, and I am not even discussing the LGPL here.

You can get more info here:
A Quick Guide to GPLv3

What you can do:

  1. Use it at home for no cost.
  2. Use it at work for no cost.
  3. Use it at work for a publicly accessible server that you make money on for no cost.
  4. Add or change code at no cost.
  5. Distribute the entire source code at no cost.
  6. Distribute the entire source code with your changes at no cost.
  7. Build binaries at no cost.
  8. Distribute binaries with your source at no cost if you also give it away at no cost.

Do I need a lawyer?
For home use, no.
For a business, yes.

If you are doing anything NOT on the above list, you probably need to involve a lawyer. If you stick to the above list, then no, you probably don’t need a lawyer. However, the GPL is so long and wordy you may need a lawyer to determine if you need a lawyer.

The Difference between the BSD/FreeBSD Copyrights and the The GNU Public License or GPL

The first noticeable difference is that the FreeBSD Copyright is 25 lines (when wrapped at 78 characters with some lines blank due to section separation) while the GPL is 339 lines (when wrapped at 78 characters with some lines blank due to section separation). So it is much more difficult to learn and understand the GPL and there is a higher likelihood to take a wrong step.

The following items were removed these from the GPL’s can-do list because you can’t do them without permission from the author, which most likely will come at a cost but not always. Sometimes, the author will just say, “Yes, you can use it in your proprietary software” and sometimes they will charge a fee. However, even in those instances you probably need to pay a lawyer to draft and agreement and get it signed. However, one problem with GPL is that there are usually many different authors and so obtaining such permission becomes impossible.

  1. Distribute binaries without also distributing the original source and your changes.
  2. Write code that uses or links to this code and license your new code however you want.
  3. Embed the binaries in software you sell, at no cost, even if you don’t provide the source.

Lets put this in a table:

What you can do? BSD/FreeBSD Copyright GNU Public License or GPL
1. Use it at home for no cost. x x
2. Use it at work for no cost. x x
3. Use it at work for a publicly accessible server than you make money on for no cost. x x
4. Add or change code at no cost. x x
5. Distribute the entire source code at no cost. x x
6. Distribute the entire source code with your changes at no cost. x x
7. Build binaries at no cost. x x
8. Distribute binaries with your source at no cost if you also give it away at no cost. x x
9. (Commercial) Distribute binaries without also distributing the original source and your changes. x
10. (Commercial) Write code that uses or links to this code and license your new code however you want. x
11. (Commercial) Embed the binaries, without a license fee, in software you sell, even if you don’t provide the source. x

Conclusion

For use at home or work or school or play
In all practicallity there is no difference to a home user between the BSD/FreeBSD Copyrights and the GPL.

For Free Distribution
There is one slight difference in free distribution. Any code you write that uses GPL code must be GPL too. With the BSD/FreeBSD copyright, that is not the case. If you write software that uses or links to BSD licensed software, you can still choose your own license.

For Commercial and Enterprise Use
This is where the difference mainly resides between these two licenses.

For use internally for an enterprise or any use that doesn’t distribute the code, there is no difference.

However, when it comes to including the code or a binary in software that you sell, you are not free to do so. The BSD/FreeBSD Copyrights are much more business and enterprise friendly.

DISCLAIMER

I am not a lawyer. I am not responsible in any way for the misuse of a license based on this post, even if the post is has some piece of data that is blatantly wrong. It is the responsibility of the user of licensed or copyrighted software to make sure the license agreement or copyright is adhered to properly.

PC-BSD and FreeBSD are Two of the Fastest Growing Open Source Operating Systems Last Year while Ubuntu-based Operatings system lead growth

So PC-BSD and FreeBSD are getting a lot more attention. They are growing fast. Reports created based on the data from DistroWatch show that PC-BSD and FreeBSD are two of the fastest growing operating systems last year. Of course, despite my bias towards FreeBSD, as it is my favorite distribution, the numbers clearly show that Ubuntu/Debian-based platforms lead the growth.

Ok, so DistroWatch.com counts the hits per day (HPD) to a distro’s home page. Lets compare the hits per day over the past twelve months to the hits per day over the past 6, 3, 1 month intervals to see who is experience the most growth in hits per day as well as who has the highest percentage growth.

Growth in hits per day (HPD) between the 12 month and 1 month charts

Is one month a valid sample size? Of course not, that is why we are doing three month and six months as well. But lets look at it anyway.

PC-OS appears to have the lead here. PC-OS is based on Ubuntu (which itself is Debian-based). Other Ubuntu/Debian-based platforms showing growth are Debian itself, MEPIS, Mint, and Ultimate.

The only other base platform to have more than one distro show up in this list is FreeBSD. As you can see, PC-BSD is second in growth on both HPD and percentage, and FreeBSD is fifth in HPD growth and third in percent growth.

Growth in hits per day (HPD) between the 12 month and 3 month charts

Three months is definitely a larger sample size. Three months means we don’t have as much data skewed by release cycles which cause higher growth temporarily that will be offset by a decline the long months between release cycles.

Again we see similar trends in the three month reports.

Debian itself , MEPIS, Mint, and Ultimate and are all Debian/Ubuntu-based distros.

Again, FreeBSD and PC-BSD are on both the list. PC-BSD is second in HPD growth and leads all distributions in percentage growth.

Growth in hits per day (HPD) between the 12 month and 6 month charts

Ok, so the twelve to six month comparison is the largest sample size can get. Perhaps I should contact DistroWatch.com and see if I can get the raw data for multiple years past, but alas, I only pull the data from the tables they have currently available.

So now we see very similar data again. Seeing similar data a third time using this largest sample size means it is more likely accurate.

Fedora ties Ultimate for first, but the tie breaker has to go to Ubuntu/Debian-based plaftorms as they again lead Mint, Ubuntu, and Ultimate all on the list.

FreeBSD is on both HPD and percentage reports, while PC-BSD only shows up on the percentage report. However, again, FreeBSD is the only base open source operating system after Ubuntu/Debian-based to have two distributions show up between these two lists. For those interested, PC-BSD was fifteenth but only the top eight distros are displayed.


Note: For information on how these reports are created, see this post:
Using QlikView and DistroWatch to report on the most popular open source distributions (BSD, Linux, Unix)


Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.

Using QlikView and DistroWatch to report on the most popular open source distributions (BSD, Linux, Unix)

Ok, so I am into FreeBSD and open source software, but I have recently had to do a QlikView implementation for my company LANDesk. QlikView has a feature where you can pull data from the web and report on it. So I needed to learn how to use the web-based reporting, so I decided to do a report from www.distrowatch.com.

Report Goals
There are few things that interests me from the data at DistroWatch:

  • Which base platforms are the most used?
  • Which platforms should software companies focus on supporting?
  • Where does BSD sit in the rankings.

How the report was made
So on the main DistroWatch page, there is a report that will give you the average hits per day (hpd) that a Distro’s web site gets. At the bottom there is a link to full popularity page of just these reports:
http://distrowatch.com/stats.php?section=popularity

So at first glance, you see Ubuntu is the best and Fedora is second and so on. I wanted to take the statistics a bit further. I wanted to know what main base distribution was the most used. What I mean by base distro is this: Ubuntu is #1. But Ubuntu is not a base distribution, instead it is based on Debian. Mint is #3 and is also based on Debian. Debian itself is #6 and it is a base distribution. Fedora is a base distribution.

QlikView can connect to this web page and consume this data. It was also able to loop through and click go to the link for each distribution where it was able to pull the “Based on” results. I did a few little tweaks to clean it up.

So I used QlikView to match each Distribution to its base distribution and built my report. I gathered the cumulative hits per day (hpd) of each base distro by summing the hpd from itself and its child distros. The results are staggering.

Result of the Report
I am going to show you a screen shot of the report, but I am only going to show the top 10 base distributions because otherwise it is to hard to view the report.

# 1 – Debian
Well, I have to say that I new that Debian (13818 hpd) was popular because of Ubuntu, but I didn’t know how far ahead it was compared to other base distributions. I expected Red Hat to be a lot closer but its just not. Lets look at the top ten Debian platforms by hits. In QlikView this is easy, I can simply click on the Debian pillar in the report.

So not only is Debian’s cumulative hits per day first, but it is first by a long ways. The cumulative hits per day of distros based on Debian is more than three times larger than any other base distribution’s cumulative hits. It is pulling away from the pack and nobody is going to catch up any time soon.

What I don’t know is are these new users or are other distributions losing members to Debian or Debian-based distros?

You might be grumbling to yourself and saying some incorrect statement like: Well, Ubuntu doesn’t have Enterprise support like Red Hat. But like I said, that is an incorrect statement. See their support page:
http://www.ubuntu.com/support

# 2 – Red Hat
Now, lets look at the top ten distros under Red Hat.

Ok, can I tell you that I was surprised at these results. I realize that Fedora was huge, I mean it is second on the distro list under Ubuntu, but I had missed the fact that CentOS was getting more than twice the hits Red Hat itself gets. The rest are hardly worth mentioning.

Historically mong Enterprise environments Red Hat is the most known distro, but when you look at these stats, you have to wonder if Ubuntu has taken over. The numbers for Fedora are fine, but for Red Hat they are not really that good. In fact, I keep hearing about companies using CentOS instead of Red Hat and as you can see, CentOS is getting a lot more exposure than Red Hat.

I will make this statement. Based on this data, if you are a software company considering whether to support Debian or Red Hat first, based on this data you have to choose Debian. If you were to make up some fuzzy logic for Red Hat (which due to its enterprise presence may or may not actually be valid) and weight the distributions based on other factors and somehow found a way to say Red Hat and its distro’s cumulative hits per day were worth three for every one, it would still be less than the cumulative hits per day Debian gets.

# 3 and #4 – Mandriva and Slackware
Ok, back to the report. Something that shocked me from the first chart and I had to analyze it further. Slackware? I had no idea that it was third. However, is it really third? It has a lot of very small distros based on it and Slackware itself gets 590 hpd and most the distros get less than 100 hpd. Mandriva is fourth but arguable could be third over Slackware. In fact, I have to call Mandriva third over Slackware. Sometimes you have to look at the data and make a judgment like this. Sorry Slackware, I am not trying to be biased (otherwise I would be talking up FreeBSD). I have no bias to any Linux distribution. I just say this based on the fact that Mandriva (1048 hpd) and the based-on-Mandriva version PCLinuxOS (773 hpd) both get more hits by a long way than Slackware’s top distros. The only reason Slackware got more hpd was because it has a lot of distros that were really small, while there were very few small distros based on Mandriva. The difference in the amount of small base distros is most likely due to the fact that Slackware is one of the oldest Linux distros, if not the oldest remaining distro, so naturally it has more distros based on it.

# 5 – Gentoo
Gentoo’s cumulative 1804 hpd was fourth. I have to apologize to Sabayon (760 hpd) as I had never heard of it until now. Gentoo itself only gets 428 hpd.

# 6 – BSD
What is next. Well, finally BSD shows up at number 6 with 1743 hpd. For those of you that are reading this and only know about Linux, BSD is NOT Linux. It does not run on the Linux kernel and is not likely to use many GNU tools. I hope I don’t drip with too much bias as FreeBSD is my favorite open source distribution.

Lets pull up the chart of BSD distros. There are 15 distributions listed under BSD, which is probably more than most people would believe since BSD often claims that it is not as broken up as Linux, but it has had its share of forks.

FreeBSD (553 hpd) is the main distribution. Of the Linux distributions, only Debian has more software packages available than FreeBSD.

PC-BSD (355 hpd) is to FreeBSD as Ubuntu is to Debian. For being such a new distribution PC-BSD is doing rather well. It is pretty comparable in ease of use to Ubuntu, Fedora, and OpenSUSE. Yes, PC-BSD is fully featured, running a nice windows environment with everything you could want, including a working Flash Player, the ability to configure your wireless card, and more. I recommend that if you are looking for a new desktop distribution, you at least install PC-BSD and give it a try. Ok, so my bias does show a little here.

# 7 – SUSE
So I was very surprised that SUSE wasn’t on this list until #7. Well, OpenSUSE is doing its part getting 1327 hpd. Remember, OpenSUSE is #4 if you just go by distro and not cumulative base distros. I think in time SUSE could be more popular. SUSE is newer than some of the other base distros and so it only has four distros listed. Novell’s SUSE Linux Enterprise (121 hpd) is the second most popular SUSE distro, however, it just not getting any were near the hits I expected it to be getting.

The others
And then there are the rest of the top ten: #8 Arch, #9 Puppy, and #10 Solaris (Or is that Oracle now?). Sorry if your distro was left out, this report is in the control of those who visit the distro’s web pages.

How accurate is this data?
On DistroWatch’s popularity page, it says:

The Page Hit Ranking statistics have attracted plenty of attention and feedback. Originally, each distribution-specific page was pure HTML with a third-party counter at the bottom to monitor interest of visitors. Later the pages were transformed into plain text files with PHP generating all the HTML code, but the original counter remained unchanged. In May 2004 the site switched from publicly viewable third-party counters to internal counters. This was prompted by a continuous abuse of the counters by a handful of undisciplined individuals who had confused DistroWatch with a voting station. The counters are no longer displayed on the individual distributions pages, but all visits (on the main site, as well as on mirrors) are logged. Only one hit per IP address per day is counted.

There are other factors to consider, such as the fact that some of the distributions are Live CD distros and not really platforms meant to be installed. It would be interesting to exclude them and only include installable distros but for lack of time, I didn’t.

I did nothing to verify the accuracy of the data at DistroWatch and any errors you see are not likely mine, as all the data was pulled from DistroWatch, please report any error to them and once they fix these errors, the QlikView report’s data can be reloaded.

Also, this data includes all hits from all areas: Consumer, Enterprise, Education, etc. Unfortunately there is no way I know of to tell where the hits came from. If there is a distribution that is 100% education hits, there would be no way to know that. Obviously if your target is Enterprise, you are left wondering which open source distros are really the most used in Enterprise environments. Unfortunately this report doesn’t answer that question. This is not a report of installed platforms, it is a report of cumulative hits per day. It is what it is.


Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.

Keyboard Shortcuts – To all desktops everywhere, please standardize

Hello world,

I mostly use Windows 7 as a desktop but I often use FreeBSD with KDE, too.

I just submitted this wish to the KDE team.

Bug 221667 – Please make Keyboard shortcuts the same as those used by Microsoft Windows
https://bugs.kde.org/show_bug.cgi?id=221667

If you agree, please Login and vote for this bug. I so want to always use the same keyboard shortcuts no matter which platform I am installed on.

This probably is not just an enhancement request for KDE but for every GUI Operating System everywhere. In fact, let’s make a standard set of Keyboard Shortcuts and have every desktop-like software use the same exact keyboard shortcuts. Maybe someone who is a member could write and RFC and publish it, or does it need to be an IEEE standard?

Anyway…I try not to rant, but today it happened. Sorry.

How to start, stop, restart MySQL on FreeBSD or Red Hat?

FreeBSD

Starting MySQL


/usr/local/etc/rc.d/mysql-server start

Stopping MySQL


/usr/local/etc/rc.d/mysql-server stop

Restarting MySQL


/usr/local/etc/rc.d/mysql-server restart

Red Hat

Starting MySQL


/etc/init.d/mysql start

or


/sbin/service mysql start

Stopping MySQL


/etc/init.d/mysql stop

or


/sbin/service mysql stop

Restarting MySQL


/etc/init.d/mysql restart

or


/sbin/service mysql restart

How to install MySQL on FreeBSD 7.2 or on Red Hat 5.4?

FreeBSD
There are two easy ways on FreeBSD:

From Ports

You can install easily from Ports. Make sure your ports tree is up to date:

$ su

Password:

ServerName#

ServerName#

ServerName#

portsnap fetch

portsnap extract

portsnap udpate

Then just do this to install MySQL on FreeBSD.

ServerName#

ServerName#

cd /usr/ports/databases/mysql51-server

make install

Or if you want to use utf8 by default, run this command:

ServerName# make WITH_CHARSET=utf8 install

MySQL 5.1 Server (and MySQL 5.1 client) will download, compile, and install automagically for you.

From Packages

You can also install easily as a binary package with this simple command.

ServerName# pkg_add -r mysql51-server

Make sure to secure you MySQL installation.
http://dev.mysql.com/doc/mysql-security-excerpt/5.1/en/default-privileges.html

Red Hat
Using RPM

You have to go to the MySQL site and download the MySQL 5.1 server RPM and install it.
http://dev.mysql.com/downloads/

It does not automatically install the MySQL client, you have to download that as a separate RPM and install it.

Using yum

Since I didn’t have a MySQL license, yum didn’t work, so I don’t know if it can be installed using yum.

Make sure to secure you MySQL installation.
http://dev.mysql.com/doc/mysql-security-excerpt/5.1/en/default-privileges.html


Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.

How to create a UTF-8 Unicode Database on MySQL and make UTF-8 Unicode the default?

How to create a UTF-8 Unicode Database on MySQL?

I am not going to cover installing, I have done that here:
How to install MySQL on FreeBSD 7.2 or on Red Hat 5.4?

So when you open MySQL using the command line MySQL client, you can see what Character Set your server is configured to use with this command:

show variables like 'character_set_server';

Often the default is Latin-1. I wish UTF-8 was the default but it is not.

You can see the language your database is created with by using this command:

show create database dbname

Again, usually the default is Latin-1 and again, I wish the default were UTF-8 but it is not.

So how do I make my MySQL database UTF-8?
How do I make UTF-8 the default?

I am going to find out…

Ok, so I have MySQL installed on two different platforms:
FreeBSD 7.2 x64.
Red Hat 5.4 x64.

My question are these:
What level do you set the Unicode setting at? Install instance, database, or column type.

MySQL – Looks like it can be configured globally in the my.cnf or it can be database specific.

To configure globally

Add the following to the my.cnf file:

[mysqld]
init_connect=’SET collation_connection = utf8_general_ci’
init_connect=’SET NAMES utf8′
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake

Note: There are other options for collation besides utf8_general_ci such as utf8_unicode_ci. See this article:
http://dev.mysql.com/doc/refman/5.1/en/charset-unicode-sets.html

Do I have to create the database in a special way?

Not if you configure the setting globally. However, if you don’t configure unicode support globally then yes you have to create your database in a specific way.

I found this post that is for an applications that uses a MySQL Unicode database. I don’t care about the application, just the MySQL data.
http://dev.mysql.com/doc/refman/5.1/en/create-database.html
http://dev.mysql.com/doc/refman/5.1/en/charset-applications.html

So the syntax will be:

CREATE DATABASE mydb   DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

Do I have to compile differently to get unicode support?

I didn’t have to recompile on either FreeBSD or Red Hat.

Is there differences for each platform?

Slight differences.

FreeBSD

FreeBSD has the MySQL client as a dependency so it gets installed with the server with out any extra work.

The Database folder is /var/db/mysql.

For the global configuration there is not a my.cnf file created by default.

FreeBSD has example my.cnf files located here:

/usr/local/share/mysql
/usr/local/share/mysql/my-huge.cnf
/usr/local/share/mysql/my-innodb-heavy-4G.cnf
/usr/local/share/mysql/my-large.cnf
/usr/local/share/mysql/my-medium.cnf
/usr/local/share/mysql/my-small.cnf

You can create your own my.cnf or you can copy one of the examples.

In order to get the my.cnf to work, you should copy it and change the owner and add the [mysqld] settings.

#
#
#
?
?
?
?
?
?
?
?
#
cp /usr/local/share/mysql/my-medium.cnf /var/db/mysql/my.cnf
chown mysql:mysql /var/db/mysql/my.cnf
cat << EOF >> /var/db/mysql/my.cnf
[mysqld]
init_connect=’SET collation_connection = utf8_general_ci’
init_connect=’SET NAMES utf8′
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake
EOF

Red Hat

Red Hat does not have the MySQL client installed with the server, you have to download a separate RPM and install it. But it is really easy. Download both RPMs and install them.

The Database folder is /var/lib/mysql.

For the global configuration there is not a my.cnf file created by default.

Red Hat has example my.cnf files located here:

/usr/share/mysql
/usr/share/mysql/my-huge.cnf
/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-large.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-small.cnf

Same as FreeBSD, there isn’t one used by default and you have to copy one and use it.
You can create your own my.cnf or you can copy one of the examples.

In order to get the my.cnf to work, you should copy it and change the owner and add the [mysqld] settings.

#
#
#
?
?
?
?
?
?
?
?
#
cp /usr/share/mysql/my-medium.cnf /var/lib/mysql/my.cnf
chown mysql:mysql /var/lib/mysql/my.cnf
cat << EOF >> /var/lib/mysql/my.cnf
[mysqld]
init_connect=’SET collation_connection = utf8_general_ci’
init_connect=’SET NAMES utf8′
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake
EOF

Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.