Silly trick to get yum to update installed groups

When I upgrade Fedora using yum or PreUpgrade my installed groups don’t really get updated. The packages in those groups get updated and any dependencies get resolved, but packages that have been added to the group in the new version of Fedora don’t get installed. So, after updating Fedora I make sure my installed yum groups are really up to date by running “yum groupinstall ” for the groups I think are important. This time I wanted to do this for all of the groups I have installed so I:

  1. got the list of installed groups using “yum grouplist”
  2. copy-pasted the installed ones into a text editor
  3. search-replaced to get the groups wrapped in quotes with spaces between
  4. pasted that into a “yum groupinstall” command, eventually adding “–skip-broken”

That installed more than 800 packages! There’s probably a shell script out there somewhere to do this automatically.

Network interface renamed in Fedora 15

I was trying to get non-NetworkManager networking running in Fedora 15, but kept failing. When I tried to start the network daemon it failed and something about eth0 missing got logged. Finally, I looked more closely at my dmesg output and noticed that at the end of the network section udev had renamed the interface from eth0 to something like p7p2. Changing my networking script to use that instead fixed it.

No sound with RealTek ALC892

Every now and then my computer’s sound dies and my speakers only produce pops and clicks. I have a Biostar TA880GB+ motherboard with a RealTek ALC892 sound chip. I assumed the fault was with the driver and went on a quest to reinstall all of the audio-related stuff in my Fedora 15 install. Sadly, after much driver reinstalling and audio reconfiguring the speakers were still only emitting pops and clicks. I finally tried powering down the computer (who ever does that?) and now it works. I had rebooted several times – for some reason the system needed to be powered down completely.

Converting a PNG to a PDF

Why I wanted to do this: I got an IRS PDF form from someone. Many of the fields on the form were fillable, but obviously it couldn’t be signed – and the date field also wasn’t fillable. So, I could have just printed it out, completed it, then mailed it, but this is 2010 fergawdsakes! I know that Adobe thoughtfully sells just the tool for the job, but that’s no fun at all.

I knew I could import the PDF into Gimp (converting it into a bitmap) and edit it there, dropping in my signature and whatnot. Next I needed to turn the bitmap back into a PDF. Gimp doesn’t make PDFs, so I saved the bitmap as a high-res PNG and went looking for something to convert a PNG into a PDF.

ImageMagick should have immediately occurred to me, but I needed Google to connect the dots. Here’s the command I figured out after some trial-and-error:

convert -page Letter -density 28.3 input.png output.pdf

Note that the 28.3 part was specific to the resolution of my PNG. Using other values, when I checked the PDF’s properties the dimensions weren’t 8.5×11 – so I just tried numbers until I got close enough. I’d imagine there’s an automated way to do the calculation, but for just one PDF trial-and-error worked fine for me.

Image renaming bash script

As part of my photo archiving process I like to first change the image file names from their original nonsense names to something based on the date and time. This way, if I upload a low-res image someplace, such as Flickr, I can easily use its original filename to locate the high-res version in the archives. This also means all of my images have unique filenames.

To batch rename files, I used to use a script called “irename” that I got from varp.net a long time ago. Unfortunately, it would fail to rename images that were taken too close together. Looking at the code, it didn’t include a way to automatically give unique names to images taken really close together. So, I looked at the code to see if I could fix it. It turned out the script was parsing the EXIF info in image files itself – which I guessed an external program could do more reliably. There’s a Perl library and command-line tool called exiftool that does a great job of parsing EXIF info. It even does exactly the sort of image file renaming I wanted to do, but I didn’t want to have to type all this every time:

exiftool -d %Y%m%d_%H%M%S%%-c.%%e "-filename

When you find yourself typing stuff like this at the command line repeatedly, you should put it in a bash script with a name you’ll remember, place that in your “bin” folder, and make it executable. I called my script “camcon” because I didn’t have anything on my system with that name and it sounded easy to remember. Download camcon: camcon.zip