Sunday, December 23, 2012

batch renaming

There are various ways to rename a bunch of files in Linux. Some approaches are mentioned in the Linuxaria article "Mass renaming files on Linux."

That article mentions the rename and mmv commands; a method using bash with the mv and basename commands; and, GUI apps such as Midnight Commander, Thunar, KRename, and GPRename.

In Debian Wheezy, I found the rename command, and I found mmv in the repos. For batch renaming, however I prefer a GUI tool.

I've used Thunar in Xfce for batch renaming, and it works just fine. It's also quite easy to install in other desktop environments.

I've also used KRename in KDE. One approach is to enable KRename in KDE's Krusader file manager.

In current KDE versions, though, the Dolphin file manager (which is not mentioned in the article) handles batch renaming quite well. Simply select the list of files you want to rename, right-click, and click on "Rename..." The resulting dialog box is self-explanatory:



I have Dolphin installed even in my non-KDE systems because it's my favorite file manager for working with photos; so, I normally choose Dolphin for doing any batch renaming. Thunar is perfect for Xfce, though; and for GNOME, GPRename does the job. Here's a screen shot:



As you can see, GPRename shows a preview of the changes before they're committed. I found GPRename available in the Wheezy repos.

The article also mentions Midnight Commander, which I also found in the Wheezy repos. Old-timers will be quite familiar with mc, but others might need to familiarize themselves with it. I installed it and took a shot at a batch renaming exercise.

I navigated to my test directory and selected the files by pressing + and typing in testing*, then pressing Enter.



With the files selected, I used the Rename/Move option under the File menu.



Then I renamed the files by using testing* for the source and test* for the destination.



The result:

steve[~/test]$ ls
test1  test2  test3


There's also a Batch Rename plugin available for the SpaceFM file manager, for another GUI approach that isn't DE-specific. But as of this writing, I haven't been able to get it to work, even after examining this Crunchbang forums thread. Not sure what I'm doing wrong, but I gave up on it for now since I have so many other ways to do batch renaming besides trying to do it with SpaceFM.

Saturday, December 22, 2012

the hard way

Interesting guide here: "Learning Linux The Hard Way." 30 Unix exercises that you can try from your web browser.



From the introduction:

This is a simple guide written in “Learn X the hard way” style, author of which is Zed A. Shaw. The purpose of it is to give you some experience in working with Unix-like system. There are many good UNIX-Like systems out there, for example FreeBSD, OpenBSD, OpenSolaris and even MAC OS X, just to name a few. When deciding which system to use in this guide I chose Linux mainly because it is most popular UNIX-like server operating system, which means what you have much bigger chance encountering it in the wild in comparsion to other UNIX derivatives. And Linux-related skills are relatively easy transferable to other UNIX-likes.

Saturday, December 15, 2012

variety wallpaper changer in wheezy

I decided to try the Variety Wallpaper Changer in Debian Wheezy. I went to the Variety website and downloaded variety_0.4.12_all.deb. Then I opened Nautilus, right-clicked on the .deb, and clicked on "Open With Software Install." The necessary dependencies were listed; I followed the prompts and installed them. Then I set up the wallpaper changer after adding a directory containing the images I wanted to use.

Another approach that worked for me in Debian Wheezy, of course: Download the .deb file, su to the Downloads directory, and run dpkg -i variety_0.4.12_all.deb (as root). dpkg won’t install a package whose dependencies aren’t met, so I got messages about the unmet dependencies. So I simply went to Synaptic, clicked on Edit > Fix Broken Packages. The variety_0.4.12_all.deb package was listed and marked, so then I clicked on “Apply.” That installed the dependencies and configured Variety.

Once you start up Variety, you're taken to its Preferences window. Variety is set up for downloading images from Flickr, Wallbase, etc. I turned all that stuff off and set it up to pull images from my wallpapers directory:



Other preferences can be configured via the other tabs.

Variety automatically pulls random wallpapers from the directory. There are no settings to change from "random" to "sequential." How the wallpapers are drawn on the screen is determined by the desktop environment's settings -- there are no settings in the app for zoom, scale, fill, etc.

Variety got installed in /opt. There's a help document that can be called up with the following command:

$ /opt/extras.ubuntu.com/variety/bin/variety --help

Variety appears to work fine with GNOME Shell and Xfce. It puts an icon in the system tray area. Here's what it looks like in Wheezy's Xfce when I right-click on the icon, with the "Playback" submenu opened:



For more info, see the Variety Wallpaper Changer website, or the following web pages:

http://www.webupd8.org/2012/10/keep-yout-desktop-fresh-with-variety.html

http://www.mytechguide.org/13209/variety-wallpaper-changer/

https://launchpad.net/variety

Tuesday, December 11, 2012

mark all upgrades in mint's synaptic

One thing about Linux Mint that used to annoy me was that their version of Synaptic was missing the "Mark All Upgrades" button, something that's always been present in every other distro's Synaptic. The button was supposedly removed to protect users from messing up their systems. Too much hand-holding, in my opinion.

One work-around was to simply do updates from the command line with apt-get. Another was the following approach:

- Click on “Reload” to get any available upgrades to show up.
- Click on the “Status” button down at the lower left.
- Select “Installed (Upgradable).”
- Click on one of the packages, do a ctrl+a to select all, then right-click on any of the selected packages.
- Click on “Mark for Upgrade.”  Then click on “Apply.”

That turned out to be easy enough to do, but the attitude of the Mint folks toward this and other issues played a big part in my deciding not to use the distro anymore (the main reason, however, was that after some years of running both distros side-by-side, I'd simply decided that I preferred to run only Ubuntu, which Mint's main version is based on).

Because of not using Mint anymore, I missed the solution posted by "Roken" at the Mint forums:


If you haven't already (or if you've rebooted) reinstall synaptic.

Now, before you reboot open a terminal and:

sudo gedit /etc/linuxmint/adjustments/10-mintsystem-synaptic.preserve


This will create a new text file. Add the following two lines to the file:

/usr/share/synaptic/glade/window_main.glade
/usr/share/synaptic/gtkbuilder/window_main.ui


Save. Now your "Mark All Upgrades" button should be back and surviving reboots. To revert to default mint behaviour:

sudo rm /etc/linuxmint/adjustments/10-mintsystem-synaptic.preserve


This is the correct way to disable the mintsystem change to synaptic (based on examination of the mintsystem script) and should survive updates in the future.


Here's the thread where this fix was posted: http://forums.linuxmint.com/viewtopic.php?f=200&t=70449&start=20

The fix was also posted in this thread.

Thank you, Roken. If/when I ever install Linux Mint again, I'll try that out.

Monday, December 10, 2012

Change

One thing that you can be absolutely, 100% sure of, it's that Change will happen. Always has, always will.

You can prepare yourself for Change, even if you aren't sure what exactly will change. You can put yourself in a position to take advantage of its inevitability. You can bend Change, and benefit from it.

Or you can just kick back. Let Change run the show. And when it happens, hope that you can adjust.

But it's gonna happen, one way or another. It's up to you. Climb up on that horse and ride it, or let it ride you. Navigate that river, or let it take you where it wants to take you.

it ain't working

Utah's Paul Millsap, after the Jazz beat the Lakers, 117-110, dropping the Lakers to 9-12 on the season:

''They did it to themselves... 'Our defense was pretty good, but they had no ball movement and that made it easier on us just to try to load up, keep them out of the paint and let them fire up some 3s.''

The Lakers' Kobe Bryant had 34 points (9-24 from the field) with 3 assists and 0 rebounds. Chris Duhon managed 11 assists and 12 points; Dwight Howard, only 11 points (on 10 field goals), but he grabbed 16 rebounds.

Steve Nash is still out, and Pau Gasol didn't play.

The Lakers, who were supposed to contend for an NBA title, sit in 3rd place in the Pacific Division, 5 1/2 games behind the Clippers and 4 1/2 games behind Golden State.

Sunday, December 9, 2012

oops


I have to wonder what "Money" is thinking now.

Because a year or two ago, he could have had the biggest payday in the history of boxing.

Instead, Floyd Mayweather ducked and dodged a potential fight with Manny Pacquiao -- a bout that I'd come to believe "Money" would have won, cementing his status as one of the all-time greats.

Mayweather may still go down as one of the all-time greats, but it looks like he'll never have that career-defining, signature fight.

And that huge payday? That cash went down the drain for good last night.

Juan Manuel Marquez over Pacquiao, KO6.