September 2010
M T W T F S S
« Aug    
 12345
6789101112
13141516171819
20212223242526
27282930  
99

Categories

Archives

[one-liner]: Firefox Already Running Dialog Box on Fedora/CentOS/RHEL

Problem

Sometimes you’ll get a dialog box that pops up saying that firefox is already running when you know in fact that it isn’t.

Firefox Already Running Dialog Box

Firefox Already Running Dialog Box

Solution

This is typically caused by the existence of 2 files in your ~/.mozilla/firefox/<profile> directory. For example in my case:

1
2
3
% ls -la ~/.mozilla/firefox/rhwevaqa.default/|egrep "lock |lock$"
lrwxrwxrwx  1 tstacct users       16 2010-06-22 18:49 lock -> 127.0.1.1:+11131
-rw-r--r--  1 tstacct users        0 2010-06-22 18:49 .parentlock

Just delete these 2 files and firefox should start right up.

References

For more info about Firefox startup issues check out this mozilla FAQ

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

[one-liner]: Using Yum to Download RPMs under Fedora, CentOS, and RHEL

Background

From time to time I’ve run into an RPM that won’t install via yum. These usually pop up because I’ve mixed packages in from a 3rd party repository, and the 3rd party package has some overlapping files with an already installed RPM.

Problem

Here’s an example that happened to me recently on a Fedora 10 system where I was trying to install some pulseaudio related packages.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
% yum install xmms-pulse xine-lib-pulseaudio
Package xmms-pulse-0.9.4-6.fc10.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package xine-lib-pulseaudio.i386 0:1.1.16.3-2.fc10 set to be updated
--> Processing Dependency: xine-lib = 1.1.16.3-2.fc10 for package: xine-lib-pulseaudio-1.1.16.3-2.fc10.i386
--> Finished Dependency Resolution
xine-lib-pulseaudio-1.1.16.3-2.fc10.i386 from updates has depsolving problems
  --> Missing Dependency: xine-lib = 1.1.16.3-2.fc10 is needed by package xine-lib-pulseaudio-1.1.16.3-2.fc10.i386 (updates)
Error: Missing Dependency: xine-lib = 1.1.16.3-2.fc10 is needed by package xine-lib-pulseaudio-1.1.16.3-2.fc10.i386 (updates)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest

Solution

If you’re confident that this is a “false positive” type of error you can force your way around it like so. First download the RPM using the never mentioned command yumdownloader.

NOTE: yumdownloader is part of the yum-utils package.

1
% yumdownloader xine-lib-pulseaudio

Next try to install/upgrade the package.

1
2
3
% rpm -Uvh --nodeps xine-lib-pulseaudio-1.1.16.3-2.fc10.i386.rpm 
Preparing...                ########################################### [100%]
	file /usr/lib/xine/plugins/1.26/xineplug_ao_out_pulseaudio.so from install of xine-lib-pulseaudio-1.1.16.3-2.fc10.i386 conflicts with file from package xine-lib-1.1.16.3-18.fc10.i386

This is what I would consider a bogus error. For whatever reason, both RPMs share the same file, so let’s just install it already by doing a forced installation of the RPM.

1
2
3
 % rpm -Uvh --force --nodeps xine-lib-pulseaudio-1.1.16.3-2.fc10.i386.rpm 
Preparing...                ########################################### [100%]
   1:xine-lib-pulseaudio    ########################################### [100%]

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

Syslog Message Levels

I can never find these clearly defined in any man page so I’m putting them here the next time I need them.

The list of syslog severity Levels

0Emergency – system is unusable
1Alert – action must be taken immediately
2Critical – critical conditions
3Error – error conditions
4Warning – warning conditions
5Notice – normal but significant condition
6Informational – informational messages
7Debug – debug-level messages

Recommended practice is to use the Notice or Informational level for normal messages.

A detailed explanation of the severity Levels

DEBUG:
Info useful to developers for debugging the application, not useful during operations

INFORMATIONAL:
Normal operational messages – may be harvested for reporting, measuring throughput, etc – no action required

NOTICE:
Events that are unusual but not error conditions – might be summarized in an email to developers or admins to spot potential problems – no immediate action required

WARNING:
Warning messages – not an error, but indication that an error will occur if action is not taken, e.g. file system 85% full – each item must be resolved within a given time

ERROR:
Non-urgent failures – these should be relayed to developers or admins; each item must be resolved within a given time

ALERT:
Should be corrected immediately – notify staff who can fix the problem – example is loss of backup ISP connection

CRITICAL:
Should be corrected immediately, but indicates failure in a primary system – fix CRITICAL problems before ALERT - example is loss of primary ISP connection

EMERGENCY:
A “panic” condition – notify all tech staff on call? (earthquake? tornado?) – affects multiple apps/servers/sites…

Useful Links

[one-liner]: Analyzing a System's BIOS from the Commandline under Fedora 10

Background

A system’s BIOS is a treasure trove of a lot of useful info about the capabilities of a computer. BIOS, which stands for Basic Input/Output System, contains information such as:

  • motherboard manufacturer
  • system’s serial number
  • amount of RAM installed
  • the CPUs speed & signature

Normally the BIOS is accessible by pressing the delete key or the F1 key while your computer is booting up.

Problem

Occasionally I’ve wanted to check out the BIOS settings of a system without having to go through the hassle of rebooting. With the help of this nifty command line tool, dmidecode, BIOS info can be had, without having to reboot.

Solution

…from the dmidecode man page

dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Thanks to this table, you can retrieve this information without having to probe for the actual hardware. While this is a good point in terms of report speed and safeness, this also makes the presented information possibly unreliable.

The DMI table doesn’t only describe what the system is currently made of, it also can report the possible evolutions (such as the fastest supported CPU or the maximal amount of memory supported).

SMBIOS stands for System Management BIOS, while DMI stands for Desktop Management Interface. Both standards are tightly related and developed by the DMTF (Desktop Manage- ment Task Force).

Example output from a Thinkpad T42 laptop

When you first run the dmidecode command it tells you a summary of how many structures are present within your system’s BIOS.

1
2
3
4
5
% dmidecode 
# dmidecode 2.9
SMBIOS 2.33 present.
61 structures occupying 2126 bytes.
Table at 0x000E0010.

Each structure is represented by a handle ID which is a hex value of the form 0x001F, followed by it’s type and it’s size.


…. Continue reading → [one-liner]: Analyzing a System’s BIOS from the Command Line under Fedora, CentOS, or RHEL »»

Fixing Ruby Support in Vim on Fedora 10, 11, and CentOS 5 & Installing the Vim Textile plugin

Background

A while back I was trying to get the vim textile plugin installed and ran into a problem. Apparently the vim that’s included with Fedora 10, 11, and CentOS 5 doesn’t include ruby support. This bug report explains what’s wrong with vim and how it’s missing ruby support. The problem is visible with this command:

1
2
3
4
% vim --version | grep ruby
+printer +profile +python +quickfix +reltime +rightleft -ruby +scrollbind 
...
...

The –ruby tells us that ruby support isn’t enabled. The only solution I’ve seen thus far is to rebuild vim. Not really a huge deal but it’s work non the less 8-).

Rebuilding vim with ruby support

Here’s how I fixed it.

download vim Source RPM (SRPM)

1
% wget http://mirrors.xmission.com/fedora/updates/10/SRPMS/vim-7.2.148-1.fc10.src.rpm

confirm that ruby is installed

1
2
3
4
5
6
% yum list installed ruby*|column -t|grep ruby
ruby.i386        1.8.6.287-2.fc10  installed
ruby-devel.i386  1.8.6.287-2.fc10  installed
ruby-irb.i386    1.8.6.287-2.fc10  installed
ruby-libs.i386   1.8.6.287-2.fc10  installed
ruby-rdoc.i386   1.8.6.287-2.fc10  installed

make sure you have your own rpmbuild directory

1
2
3
4
% mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
 
# caution with this second command if you already have your own .rpmmacros, this will overwrite!
% echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros

rebuild vim / re-install vim

1
2
rpmbuild --rebuild vim-7.2.148-1.fc10.src.rpm
rpm --force -Uvh /root/rpmbuild/RPMS/i386/vim-{c,e,m,X}*

check that vim now has ruby support

1
2
3
4
% vim --version | grep ruby
+printer +profile +python +quickfix +reltime +rightleft +ruby +scrollbind 
...
...

Ahh. a +ruby means it worked.

Textile Plugin for vim

Now onto installing the vim textile plugin.

First things first, we need to install rubygems

1
% yum install rubygems

Next we need to install the RedCloth gem, it’s required by the textile plugin

1
2
3
4
5
6
% gem install RedCloth
Building native extensions.  This could take a while...
Successfully installed RedCloth-4.2.2
1 gem installed
Installing ri documentation for RedCloth-4.2.2...
Installing RDoc documentation for RedCloth-4.2.2...

Finally, install the textile plugin

Downloading the textile plugin from here,


…. Continue reading → Fixing Ruby Support in Vim on Fedora 10, 11, and CentOS 5 & Installing the Vim Textile plugin »»

[one-liner]: Shell Builtins

Background

I recently worked a problem in a previous post where it wasn’t clear which version of the command nohup was getting used. The version that was built into the C-shell interpreter, or the executable sitting under /usr/bin/nohup. This brought up an interesting point, how do you know what commands are builtins to the shell itself?

Enter the commands: builtins and enable

These are 2 commands that I’d never even heard of until I started doing research for this post. They both basically do the same thing. They show you all the builtin commands for a particular shell, builtins for C-shell, and enable for Bourne Shell.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# C-shell builtins
 
#NOTE: run this command within a C-shell (aka. csh or tcsh)
% csh
 
% builtins
:          @          alias      alloc      bg         bindkey    break
breaksw    builtins   case       cd         chdir      complete   continue
default    dirs       echo       echotc     else       end        endif
endsw      eval       exec       exit       fg         filetest   foreach
glob       goto       hashstat   history    hup        if         jobs
kill       limit      log        login      logout     ls-F       nice
nohup      notify     onintr     popd       printenv   pushd      rehash
repeat     sched      set        setenv     settc      setty      shift
source     stop       suspend    switch     telltc     termname   time
umask      unalias    uncomplete unhash     unlimit    unset      unsetenv
wait       where      which      while
1
2
3
4
5
6
7
# Bourne Again Shell builtins
 
#NOTE: run this command within Bourne Again Shell (aka. bash)
% bash
 
% enable | cut -d" " -f2 | sed -e :a -e '$!N;s/\n/ /;ta'
. : [ alias bg bind break builtin caller cd command compgen complete continue declare dirs disown echo enable eval exec exit export false fc fg getopts hash help history jobs kill let local logout popd printf pushd pwd read readonly return set shift shopt source suspend test times trap true type typeset ulimit umask unalias unset wait

NOTE: The command is enable. I’m simply running the output of enable through this cut & sed filter so that the output of enable is more concise for this example.

nohup

As you can see, by looking at the output from builtins, the command nohup is listed there, which means that C-shell has it’s own implementation of nohup. Looking at the output from enable, you can see that Bourne Shell, doesn’t include it’s own builtin for nohup, so it would use /usr/bin/nohup. Pretty simple, eh?

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

Page 1 of 3123