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.

Broken Arrow Keys during an Ubuntu 9.04 install on Vmware Server 1.X

Background

Recently I was trying to create a Ubuntu 9.04 vmware image using Vmware Server 1.08, but I was doing it remotely from my Fedora 10 laptop which was running Vmware Server 1.06. This can normally be done by using Vmware Server’s ability to remotely connect to other Vmware Servers.

VMware Server Console

Here’s my work flow. NOTE: Ubuntu 9.04 will be running on the vmware server on CentOS 5.4.

VMware Workflow

Problem

While going through the setup I encountered a problem I hadn’t seen before where the arrow keys didn’t appear to be working within GRUB while I was installing Ubuntu 9.04.

broken arrow keys

Solution

Turns out there is an option you can enable (i.e. set to TRUE) in the $HOME/.vmware/preferences file which fixes this.

1
xkeymap.nokeycodeMap = "TRUE"

NOTE: This change was made to the Vmware Server that was running on the Fedora 10 box.


…. Continue reading → Broken Arrow Keys during an Ubuntu 9.04 install on Vmware Server 1.X »»

[one-liner]: How to Use the Bash Shell’s export Command

Problem

Recently at my day job I’ve been having to go through some pretty old Bash scripts that I’ve basically inherited. As I’ve been going through them I’ve been seeing a lot of confusion as to the proper use of Bash’s export command. The major offense? Not really understand whether a particular variables needs to be exported, or not. So I thought I’d take a moment just to clarify when and when not to use export.

The export command has really only one true purpose. To mark and/or unmark variables (and functions) that you want to have automatically exported to environments of subsequently executed commands. So if you create a script that calls other commands, and you want to push variables into the environment of these commands, then you’ll want to use export.

Example #1 (without export)

For example, let’s say we have the following 2 scripts:

1
2
3
4
5
6
7
#!/bin/bash
# script #1: parent.bash
 
var1="this was set by the parent shell script"
echo "inside $0 script: $var1"
 
./child.bash
1
2
3
4
#!/bin/bash
# script #2: child.bash
 
echo "inside $0 script: $var1"

And when I run the script parent.bash I get this output:

1
2
3
4
5
# output from parent.bash & child.bash (without export)
 
% ./parent.bash
inside ./parent.bash script: this was set by the parent shell script
inside ./child.bash script:

Notice how the variable $var1, which was set in the parent.bash script, didn’t get displayed by the child.bash script? Now watch this example with the variable $var1 exported in the parent.bash script.

Example #2 (with export)

1
2
3
4
5
6
7
#!/bin/bash
# script #1: parent.bash
 
export var1="this was set by the parent shell script"
echo "inside $0 script: $var1"
 
./child.bash
1
2
3
4
#!/bin/bash
# script #2: child.bash
 
echo "inside $0 script: $var1"

And when we run parent.bash

1
2
3
4
5
# output from parent.bash & child.bash (with export)
 
% ./parent.bash
inside ./parent.bash script: this was set my the parent shell script
inside ./child.bash script: this was set my the parent shell script

Example #3 (un-exporting)

Export isn’t just a one trick pony. It can also unmark a previously exported variable.


…. Continue reading → [one-liner]: How to Use the Bash Shell’s export Command »»

Page 1 of 712345...Last »