Linux Blog

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.

sl the BOFH’s revenge for bad typists

Filed under: Linux Software — TheLinuxBlog.com at 9:57 am on Wednesday, November 19, 2008

If you don’t know what BOFH is, then lets try wikipedia. This morning in my feed reader from tips4linux.com was an article that “makes you pay attention.”

Basically, the article software package they were recommending today is sl. I couldn’t resist commenting on this. There are many times that I am stuck over a slow SSH session, all I need is the server admin, or BOFH coming along, installing sl and making my life a pain.

So, I installed it on my desktop. What an excellent piece of software. If you run Fedora its in the yum repos and you should give it a shot. Now, all I have to do is symlink this to other useful binaries that I commonly mistype, don’t have installed and for good operator measures, some that I do.

Its too bad that I couldn’t run this through wall, but I guess I could run it as a cron. I think it should have a config file so that you could work it a bit more. Perhaps as it steams through make the smoke spell a message. Any way, thats my ranting and rambling over for the morning. Now to yum remove.

Using a custom Tomcat on Fedora

Filed under: Quick Linux Tutorials — TheLinuxBlog.com at 10:22 am on Wednesday, November 12, 2008

So, I hear you need to use Tomcat on Fedora eh? Not happy with the available Tomcat version from the repository? Well my friends you can add a custom Tomcat to Fedora and have it run as a service.

This post is somewhat related to: my Adding a service on Fedora post except this one is more specific to Tomcat. If you’d like more information on adding services to Fedora that is the place to look.

Here is the script that I have been using: (Read on …)

Getting a Hand With Bash

Filed under: General Linux — TheLinuxBlog.com at 8:27 am on Wednesday, October 1, 2008

If you use the bash shell, or as many know it the terminal on a regular basis then there is a package that you can install that will make your life a whole lot easier. Firstly I’ll tell you a little bit more about it.
When I first started using Linux a friend told me to install this package. I never really understood what it exactly did, but using the terminal was a whole lot easier then using the command prompt in Windows. I couldn’t explain it but things just worked. Features that were missing from Dos were there. There was awesome auto completion that knew what I wanted to type. Over the years I became more accustomed to using Linux and the Bash shell. I upgraded hardware, changed distributions and never really noticed what I was missing out on. The other day I was thinking, wouldn’t it be nice if I could press tab and this would auto complete. Then it hit me, the package my friend had told me to install when I first was starting out. The package happened to be exactly for this purpose. Since I was a novice and he was helping me out I didn’t really have the time to ask about the details of every single package, so here I am now letting you in on a little secret. (Read on …)

Charting your boot processes with bootchart

Filed under: Linux Software,Quick Linux Tutorials — TheLinuxBlog.com at 4:57 pm on Monday, September 22, 2008

Linux users often like to boast about their awesome bootup times. I thought that there was nothing cooler than getting a wicked fast bootup time, until now. A while back I found this nifty application called bootchart and shoved it in my bookmarks. I was randomly surfing my bookmarks, came across it again and gave it another shot. (Read on …)

Are You Funding Open Source?

Filed under: General Linux — TheLinuxBlog.com at 8:24 am on Friday, August 29, 2008

I was using a piece of software that I had heard about a while back that manages collections. Its called Tellico and is actually quite good. While using Tellico I discovered that when you click on the “Amazon link” for the product, it has an affiliate code in it.

For those of you who don’t know what an affiliate program is, its basically a way for people to make money just by refering people to products. Most of the big guys have these sorts of “programs” including Amazon. Affiliate programs are very popular in the triple X industry.

What frustrates me is that this is included in Tellico, so in effect when you visit a product from your own personal collection, Tellico gets a percentage of sales from Amazon for any other items you purchase. While the affiliate link doesn’t bother me so much as it can be changed (and I also participate in the program), its the fact that it came right out of the Fedora repositories like this.

What about if Ubuntu reworked its software and included affiliate links for everything? Perhaps a FireFox plugin that manipulated all Amazon requests to include Mandriva’s affiliate link. I think that this is against Amazons terms of service but this method is a potential way for open source developers and organizations to get some additional funding. But is it right? Preying on your end users ignorance for profit? Although it doesn’t harm anything is it moral?

Post Source: http://www.TheLinuxBlog.com

Changing Window Manager on Fedora

Filed under: General Linux,Linux Software,Quick Linux Tutorials — TheLinuxBlog.com at 8:34 am on Monday, August 18, 2008

TheLinuxBlog.com was intended to be a blog where I could log my thoughts, findings and generally keep track of how to do stuff. Since it was started this is still the goal. Ultimately I’d like to refer to TheLinuxBlog on how to do something just as much as I refer to google for everything else. That being said, one thing that recently came up for me was “How do I change my desktop on Fedora”.

I had done this before but I couldn’t remember the command to do so. Well, since this blog is as much for me as it is for the reader I figure I can post the how to here and kill two birds out with one blog post, I mean stone.

The program I use to change my window manager on Fedora is: switchdesk.

Switchdesk can be installed by Yum or if you installed Fedora from DVD or CD and didn’t fine tune your packages then you probably have it already. All you have to do to run it is type:

switchdesk

Now, if you are in an X session you will get a nice graphical dialog that will help you change your desktop manager. If your at the terminal it will exit and ask you nicely to type either gnome, kde, xfce or any other window manager you may have installed.

Don’t ask me why every distribution has a different named command and interface to achieve the same thing thats just the way it is. Maybe one day I’ll get a list of all of the commands and post them. Alternatively if anyone wants to start a list feel free to post them in comments or by e-mail.

Yakuake – The Nifty Terminal

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 12:47 pm on Friday, July 25, 2008

Yakuake – “Pronunciation Key: yuh-kweyk”

Yakuake is a terminal emulator for KDE
“Why do we need another terminal emulator?”
I hear you ask.

Well, the Yakuake terminal emulator resembles the terminal from Quake (hence the name), except the only thing that gets owned when you run Yakuake is your to-do list.

Have you ever been fragged in Quake because you hit the Tilda key by accident?
Ever used this to your advantage while playing two player by pressing your opponents tilda key?

Have no idea what I’m talking about?
envision a terminal that magically pops up when you press a shortcut, hides when your not using it but retains the output / processes and does not show up in the task bar.

Sure there are old school ways of achieving the same thing, but Yakuake is convenient. It is based on Kommander so its highly configurable and customizable but it works right out of the package.

I use it on most of my machines and for quick tasks I find myself using a regular xterm less. If you want a quick easy access to a terminal I’d recommend trying Yakuake out, take a look at all of the keyboard shortcuts and see if there is any way you can make it work better for you.

I have my keyboard shortcuts set up so I can add new sessions, close sessions, rename sessions, move sessions and resize the terminal. It works great with the switch to session shortcuts that I also set up.

Its in the Fedora repositories, I’m sure its included in Debians 18,000 or so packages and probably Gentoo’s too, so give it a shot!

I’ll see what I can do about a video tutorial in the future to demonstrate the power of Yakuake.

Adding a service in Fedora

Filed under: Shell Script Sundays — TheLinuxBlog.com at 2:08 pm on Sunday, July 6, 2008

This week on Shell Script Sundays I’ll show you how to add a service to Fedora. This is very useful if you don’t happen to use yum for every service you want to run, and xinetd doesn’t really work for you.

Firstly there are three main parts to a Fedora service script. Start, Stop and Restart. They are pretty much self explanatory, but you don’t have to worry about the restart action since all it does is stop’s and then starts the service.

Without further ado here is the script:

#!/bin/bash
#
# Fedora-Service Update notification daemon
#
# Author:       TheLinuxBlog.com
#
# chkconfig:    1000 50 50
#
# description:  This is a test Fedora Service \
#               Second line of the fedora service template.
# processname:  FedoraTemplate
#
RETVAL=0;

start() {
echo “Starting Fedora-Service”
}

stop() {
echo “Stopping Fedora-Service”
}

restart() {
stop
start
}

case “$1″ in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $”Usage: $0 {start|stop|restart}”
exit 1
esac

exit $RETVAL

Now that you have a template for the script, you will want to modify it for your service. You need to keep the header at the top. This is how the Fedora Knows about your service. The three numbers indicate what order the scripts should start up and shut down in. The first seems to be a identification number and the other two are the startup and shutdown order. These can be adjusted depending on when you want the service to start up.Once you are done modifying the script put the script in /etc/init.d/

To make sure it works you can call it with service using the following actions:

service start
service stop
service restart

If all of the actions work, you are ready to add the service to the system. If you use the setup command as root it seems to do this step for you, but if you just want to add the service quickly without bothering to scramble through configuration menu’s you can do the following:

chkconfig –add <script name>

If you want the service to start automatically at boot up you can use ntsysv. For more information read my post on Managing Services on Fedora

Managing Services on Fedora

Filed under: Linux Software — TheLinuxBlog.com at 12:01 am on Wednesday, July 2, 2008

Fedora is a great desktop system, it has a pretty good services manager called service. It can be used to turn on, off and restart most services that run on the system. Should you want to manage running services all you have to do is type:

service <service name> <stop | start | restart>

If you don’t know the service name it can normally be found by issuing the –status-all switch. Doing so will output a long list of services so you may want to grep it or use a pager such as less:

[root@linux-blog ~]# service –status-all | less

[root@linux-blog ~]# service –status-all | grep snmp
capi not installed – No such file or directory (2)
JAVA_EXECUTABLE or HSQLDB_JAR_PATH in ‘/etc/sysconfig/hsqldb’ is set to a non-file.
snmpd is stopped
snmptrapd is stopped

While service is a great utility to manage services it does not stop them from running at startup. To manage services that start up when you boot you can use a handy little dialog script called “ntsysv”:

[root@linux-blog ~]# ntsysv

This will give you a nice dialog which is intuitive and similar to those of text based installers. Select the services you want to start up and then tab over to OK. I turn a lot of services off that I don’t use, if you’re unsure of what you need, try stopping it with the services command first and see if anything breaks. If after test it works well just turn it off.

Since I don’t use SELinux on my development machine, I always turn off setroubleshootd. I used ntsysv to stop it from starting at bootup and if I need it I can use the service command to start it.

Here is a screenshot of ntsysv in action:

managing services with ntsysv on Fedora

Apache “Directory index forbidden by Options directive:”

Filed under: Quick Linux Tutorials — TheLinuxBlog.com at 9:29 pm on Friday, June 27, 2008

This is a common problem with the Apache web server. It is considered a security risk to show the directory contents by default. Especially those in the root directory. The way to fix this is pretty simple, you first need to make sure that there are no -Index directives in any of the configuration files. In your httpd configuration directory grep with a line number for Options like so:

grep -n Options *

If you don’t see any -Indexes then its possible there are included files. Check these directories if you know them, if you don’t grep your configuration file for the Includes:

grep -n Include *

If you’re still getting the test page or a permission denied error after removing the directive that disables Indexes then it may be a permissions issue. Apache needs +x access for all users to enable directory listings. Change the permissions and it should work.

On Fedora there is a file called welcome.conf in the conf.d directory. This can be removed and if you have Options All set, then you should be good to go. On other distributions like Slackware it is easier to accomplish. I wouldn’t recommend allowing any sort of directory listing in a production environment but in my development case, where I only allow access to my test server on a per host basis this is not a big problem.

Also, remember to restart the server after making changes.

Hope this helps, if it doesn’t be sure to drop a comment!

« Previous PageNext Page »