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]: Getting Rid of Google's Left Sidebar (2nd Attempt)

Problem

In a previous [one-liner] post I mentioned a quick way to get rid of Google’s new Left Sidebar. Here’s a screenshot from that post of the Google sidebar.

Google Left Sidebar

Well as of May 2010 it appears that the Google sidebar is back, and my hack of just deleting the google.com cookies no longer seems to permanently get rid of the sidebar. So now it’s time to bring out a bigger stick … greasemonkey.

Solution

If you haven’t heard of greasemonkey, it’s a plugin to Firefox that allows you to control elements of a page that you are viewing, essentially overriding the design of a given page. You can do things like get rid of sidebars, add your own buttons, etc. I’m not going to get into everything it can do, we’re only interested in getting rid of Google’s sidebar, and with greasemonkey installed it becomes a simple task.

First click this link: greasemonkey plugin to Firefox, and click on the “Add to Firefox” button on that page. Restart Firefox to activate the greasemonkey plugin. Next you’ll want to make use of a greasemonkey “script” that is freely available over on userscripts.org.

NOTE: The userscripts.org website allows users to share useful greasemonkey scripts.

The greasemonkey script you’re looking for is called Toggle Google SideBar. Each “script” on the userscripts.org website has a big install button on their respective pages, so just click that button to install it. Once you’ve done that you’re done.

Now Google search results pages will look like this with the sidebar visible:

Google sidebar open

…and like this when the sidebar is hidden:

Google sidebar closed

Notice the big [+]? This allows you to toggle the Google sidebar if you want to see it.

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

[one-liner]: Getting Rid of Google's Left Sidebar (1st Attempt)

NOTE: Refer to this updated post regarding Google’s left sidebar

Problem

So around 12:30am (4/1/2010) I go to hit google and I’m presented with this left sidebar (see it in the screenshot below). Given it’s April 1st, my first thought went to … its an April fools joke. But after poking at it for a bit longer it seemed legit. So I tried it for like 30 seconds and it sucks. What can I say it’s a waste of space so it had to go.

Google Left Sidebar

Solution

The fix is pretty easy. Basically go into Firefox’s Preferences (Edit -> Preferences), under Linux, and delete the google.com cookies. The cookies are located under the privacy tab of the Preferences dialog.

Firefox Preferences Dialog

Firefox Preferences Dialog

NOTE: Make sure you delete just the google.com cookies.

Cookies Dialog

Cookies Dialog

And with that, Google’s back to normal.

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.

[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 »»

[one-liner]: Previewing a Pretty Printed Text File using enscript & ps2pdf

Background

Before my wife and I had kids we thought it would be nice to collect the United States quarters that were released during 1999 through 2008 to commemorate each of the 50 states. Seemed like something simple to do and would be a nice gift for the kids when they got older. So we bought a couple of the blue books which you can fill up with quarters as you find them. Each book contains 100 slots, 2 for each state. One slot is for the Philadelphia minted version of the quarter, and the other slot is for the Denver mint.

Problem

Well we ended up having 3 kids so we have to collect 300 quarters. The task of finding the quarters has been more of a dad task so when I have a chance, I’ll put a $5 dollar bill in various soda machines at work and go quarter fishing. This approach has been working fairly well and we’ve collected ~130 of the 300 quarters thus far.

However I’ve started getting to the point where I’m netting a lot of duplicates and the job of having to bring them home to weed through them is starting to get old. Having a list of which quarters we already have would sure be nice, so I could quickly nix any duplicates.

Solution

Of course I wanted a low tech solution, i.e. a piece of paper in my wallet would do the job, but how to do it?

The answer? A text file that I could maintain would suffice. No need for a bloated spreadsheet or some fancy handheld app. So I created a file, quarters.txt, like so:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
State           Year  Cnt (P/D)
=====           ====  =========
Alabama         2003  2/1
Alaska          2008  3/1
Arizona         2008  3/0
Arkansas        2003  3/0
California      2005  3/0
Colorado        2006  3/0
Connecticut     1999  3/2
Delaware        1999  0/0
Florida         2004  2/0
Georgia         1999  2/1
Hawaii          2008  3/0
...

It’s about as simple a text file as you can get. 3 columns, State, Year, and Counts. The 3rd column shows how many P and D quarters I have for a given state. So for example, for Alabama, I’ve got 2 Philadelphia minted quarters, and 1 Denver minted.

So you’re probably wondering, “why the hell is this guy writing up this in a blog post?”

We’ll the interesting bit to this low tech solution is how I print this list out. For this task I make use of a pretty powerful UNIX command called enscript, which lets you do all kinds of nifty things to a text file to augment how it looks when it gets printed.

About the only thing enscript doesn’t do for you, is give you the ability to preview your text file prior to printing. To accomplish this bit, I made use of another powerful UNIX command called ps2pdf. This command will take a postscript file (ps) and convert it to a pdf file.

So putting all the pieces together I came up with the following command:

1
enscript --fancy-header -U 4 quarters.txt -o - | ps2pdf - quarters_sm.pdf

The first part of this command, will call enscript instructing it to convert the file quarters.txt, and print it to standard out -o -. The printout will include some fancy headers and enscript will print the text file out in what is called 4 UP. This means that 4 pages will be printed on a single piece of paper. You could also print the page out in 2 UP, 8 UP, etc. It only needs to be a power of 2. BTW, 2 and 4 are the most commonly used, 8 is pretty hard to read.

The second part of this command passes the postscript generated by enscript through a UNIX pipe which gets picked up by ps2pdf, and converts it into a PDF file, quarters_sm.pdf.

From here you can check what the page would look like using your favorite PDF viewer, such as evince or xpdf. Once you’re comfortable with the page you can actually print it out from the PDF reader, or via the command-line.


…. Continue reading → [one-liner]: Previewing a Pretty Printed Text File using enscript & ps2pdf »»

Page 1 of 612345...Last »