Archive for the ‘Open Source / FOSS’ Category

Making Life Easier With Scripts For Nautilus

In my previous post, I talked about how you can use Nautilus and the nautilus-image-converter as tools for resizing and rotating your images.  Although PCManFM is my preferred file manager, and I often use Thunar if I am bulk renaming files, I keep coming back to Nautilus for file management, network file browsing, image resizing/rotation, and for the ability to use custom scripts that help make life a little bit easier.  It is the latter that I wish to mention here.

Add Music Easily to the MoC Player Using Nautilus

The Nautilus script that I use most frequently is specific to the MoC (Music on Console) music player.  Credit for this one goes to Tyler “-z-” Mulligan. I’ve written in the past about the MoC Player, and of all of the music players that I’ve tried in the past, this one is by far my favorite.  So how does the script work?  Download Tyler’s script and save it in your ~/.gnome2/nautilus-scripts folder.  Change the permissions so that the file is executable.

$ chmod +x mocp.sh

Open up an instance of MoCp (the MoC player), open up Nautilus, and navigate to your music.  You can select individual files or large selections of files, then right click on the file(s), hover over the Scripts item, then select mocp.sh from the list.  This will add the file(s) to your MoCp playlist.  It’s an efficient way of loading music into your player, and is especially nice when you are looking to pick and choose only a song or two from various albums.

Mount and Unmount ISO Images Using Nautilus

Other scripts that I use on occasion are for mounting and unmounting an ISO file. Although there are other methods listed here and here, and likely even more here, I have had good luck with the mount.sh and unmount.sh files that were posted by Lori Kaufman on the Help Desk Geek website.

Save the mount.sh and unmount.sh files to your ~/.gnome2/nautilus-scripts folder, and change the permissions so that the files are executable.

$ chmod +x *.sh

Using Nautilus, navigate to your ISO file, right-click on it, then select “Scripts” from the menu; then select mount.sh to mount the file, or unmount.sh to unmount an already mounted file.

Check out Lori’s article for more screenshots and instructions.

Note to Self: Here are some other Nautilus scripts that I have not yet explored, but will put on the backburner for later.

Bulk Resizing & Rotating Images In Linux Using Nautilus

Although I’ve been meaning to share this information with you for some time, it was a comment in this post that recently prompted me to get busy writing.  Someone asked the question, why use Nautilus in OpenBox?  Gnome is the desktop manager that I use at work, and Nautilus is the file manager that I use most often on that machine; however, all of my personal machines run either OpenBox or Pekwm, and I wanted to still be able to use the scripts and features that I have grown to love that are available for Nautilus.

How to bulk resize images with Nautilus:

This is a feature that I use regularly in Nautilus.  Sure, there are likley other ways to bulk resize images, possibly with Imagemagic or some other cli tool, but the method that I am about to describe is fast and easy, and it works well for me.  First, make sure that you have installed Nautilus.

$ sudo apt-get install nautilus

Then install the nautilus-image-converter package.  If you have opened Nautilus, make sure that you close the application before installing the image converter package.

$ sudo apt-get install nautilus-image-converter

If you are a Gnome user, you may have to restart Gnome in order for the settings to take effect; if unsure, just log out and log back in. If not a Debian user and you wish to use the nautilus-image-converter application, you can find packages for other Linux distributions here:
http://www.bitron.ch/software/nautilus-image-converter.php

Open Nautilus and navigate to an image or selection of images.  Right-click on the image(s) and you will see that there are two new options listed near the bottom of your menu.  Resize Images / Rotate Images

Click on the Resize Images option.  If you have selected multiple images, this tool will bulk resize all of the images for you. Various resizing options are available to you:

  • Resize using a list of predetermined sizes
  • Scale images based on percentage of reduction
  • Specify a custom sizing scheme
  • Make a copy of the original file, resize it, and append “.resized” or some other custom wording at the end of your file names
  • Resize in place, meaning that you will be resizing your original file

If you are resizing a mass of high resolution images, go get yourself a cup of coffee and some breakfast because it’ll take a while, but far less time than if you had to resize each image individually with your favorite image editing tool.

Rotating Images With Nautilus

Of course, there are many tools that will allow you to rotate an image, and I will often times use alternate tools for image rotation (such as GPicview), but the nautilus-image-converter is a great choice if you wish to bulk rotate images, or if you have a need to maintain the integrity of your original image file and create a rotate copy.  As described above, using Nautilus, select the image or images that you wish to rotate.  Right-click on the image(s), select the Rotate Images option, and specify your desired options.  The choices are:

  • Select a preset angle (90ᵒ clockwise/counter-clockwise, or 180ᵒ)
  • Custom Angle (degrees clockwise)
  • Create a copy of the original file, rotate the copy, then append something to the file name, such as “.resized”
  • Rotate in place, which will rotate the original file

Problems/Issues for OpenBox Users

Nautilus has a tendency to take over your desktop if you are an OpenBox user.  If you are unsure of what I am saying, just launch Nautilus and you will see what I am talking about.  Your desktop wallpaper image will likely change or go away, and you will loose the ability to right-click on your desktop and obtain the beautiful menu that you are so accustomed to seeing.  Urukrama has written a very detailed guide to using OpenBox (much of which also applies to Pekwm) and he explains how to prevent Nautilus from taking over your desktop settings.

For a single-use (non-permanent) way to launch Nautilus in a way that it won’t take over your desktop settings, use:

$ nautilus --browser --no-desktop

Alternately, to make this setting more permanent (this is what I do…), type the following command into your terminal:

$ gconftool-2 --set /apps/nautilus/preferences/show_desktop --type bool False

Summary

As I stated before, there is usually more than one way to accomplish a particular task, and it’s likely that there are some lengthy and complex commands that will allow you to bulk resize images via cli, and perhaps there are some other GUI tools available.  The “best” method to accomplish a task is really a matter of individual opinion; the method that I have described is what I have found works the best for me.  If you have a bulk-image-resize procedure that works well for you, I’d love to learn about it, so please share it with us in the comments.

MoCp – Console Audio Player

Recently, there has been a little bit of a buzz out there surrounding the MoC (music on console) audio player. My ramblings here don’t really bring anything new to the table, but I thought that I’d share my ~/.moc/themes/config file with you and share with you how I launch the application.  This is by far my favorite and most frequently used audio player on any of my machines.  MoC is located in the Ubuntu repositories and can be installed easily by typing the following into your terminal emulator:

$ sudo apt-get install moc

Note: everywhere you see “~/path/to/your/music” in this post or in the config file, please change this to the path to your own music directory.

MoCp - Music On Console Player

I choose to use Terminator as my main terminal emulator, and that’s where I execute the MoC player from.  In my ~/.moc/themes/config file, I’ve made a couple of comments regarding how to launch MoC.  You can add an alias to your ~/.bashrc file so that MoC knows to look for your specified theme file when you launch it from the console, or you can directly reference your theme config file from your menu launcher.

# ~/.bashrc alias to launch MoC command line music player using desired theme and to launch in main music menu
# alias mocp='mocp -m ~/path/to/your/music -T config'
# Gnome Panel launcher:
# terminator -x mocp -m ~/path/to/your/music -T config

You’ll notice that I’m calling on “mocp” rather than “moc”.  This is because “mocp” is the actual player application that you need to use — Music On Console Player.

On my Ubuntu machine, I’ve created a custom launcher on the Gnome panel that executes the second command that you see listed above, and when executed, MoCP launches and it uses my specified theme.  I use Ubuntu at work, but most all of my other machines are running either Crunchbang Linux (uses the OpenBox window manager), or a custom Debian build with the PekWM window manager.

OpenBox: To launch MoCp from the ~/.config/openbox/menu.xml file, I use the following:

<item label="MoC Media Player">
 <action name="Execute">
 <execute>terminator -x mocp -m ~/path/to/your/music -T config</execute>
 </action>
</item>

PekWM: To launch MoCp from the ~/.pekwm/menu file, I have specified the following:

Entry = "- MoCp Music Player" { Actions = "terminator -x mocp -m ~/path/to/your/music -T config" }

The ~/.moc/themes/config file will control the colors that appear in your MoC player; mine is located here.  I can’t take credit for writing this whole config file as I know that it originally came from elsewhere, but I unfortunately cannot recall who the original author was.  As I have noted in the config file, you will find a good tutorial on configuring MoCp located here.

Using Meld to Compare Text Files

Often times when I am debugging code, if there are multiple files that contain similar code sets within my web application, if the code works properly in one file but not in another, it is often times helpful to be able to compare the two files.  Sure, you can use the diff or cmp commands in your terminal, but the output is often times difficult to decipher.  Meld is a tool that allows you to visually see where there are differences in your file.  Meld can be found in the Ubuntu repositories, which makes the installation fairly easy (sudo apt-get install meld) if you are using Ubuntu or one of its derivatives.

Meld allows you to view either two or three files in a side-by-side format, and it displays where there are differences in code between the files.  This is a great way to debug code when you have similar code chunks between files (assuming that one file is working properly).

Meld Screenshot

Notice how the code displayed in blue is where there are differences:

Meld Screenshot

Meld homepage: http://meld.sourceforge.net
More screenshots of Meld can be found here: http://meld.sourceforge.net/screenshots.html

#! CrunchBang Linux on ThinkPad T30

CrunchBang #! Linux on the ThinkPad T30

Some years ago, my step-dad gave us a ThinkPad 770Z (Pentium II), and I’ve been a ThinkPad convert ever since.  I also have a ThinkPad X-60 (dual core with 12.1″ lcd), which is awesome for regular bike commuting (small, light weight); however, lately I’ve been accessing Windows servers remotely on campus and have had to use Visual Studio for several applications that I’ve been writing, and the 12.1″ lcd just is too small for working in VS.  Also, I wanted something a little bit larger for mobile computing around the house.  After some shopping around on eBay, I found a T30 for super cheap that had Ubuntu Linux installed on it. Although I picked it up for a song, upon receiving the machine, it appeared that the 512 MB of RAM that had been listed in the auction was actually 256 MB.  [Edit: I have since learned that the T30 has a known issue with the motherboard where only one of the DIMM's may be accessed: http://forum.thinkpads.com/viewtopic.php?t=13262].  After cracking open the lid that contains the DIMM’s, I found two sticks of 256.  Sitting on top of the RAM were two half-lengths of popsicle sticks, which were apparently pushing down on the RAM [to fix the motherboard issue linked above, but this solution does not work so well...]; I guess that the pressure of the popsicle sticks pushing down on the RAM modules is somehow supposed to help them engage better.  After readjusting the popsicle sticks, closing the lid and rebooting the machine, I was able to utilize all 512 MB of RAM; now I am finding that I may need to find a better remedy for this issue as the machine now only seems to be utilizing 256 MB of memory and that the other stick is not engaging.  I guess that you never know exactly what you are going to get when you shop on eBay.  Although the machine reeks of stale cigarette smoke, the contact under the ’4′ key does not work very well, and there are a few cracks in the machine’s case, I am pretty happy with this machine.  With a quick rebuild of the OS, I am now running #! (CrunchBang) Linux (8.10.01), which is based on Ubuntu 8.10 Intrepid Ibex, and am really enjoying having a dedicated #! machine at my fingertips (other than my work lappie, which I don’t use very often and it runs the same OS).  So far, the machine suits all of my needs and then some.  Simple, sleek, not too big, not too heavy… I’m liking it.  The 14.1″ lcd seems to fit my needs very well.  Plus, it seems to smell less like cigarettes with each passing day.  :)

All of the hardware seems to be running just fine under #!.  Here are the system specs:

  • Mobile Intel(R) Pentium(R) 4 – M CPU 2.00GHz
  • RAM: 256 MB – 512 MB, depending on it’s mood. SODIMM SDRAM
  • VGA: ATI Radeon Mobility M7 LW [Radeon Mobility 7500]
  • USB Controller: Intel 82801CA/CAM
  • Wireless Interface: Cisco Aironet Wireless 802.11b
  • Ethernet Interface: Intel 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller
  • Disk: Toshiba PATA 40 GB
  • Audio: Intel 82801CA/CAM AC’97 Audio Controller

Incidentally, I still use the old 770Z quite frequently.  When we go to bed, wifey is often times doing homework, and I’ll be catching up on newsgroups or furthering my knowledge on one thing or another.  DSL (Damn Small Linux – all of 50 MB!) runs quite well on this machine and suits me just fine.

Ease Of Use….

This March, the Boulder OWASP chapter (what is OWASP?) will host its winter web application security conference, the 2009 SnowFROC.  The conference organizers have requested that volunteers submit graphics to potentially be used to represent the conference in Web and printed materials; they will select the best graphic(s) from the pool of submissions.  I used the GIMP (of course) to create a graphic for my submission; however, because I wanted to perform some custom illustrations to incorporate into the graphic, I needed to use a vector graphics illustration tool.  With my new Intrepid build, I kind of figured that Inkscape would have already been included in the default build, but when I went to the Graphics menu, there was no sign of the vector graphics tool.  My Terminator terminal emulator came to the rescue along with the simple command: sudo apt-get install inkscape.  Within a few moments, Inkscape had been downloaded and installed, and I was on my way to creating custom illustrations!  How easy was that???  This is a perfect example of how Linux and open source software just makes life easier.  Thank you to the world of open source software!  You make my life easier, and you are so much more fun to use over commercial software.  YES!  THANK YOU!

Here’s the BOWASP SnowFroc graphical header that I created:

2009 BOWASP SnowFroc Graphical Header Idea

The idea is that it would look something like this on a web page:
2009 BOWASP SnowFroc Graphical Header Idea

CrunchBang Linux #!

Philip Newborough has taken the base flavor of Ubuntu, shaken a little bit of OpenBox on top, added a pinch of applications to suit his taste, and the result is CrunchBang Linux (#!). I’ve been running this now on two different systems, both of which are old and limited on resources, and I have been extrememly pleased with the results. After attempting (and failing) to create my own flavor of Ubuntu-light (base Ubuntu using a tiling window manager such as Awesome or Xmonad), I was very pleased to run across #!. I do still want to get a system up and running with a tiling window manager and see what that’s like, but in the mean time, #! is working well on my old PII and PIII laptops.

#! website: http://crunchbang.org/projects/linux/
#! Forum: http://crunchbang.org/forums/
IRC: irc.freenode.net #crunchbang

Up until now, I’ve been using version 7.10.01. Version .02 came out today, and mostly seems to have just been updated with some more software and a modified theme. For the old systems that I am using #! on, I’d rather have a lighter weight OS and probably won’t use the apps that have been packaged in version .02, so for now, I’m sticking with the original version. I like the default theme better in .01 anyway too. The 7.10 in the version number specifies that the OS is based on Ubuntu 7.10, Gutsy Gibbon.

#! Linux on old PII Thinkpad

Anyway, I’ve been extremely pleased thus far with #! and plan to continue to use it. I recommend trying it out. Links to ISO’s and mirror sites can be found at the bottom of the #! project homepage.

Windows McPatchy Patch, Ultimate Addition

I ran across this today on Planet Ubuntu and had a good laugh.

Stack Overflow comic strip

Dell Leading The Way….

Dell to offer Solid State drives in Select Laptops:
What a great idea! Fewer moving parts may lead to greater longevity; a drive that is not spinning is much quieter; fast drive speeds are always a big plus. It will be interesting to see this catches on and more companies start offering flash technology in their portable machines. More info here…

Dell Now Offering Linux as Alternative OS:
Another Dell-related topic that has been big in the news lately in the Linux world is that, after having received a huge response to their IdeaStorm website regarding offering consumers a choice in operating systems, Dell will now offer consumer machines with Ubuntu Linux pre-installed. Dell has tried this in years past and it did not go over so well, but considering how far along Linux has come since then and also considering how many more Linux users are out there these days, I can only hope that Dell will receive greater support in their decision to offer this alternative choice in operating systems. I am very happy to see that Dell, a major computer manufacturer, has chosen to lead the way and set an example for all the world to see.

In my opinion, what will encourage consumers to support Dell’s decision to offer pre-installed Linux machines is if the machines will end up costing less than comparable machines that have Windows installed. If there is no significant price difference, then I am not so sure that Dell will receive the support that they will be looking for in order to continue to offer an alternative choice to consumers. As with myself, most Linux users that I know enjoy building their machine and customizing it personally as opposed to purchasing something that has a pre-installed OS. Part of the fun of running a Linux box is that you built it yourself. However, this brings up the purist question of even using an OS like Ubuntu, where everything is already compiled and built for you, so all you have to do is run the installation off of the CD; the other option is to custom build/compile your OS with Gentoo or Debian… or the more extreme alternative is to write your own OS from scratch. So, I guess that the level of the OS install is up to the user, and to some, purchasing a pre-installed Linux box may be just the ticket. Although I would possibly choose to reinstall the OS and customize things the way I like, I would still support purchasing a pre-installed Linux box. Great idea! I sincerely hope that it takes off, and I hope that this does not somehow come back around to bite the open source movement in the ass in some backwards way.

Ututo Linux

Lately, I have been seeing references to Ututo Linux in various places, and I decided that it was time to try it out. Ututo is Gentoo-based, which is intriguing to me. In my mind, what makes Gentoo so great is that it is fully customizable; you can make it as light or as robust as you want it to be, and you can completely configure it for the hardware on your machine. The drawback is that it takes a long time to build your box, whereas most other mainstream (and less configurable) Linux distributions can be installed in less than one or two hours. This is one of the benefits of having a pre-packaged Gentoo distribution is that you can have your machine up and running in no time flat.

I found the Ututo installation to be very simple and straight forward. No big surprises found. Although I did not time the installation process, it seemed to take only an hour or so. The Ututo developers have created pre-configured versions for various processor types, so you download the right ISO for your machine’s processor. That makes it pretty easy. They also have made a live-cd version (it’s in Spanish; you have the option to change the language at login, but Spanish seems to be what you get once you log in) for those who wish to test drive Ututo, but this is a separate ISO that you have to download so if you wish to install this distribution, you will have to download the flavor that is associated with your ISO or install from source.

Once installed, I found that the interface was easy to use and was not at all complicated. Gnome is the desktop manager that the Ututo developers have chosen to use, which I am plenty happy with. They also include the IceWM window manager, which I had never used before; seemed pretty light-weight and easy to use; the default Windows XP look that comes up when you log in with IceWM sort of turned me off though.

Being a Gentoo derivative, installation of packages in Ututo seemed to be mostly source-based. I must admit that being primarily a (U, X, Flux, nU…)buntu user these days, I have become lazy and accustomed to the convenience of using Synaptic as my package manager, along with apt-get. Although I did not spend enough time working with Ututo to find out, I believe that one could set the system up to work with Portage.

Ututo comes with a nice set of tools, such as Bluefish and the Gimp. Although I did not spend a great deal of time testing Ututo, it seemed like a very stable platform, and is one that I would like to spend more time testing some time soon. The interface was clean and easy to work with. The only negative thing that I would have to say about Ututo is that I don’t care for the sharp cursor arrow and for the creepy hand with the pointing finger that is displayed when hovering the mouse cursor over a hyperlink; it looks like a gobblin hand or something like that (perhaps a change in themes would change this?). Minor detail though. Ututo is a nice alternative if you are wanting to use Gentoo but you don’t want to spend days on your Gentoo install. Kudos to the Ututo development team.

Return top

-==[ Hilltop_Yodeler ]==-

Welcome to HilltopYodeler, a place where we'll do some hollerin' about Linux, OSS/FOSS, CSS/XHTML, pickin', paddlin', tinkering, snow, rock, bicycles, and other stuff that we're freaky for. Much of what will be discussed here will be related to Ubuntu Linux, Debian Linux, Crunchbang (#!) Linux, Damn Small Linux, OpenBox, PekWM, and Gnome. Grab your coffee... pick up your piolet... tuck in your whiskey nipper... have paddle in hand... grease your boards... bend some wires... plug into your lappie, mow down some sushi... and get your fool-freak yodel on!