This is a practice post. Here’s a picture of my daughter on her birthday.
Yay!
ommtoc = One More Mp3 To Ogg Converter
This script does just what it says–converts a directory of mp3′s to ogg, preserving id3 tags when present. Be sure to read the intro comments.
I deleted the script because wordpress mangles it beyond belief. And I can’t upload a plain text file!
When I came across the article Switching to Windows: Not as easy as you think I had to chuckle, because I recently had the (dis)pleasure of installing Windows on my home computer. The author wrote the article from the perspective of somebody who has used Linux all his life and is new to Windows. This is a funny jab on a lot of those reviews written by Windows users when they first try Linux. A big part of those reviews focuses on the install process.
While I have not used Linux my entire life, I have used it exclusively at home for the past 4+ years. When my home-built box (amdk6-2 500MHz) started acting funny (bad RAM), I decided it was time to build a new box. This time, however, my daughter is a little older and starting to get interested in the Internet and games. I decided, then, that I’d install Windows for her so she could play some Flash and Shockwave games.
Well, I reserved a 5 gig partition for XP, thinking that would be plenty. But after all was said and done and I booted XP, I found I only had like 800 megs of free space left. I thought that was pretty incredible considering a desktop Ubuntu fits easily in less than 3 gigs, and that includes a ton of software. I discovered that XP uses something like swap, a file called pagefile.sys, and another huge file, hiberfil.sys, which is used to store settings for hibernation mode. By turning off hibernation in the power management section I was able to get rid of the hiberfil.sys file, and I read on several forums that I could change the size of pagefile.sys by adjusting the virtual memory, but every time I tried to do so and reboot the old value was retained. BTW, the pagefile.sys defaults to 1.5x RAM, so here I am spending 1.5 gigs of drive space on swap. Oh well. Not to fear, though, because I also made a 10 gig FAT32 partition to share data back and forth between Windows and Ubuntu.
Other parts of the article struck a chord: how annoying it was to leave the installation process and assume it would install and ask me questions all at once. Instead, you get asked questions every so often so you can’t just get on with your life while you’re installing XP.
The other thing I noticed was how Ubuntu “just worked” when I was done; I didn’t have to install any drivers for video, sound, or LAN. In Windows XP, however, I had to install drivers for everything. Bleh.
It’s been a few weeks since I built this box and in that time I’ve only booted into Windows XP a handful of times. I just prefer linux!
Thanks to the ubuntu-users mailing list I can now easily type accented characters in gnome on Ubuntu. It’s fairly simple and as usual, there are probably other ways of doing it, but here’s one.
Right-click on the panel to get the Add to Panel option. Scroll down to Utilities where you’ll find Keyboard Indicator. Once it’s added to the panel, Right-click the applet–mine defaults to USA–and click Open Keyboard Preferences. From there, choose the Layouts tab, click Add, scroll down to US English, and select International (with dead keys). Once you add that, you might want to go back and tick regular old US English as the default.
Now, click on the panel applet and USA should change to USA*. To type an accented character, just type the accent key (the apostrophe or tilde) and the letter you want accented. For example apostrophe + e yields é, tilde + n yields ñ. If you want to type a regular apostrophe, you have to hit the apostrophe key followed by a space.
Using the keyboard indicator applet you can easily switch back and forth between the international and US keyboard layouts.
One of the cool things you can do with gnome is write your own scripts that are accessible via the file manager nautilus. For example, let’s say you’re listening to music in xmms and you come across a tune you want to hear while browsing with nautilus. If you right-click the file, your only options are to open the file in question in various applications. What if you don’t want to open it and kill the song you’re listening to at the moment? There’s no way for you to add the song to your media player’s queue.
This is where nautilus scripts come in. These are just bash (or perl, or python, or whatever) scripts that you can write and access through a right-click in nautilus. First, make sure you have a nautilus-scripts folder inside your ~/.gnome2 folder. Put a script in nautilus-scripts and it becomes available by right-clicking a file or files in nautilus; just hover over Scripts and see a list of scripts you can choose from. I believe the Scripts option is hidden until you have at least one script in ~/.gnome2/nautilus-scripts/.
The script below adds a file to a beep-media-player, xmms, or amarok queue. In other words, it adds the file to the end of your current playlist, so the song you’re listening to doesn’t get interrupted.
The first thing you should do is define your default media player in line 2.
The script first checks to see if one of the three players is running; if so, it adds the file to the queue. If one of the players is not running, it launches the default player (defined in line 2) and starts playing it.
It would be easy to add additional media players, as long as the player supports adding a file to the queue with a command line switch. Rhythmbox is one that I tried that doesn’t allow that option.
Just copy and paste the script below to your favorite text editor and save it to ~/.gnome2/nautilus-scripts. Make it executable with the command chmod +x ~/.gnome2/nautilus-scripts/filename (I named mine add2q, but call it whatever you want).
#!/bin/bash
defaultPlayer="beep-media-player"
if [ "`ps -U $USER | grep beep`" ] ; then
player="beep-media-player"
elif [ "`ps -U $USER | grep xmms`" ] ; then
player="xmms"
elif [ "`ps -U $USER | grep amarok`" ] ; then
player="amarok"
else
player="$defaultPlayer"
isRunning="false"
fi
for arg
do
if [ "$isRunning" == "false" ] ; then
$player "$arg"
else
$player -e "$arg"
fi
done
In Ubuntu, the ~/.bash_profile file adds your ~/bin directory to your path. Putting scripts in your ~/bin directory is convenient because you don’t have to type the full path to the scripts to run them.
The problem with a default Ubuntu install, however, is that ~/.bash_profile is only for login shells, not for the gnome desktop. So, if you launch a terminal in gnome, ~/.bash_profile doesn’t get read, and ~/bin isn’t in your path
.
The easiest way to fix this is to just copy the lines from ~/.bash_profile to the end of ~/.bashrc:
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
Now, whenever you launch a terminal, ~/bin is in your path.
Theme: Shocking Blue Green. Blog at WordPress.com.