Linux Blog

A Manpage Template for your Scripts

Filed under: Shell Script Sundays — TheLinuxBlog.com at 11:44 am on Sunday, June 21, 2009

So, you just finished that killer script and the first thing you want to do is write that man page for it right? Not exactly? What do you mean?
Writing a man page isn’t that hard and will give your users an idea of how to use a script.

Here is a basic template for creating your own man pages:

.\” This is a comment
.\” Contact Owen@thelinuxblog.com
.TH man 1 “21 June 2009″ “.1″ “Man Page Example”
.SH NAME
Man \- Example Man Page
.SH SYNOPSIS
Example Man Page
.SH DESCRIPTION
This is an example of a man page.
.SH OPTIONS
No options for this man page
.SH SEE ALSO
man(1), groff(1), man.config(5)
.SH BUGS
No known bugs for this template, except you might want to replace the quotes if you copy from my blog.
.SH AUTHOR
Owen (owen@thelinuxblog.com)

When you’re done with the gruelling task of writing documentation (which your users won’t read or thank you for) just plop it the correct man section in /usr/share/man
That’s all there is to it!

Throw a rave when you work too hard

Filed under: Linux Software — TheLinuxBlog.com at 7:36 pm on Wednesday, December 3, 2008

Workrave

Workrave is an awesome little utility that I just found out about almost a week ago now. Basically what it does is sits in your tray and bugs you when you should take breaks. Its really simple to use, and is in the Fedora repositories. Since, my Open SUSE laptop is at home and off, I can’t tell you if it is in there but my guess is that Debian / Ubuntu also have this package. Once you’ve got it installed by whatever means possible, run it. Its very easy to use, but I would advise setting up your defaults. If you don’t you’ll be taking a short rest break once every 3 minutes, which I find to be a bit excessive. You also get rest breaks, which advise you to stand up and walk around, and do stretches. It has some great statistics such as how many keystrokes you make, how many breaks you’ve taken. It also accounts for “natural” rest breaks, so if there is no activity on your computer, it thinks you are idle. Although I have not tried it there is network support for Workrave. Perhaps one day I will try it. If you spend a long time in front of the computer at home or work (like I’m doing today) then this may be the application for you, especially if you are trying to avoid doing work. getting fatigued. Talking of work, I had better get back to what I was doing; oh yea, taking a break.

Advanced Bash-Scripting Guide

Filed under: Shell Script Sundays — TheLinuxBlog.com at 2:38 pm on Monday, November 24, 2008

Today the Advanced Bash-Scripting guide has been updated: http://www.tldp.org/LDP/abs/html/

Changelog: “Many bugs were fixed. Additionally, there is a great deal of new material. Editing was done for increased consistency. Two new example scripts were added.”

This is not a book that everyone will want to read, but for those wanting to know more about scripting or those with bash scripting knowledge its a must. Its available in a couple of formats for your reading pleasure.

Big Box Chain Store Offers Linux Support?

Filed under: General Linux — TheLinuxBlog.com at 5:35 am on Saturday, January 19, 2008

I have a friend who works for a major big box store chain in the computer support department. I’m not going to say who, but they drive black and white bugs around and are known as geeks. Anyhow, thats besides the point. While talking the other day he said that he had got a phone call from one of the various departments and they asked if there was any one at the store that knew anything about Ubuntu Linux.

Now, I’ve seen this companies ads pop up on Linux related websites before and even on mine, but in store they do not offer any type of support. They even say on their website that the tools they use do not support Linux.

So what were they doing calling each retail store and asking for a Linux expert? They don’t train any one for Linux support would they expect to find anyone? I think they may be trying to sell hardware installation services, but when a customer complains that a piece of hardware doesn’t work they have to troubleshoot it. If they can’t troubleshoot it or verify that it works how is the service complete? I don’t  know if thats the case, I’m going to try to pick his brain some more and see what we can come up with.

Who knows, you may be looking at this companies ad right now and not even know it.

Ubuntu & Gentoo Servers compromised

Filed under: General Linux — TheLinuxBlog.com at 11:00 pm on Wednesday, August 15, 2007

The case of the Ubuntu servers being breached [wiki.ubuntu.com]
Missing security updates and system administrators not running updates on servers is a problem. I don’t know why they didn’t do any updates past Breezy. They suggest that it was because of problems with network cards and later kernels but I don’t get it. Since when do software updates for an operating system have anything to do with what kernel is running? If there is a problem with hardware support for the network card you have two choices. The first is to fix the driver yourself or pay some one to do it. The second is to replace the network card to a better supported device. Both situations could be costly but it would get the problem fixed and five of the servers wouldn’t have been taken down at the same time.
If the kernels were configured correctly, the boxes probably wouldn’t of even had to have been rebooted.
Running FTP instead of a more secure version is not so bad unless they were running accounts with higher privileges than guest or using system accounts. In which case thats just stupid.

The Gentoo Situation [bugs.gentoo.org]
Apparently there is a problem in the packages.gentoo.org script. The bugzilla article goes into deeper explanation but basically there is some pretty unsafe code which could have allowed any one to run any command. I understand that the code is old but it probably should have been audited at some point. The problem would have stuck out like a soar thumb if looked at by a python coder and they probably would have fixed it, or at least suggested a fix. The problem was found on Tuesday the 7th. All of the infra- (I assume they mean infrastructure?) guys were at a conference last week so they couldn’t work on it. It still seems that if they were at the conference until midnight on the 12th they would still have been able to put up a coming back soon placeholder on the packages site by now. Hey, if they put some pay per click ads up there maybe they will get some additional funds during the down time. I would like to see what products would be pushed thru the advertising on that one. I believe that they could have reduced the downtime by releasing the code for the packages.gentoo.org site as open source or by asking for help from developers to review and upgrade the code as needed.

Its not strange for web servers get hacked. They get hacked all the time but who’s fault is it in the open source community? I really think that there is a problem in the community when it comes to situations like this but the blame can’t be placed on any one person. I would offer any assistance I could into getting these situations resolved but its not as easy as that. There has to be a certain level of trust for those working within a project. If they gave out keys to their servers to anyone the servers probably would have been compromised a long time ago. I hope that the affected sites can pull them selfs together and get back up and running as normal. It seems that Ubuntu did not have complete down time, but the Gentoo site is still down and there is no indication of when it will be back up.

Recent changes to The Linux Blog.

Filed under: The Linux Blog News — TheLinuxBlog.com at 10:39 pm on Sunday, July 29, 2007

This article is mostly just updates on the site.

Server Changes
I have recently moved the site to a new server. This was a fairly simple task which took longer than it should because of DNS issues.

Now that it is on the new Linux based web host all should be dandy. The fact that I have more flexibility over the old host is an added bonus.

Bugs

Some problems that surfaced after I moved the site have just been resolved in a matter of minutes ago.

The biggest problem the site had was that the detailed/archive WordPress URL’s were not getting processed correctly. I was aware of the problem last night but was too tired to fix it. The fix was simple. I had to place the .htaccess file in the directory. The problem was that when I used lftp to mirror the old code, it didn’t download the hidden .htaccess file. I should have checked this before I updated the DNS but I guess something will always go wrong and I’m glad it was a simple fix. When I figure out how to mirror a directory in lftp including hidden files I will be sure to let everyone know. After scanning the help for the mirror command it didn’t jump out at me, but maybe thats just because I’m tired.
The URL’s that were affected by the bug were:

http://www.thelinuxblog.com/2007/07/29/shell-script-sundays/

http://www.thelinuxblog.com/2007/07/28/phones-meet-linux/

New Category Created
Not only did I fix this little problem, I also created the Shell Script Sundays section and moved the related posts to that category. The When Photoshop Fails article was posted on a Monday but I did most of the writing on Sunday, so I believe that since its mostly a shell scripting article it is worthy of this category.

After writing a paragraph in the description section of WordPress, I realized that it doesn’t actually show up anywhere on the site. I’m unsure if it shows up in the RSS feeds or not but I’m going to post it here anyway for the web browsers.

Shell Script Sundays Description
This section of the site is dedicated to Linux shell scripts. Twice a month I will post a nifty shell script that will perform a certain task. Most of the scripts will be written in Bash or the Korn shell and occasionally a CLI PHP or Perl script may surface. Some scripts will be more advanced than others and some will require additional software to be installed. This section will show how powerful scripting can be and I hope it educates people on how to shell script with Linux.

More to come!

Expect a Linux related post within the next few days. I have hundreds of topics to choose from, but I am always willing to take peoples suggestions on what to blog about. So if there is a particular topic that interests you, just contact us and we’ll do our best to cater to your needs.

Ciao,

- Owen.