I Finally Snagged a Google Plus Invitation!

Unless you’ve been living under a rock, you’ve probably heard about Google’s new invitation only (for now) social network, Google+. If  not, I suggest you check out the site and take the tour. Google+ will likely forever change the way we interact with friends online, by grouping friends into social “circles” and sharing only certain material with certain groups of friends. In addition to that, another neat feature is “hangouts”, where you can have a group video chat with up to 10 different people. Regardless, today I managed to snag an invitation to the service by posting my email address on Beatweek’s Facebook wall. Less than 5 minutes after posting my email, I had an invitation sitting in my inbox from Bill Palmer. Shortly after that, I even got a second invitation to the service from the same person. Unfortunately, because Google wants to limit how many people are on their service, even with an invitation, I couldn’t sign up for the service yet, but I’ll definitely be checking the Google Plus website frequently to see if I can get in. I’m incredibly excited to try out this new service from Google, and I have incredibly high expectations from it. Anyways, if I do manage to get in, I’ll be happy to invite anyone who requests an invitation from me. I’ll update this post (or post another post) once I get into Google+.

UPDATE: I got a second invitation by Richi Jennings of Computerworld, who I emailed before posting on Beatweek’s wall, asking for an invite. Thanks Richi! However, I still didn’t manage to get into Google+, unfortunately… :(

UPDATE 2: I finally managed to sign up for Google+! I’ll try to invite everyone who asked me to send them an invitation, but I can’t guarantee you’ll be able to sign up.

My Blog Is Now Running WordPress 3.2

WordPress Logo

Image via Wikipedia

Yesterday I upgraded my blog to the new major revision of the WordPress blogging platform, version 3.2, as soon as it was publicly released. In only a day, the new version was downloaded over 330,000 times. The new version of WordPress is supposedly much lighter and faster than the previous iteration, as a lot of bloat has been removed and a lot of the code was optimized to be more efficient. The new version features a new admin panel and an HTML5 compatible default theme. Overall, I am pleased with the new version of WordPress, and I’m looking forward to even more positive changes to the platform in the future.

ROME’s “3 Dreams of Black” WebGL Demo Is Awesome!

If you haven’t heard of ROME’s 3 Dreams of Black WebGL demo, you should seriously check this out. It’s an interactive music-video like experience that is rendered in the web browser in real-time using JavaScript and WebGL. Because it’s hardware accelerated, it allows for insanely complex, dynamic, and interactive graphics to be rendered right within your web browser. Of course, you will need to be using a modern web browser for this to work, such as the latest version of Google Chrome, Mozilla Firefox (5 was just recently released), Opera, or Safari. Unfortunately, Internet Explorer does not support WebGL, which is required to view this demo. Also, this is an open source project, so all of the source code is available on Google Code. 3 Dreams of Black is more than just a music video. It offers a look at the future of the web, where open web technologies can be used to create interactive experiences never before thought possible, all through a web browser. If you have a modern graphics card that supports a reasonably modern version of the OpenGL API, I highly recommend playing with this demo. For the rest of you, there is a video on YouTube that shows off the demo.

How To Make a Beeping Timer Using Bash Script and Ubuntu Linux

I had my wisdom teeth removed this morning, and I’ve more or less been bedridden with my laptop, so I decided to kill time and keep my mind off of the pain by writing a script to beep whenever I have to alternate between having ice on my face and vice versa. I’m supposed to switch between the two every 20 minutes, which is a pain to remember and keep track of, so why not have the computer do that for me? Most of the work is already done for me in readily available tools, like Linux‘s “date” command, and the MOC console audio player. The only “real” work I had to do was write a few simple conditional statements, look into command line arguments for the programs used (using man pages), and creating a beeping sound using Audacity. This took me less than 30 minutes total, and I figured someone somewhere might find it useful or interesting, so I decided to write a tutorial about it and describe how I did it. A lot of this is geared towards those without much programming experience, so it might be useful in teaching the basics of programming and turning logic into code. Note: I realize there is a “beep” command available, but my laptop does not have a built-in speaker that works with that, so this is a very easy alternative, and it’s more compatible, too.

Because the easiest step is creating the audio file, I’ll start with that. If you’re just looking for a short beeping sound, and you don’t feel like opening up Audacity, the file I used can be downloaded below.

Audio File Used: 440Hz Beep for 3 Seconds

This is actually incredibly easy. If you don’t already have Audacity, download and install it. Now open it up, and choose “Tone” under the “Generate” menu. For me, the settings I used were Waveform: Sine, Frequency: 440Hz, Amplitude: 1, Duration: 3 Seconds. This will quickly generate the beeping sound. Now you need to export this in a format playable by MOC. To do this, go to File > Export… and set the file type to “Ogg Vorbis Files“. Now save the file as something.ogg in the same directory you want the script to be in. For my script, the file name I used is “beep-440-3s.ogg”, but the name really doesn’t matter. I don’t recommend using spaces as you probably have to escape them in your script, which is a pain that can easily be avoided.

Now, if you don’t already have MOC console audio player installed, you need to install it (or another tool of your choosing) in order to play the audio file from the command line. To get MOC audio player in Ubuntu or Debian Linux, you can type the following command in a terminal, assuming the debian package “moc” is available in your configured software repositories:

sudo apt-get install moc

This method requires super-user (administrative) permissions, unfortunately, but that probably won’t be a problem for you. For more information on the sudo command, see Ubuntu Linux, Day 18: What Is This ‘sudo’ You Speak Of? (pcworld.com). Excuse me for a second, my timer just went off… now that we got that over with, let’s get started on coding the script!

Now, In my case, because I have to switch between ice and no ice every 20 minutes, there are three times that I switch between the two as 60 divided by 20 is 3. Because this is an odd number, the range minutes that I will or will not have a bag of ice on my face alternates every hour. To determine whether or not I should have a bag of ice on my face in a given 20 minutes, we can use the modulus operator, which is used to determine the remainder of a division operation. If the modulus operator returns a zero, then there is no remainder (obviously). By getting the remainder of dividing the number of the hour by 2, we can tell if the current hour is even if the remainder is zero. The way I wrote this script isn’t the most efficient way of doing this, but I wanted to create something that worked quickly without spending too much time on it. Also, yes, I realize I could’ve done something incredibly simple, like using the watch command to tell me when to alternate between ice and no ice, but this was more fun to code, mostly for practice, and it works for me. An example of how I would use the watch command instead is to have it wait 20 minutes (the argument ‘n’, which is the time to wait, is in seconds, so there are 1200 seconds in 20 minutes), and play the sound after that amount of time. This can be done with the following command from within the folder where the beep audio file is stored, substituting the duration and the file name with the ones you used/need:

watch -n 1200 mocp -l beep-440-3s.ogg

This will wait 20 minutes from the time of starting the command and then beep, repeating every 20 minutes. However, the title of this guide is “How To Make a Beeping Timer Using Bash Script and Ubuntu”, so I’m going to show you how to do that.

First, we’ll start with the obligatory shebang line:


Because the entire script will be repeated indefinitely, until closed (such as using Ctrl + C), we want the main contents of our script to be in a while loop. The bash equivalent of a “while (true)” loop is “while [ 1 ]“, so the entire body of the script will be enclosed in that loop. Instead of brackets, while loops in bash are terminated with “do” at the beginning, and “done” at the end. The most obvious challenge we need to focus on is getting the current hour and minute in a format that’s incredibly easy to parse and work with. Linux’s “date” command works wonderfully for this. It does nearly all of the work for you, all you have to do is tell it how to format the date. If you look through the man pages for the date command, you can see that you’re able to specify how to format the date. All we’re interested in is the current hour (%k) and minutes (%M). To retrieve the hour from the date command, you simply type “date +%k”, where the formatting we want is after the plus sign. Go ahead and try that. The command to retrieve the current time in minutes is the same thing, substituting “k” for “M”. The letters are case-sensitive. When initializing a variable using bash script, it’s possible to set the variable to the return value (output) of a command using back-ticks. So, to get the current hour and minute, our code looks like this:

HOUR=`date +%k`

MIN=`date +%M`

Now that we have the hour and the minutes, we need to check to see if we should play the beep audio file or not. If the remainder of dividing the current minutes by 20 is zero, then we should be playing the file. The code for this is as follows:

let REM=”$MIN % 20″

if [ $REM = 0 ];


mocp -l beep-440-3s.ogg


The “-l” argument of the mocp command tells MOC to just play the audio files specified in the command line arguments without messing with playlists, etc. Now that we have the beep working, we could consider the script done, as it goes off every at :00, :20, and :40 after the hour, but other that the fact that it’s obvious if you should put on ice or take it off, it’s a coding challenge to determine which one, so I decided to make the program say whether you should put ice on or vice versa. The first thing I did is realized that there are three times in an hour where I alternate between ice or not. Two of the times are the same except for the middle time at 20 minutes. Because 20 / 20 is one, we can check if the current minutes divided by 20 is 1 and display whether or not to put ice on depending on if the hour is an even number or not. In my code, I refer to the current minute divided by 20 with a truncated remainder as the current “set” number. The code for this is easy to write:

let SET=”($MIN-$REM)/20″

For debugging information, I list the current hour, minute, set, and whether  I should have ice on or not on the screen. This is also easy to code:

echo -n “Hour: $HOUR Min: $MIN Set: $SET “

In the string echoed to the console and the mathematical expressions, a variable name preceded by a dollar sign ($) is replaced with the value of that variable and evaluated as such. The -n argument of the “echo” command just tells echo not to append a new line character to the end of the string it prints to the output stream (in this case the console). The reason for this is because later in this script I echo whether or not I need to have ice on or off, and it looks neater to have it all on the same line. To determine whether the hour is an even number or not, we get the remainder of dividing the hour by two. If the remainder is zero, the hour is even. We can then use that to help determine whether we alternate cycles this hour. The code for this is incredibly simple:

let hrem=”$HOUR % 2″

As stated earlier, if the set is the middle set (set ’1′, at 20 minutes after the hour), whether or not I need to use ice is different than the other two sets. Using that logic as well as the fact that the fact that the cycles alternate each hour, we can piece together the logic using very basic conditional statements:

if [ $SET -ne 1 ]; then

if [ $hrem -ne 0 ]; then

echo “Ice On”


echo “Ice Off”



if [ $hrem -ne 0 ]; then

echo “Ice Off”


echo “Ice On”



If you aren’t familiar with bash syntax, “-ne” is short for “is not equal to”, which is usually expressed in other languages using “!=”, or “not” before a condition. Finally, to prevent a lot of redundant output, we will use the sleep command to wait a minute (60 seconds in the command) before the next iteration (repetition) of the while loop:

sleep 60s #wait 1 minute

And we’re finally done coding the script! Now, we just need to save the script in the same directory as the beep audio file, with the “.sh” file extension and set it as executable. To do that, you can use the Properties dialog, or just do it with the command prompt using the following command:

chmod +x ice-timer-script.sh

Now you can run the script using the command “sh ice-timer-script.sh“. I hope that somebody finds this tutorial useful. Writing this certainly helped keep me busy, since I’ve been in bed for the majority of the day. If you have any questions or feel that anything needs clarification, feel free to leave a comment! The final script used in this tutorial can be found at http://code.dylanmtaylor.com/bash/ice-timer-script.sh.

How to Reset GNOME Panels to Defaults

Recently, I encountered an unusual graphics corruption bug in my lower GNOME panel. The panel still worked perfectly fine, but it was covered in unusual corruption artefacts, and it looked unsightly. I don’t think many people will actually have this problem, but it was an incredibly simple and easy fix, so I decided to share it on my blog. This may also be useful if you manage to mess up your panel layout, and you just want to start from a fresh slate. The fix is simple: just delete the directory where your GNOME panel configuration files are stored, and GNOME will automatically create a new configuration folder using the default settings the next time you login. The quickest way to do this (in my opinion) is through the terminal. Simply open up a terminal, and paste in the following command:

rm -rfv $HOME/.gconf/apps/panel

Now log out and log back in. Your GNOME panel settings will be reset to their defaults. Enjoy! :)

FiOS WEP Key Calculator Website Updated

It’s been a very long time since I last worked on my Verizon FiOS WEP key calculator website. Over the last few days, I decided that it looked dated, and I decided to make it look a lot cleaner, using the magic of CSS3. I removed several images from the site, such as the header image, and the background gradient image, and I replaced them with a pure CSS-based approach, reducing the total page size from just above 12Kb to only 6.5Kb, and significantly reducing the already low amount of time taken to load the page, as well as making it feel more modern. The page loads, literally, almost instantly now, even on a dial-up connection, which is rather impressive if you ask me.  I think visitors will like the new look of my FiOS WEP key calculator site, and if you have any feedback about it, feel free to leave a comment on this post.

LibreScribe Progress Update

Since my last post, I have made a lot of progress with LibreScribe. Just a few commits ago, LibreScribe gained the ability to retrieve a list of installed applications on the device, and add them to the list in the applications tab. I also fixed several other significant issues, including:

  • When the smartpen is connected/disconnected, the application no longer crashes, and the status is automatically refreshed
  • Device storage usage is now displayed in MiB instead of in bytes. This makes it a lot less confusing how much space is remaining on your smartpen.
  • A bug, where the Echo Smartpen was detected as an “unknown LiveScribe Smartpen” in certain cases was fixed.
  • All absolute paths have been removed from the project. All resources are now referenced using relative paths.
  • wxFormBuilder has been replaced with wxSmith. The entire user interface has been recreated from scratch (although it’s very similar to the old interface, intentionally)
  • Many C++ source and header files are no longer necessary, so they have been removed, and merged into other files. This makes the codebase a lot more maintainable.
  • Duplicate udev events (such as multiple add events of the same device) are ignored now. Previously, we ended up refreshing the device information up to four times in a row because of duplicate events. This significantly reduces the delay between plugging in a device and seeing a response on the screen.

There are still tons of issues that still need to be fixed before LibreScribe becomes usable in a production environment, but I’ve been steadily making progress, and I hope to have something useful out soon.

Major Bug Fix in LibreScribe

A lot of work on the LibreScribe project has been accomplished since I first wrote about it. Just today, I fixed a major regression which was preventing the device information dialog from being displayed. In addition to that, I now have more work done on the interface, so that when the windows is resized, most of the elements will scale properly to fit the new size. Another major change I made was setting up the layout of the “Audio” and “Applications” tabs, so that there are now lists, with data split into columns. These changes mark a significant improvement in the look and feel of LibreScribe, but it’s only the beginning. Expect a large number of major changes in the not-too-distant future.

A Reply From Lexmark

After discovering a bug in Lexmark‘s Debian installer, as described in my previous post, and reporting it to Lexmark’s support team, I found a response from Lexmark in my inbox, which was sent on the 18th, and I decided to share it on my blog to show that Lexmark is aware of the issue, and they are actively working on resolving it. Here is the message I received from Lexmark Support:

Dear Dylan, 

Here is your Service Request # 1-5145156021

We recently received your feedback.

Thank you for sharing this information. We really appreciate your time and effort in bringing this one to us. I will definitely forward this one to our software engineers so that we can make the necessary changes to our software. We really appreciate your feedback. It’s through customers like you that we’re able to make improvements in our current and future products.

If you have any more questions or concerns, please contact me at your convenience and I will be happy to assist you. (If I am not available, another representative may reply to your request.)

To respond, please select “Reply” in your e-mail software, and be sure that the past e-mail is included in this reply.

[AOL Users: In order to include the previous e-mail, you must highlight it with your mouse when you are replying.]

If your e-mail client automatically deletes prior e-mail thread information, it will cause a delay while we look up your support history. If this is the case you may want to save the old e-mails as attachments and attach them to the current e-mail.

Lexmark eSupport Team

The driver installation failed because there was a typo in the Lua source code for the Linux Lexmark printer driver. To be specific, the variable “ownership” was misspelled as “ownhership” in one of the lines of the source code. While this is a very easy to fix bug, it prevents the Linux installer from working at all, and I am happy to hear that Lexmark knows about the issue now, and it’s likely that a quick fix will be released. Hopefully this will eliminate the need for my workaround, and simplify Linux printer driver installation.

Fixing Lexmark Printer Driver Installation in Ubuntu 11.04

Recently I just installed the Lexmark printer driver in my 64-bit Ubuntu 11.04 installation. As you may or may not notice, the installer is broken by default in Ubuntu 11.04, and it just exits with an error message, saying

Lua error detected: While parsing install.lua: config/run.lua:1374: attempt to index global ‘ownhership’ (a nil value)

After playing with the installer, I finally got it to work perfectly, so I emailed the Lexmark support team to let them know how to fix this, but for now, I’m going to share what you need to do on my blog.

First, you need to extract the files for the installer. To do this, you need to run

./lexmark-inkjet-legacy-wJRE-1.0-1.amd64.deb.sh –noexec –keep

It’s worth noting that there are two hyphens before noexec and keep. Once you run that command, the files for the installer will be extracted to the tmp folder in the current working directory. For now, just type cd tmp and press enter. Now, open up a text editor, such as gedit and navigate to the config folder in the tmp folder we just extracted. Open up the file “run.lua”. The problem is that Lexmark misspelled ownership as ownhership, which broke the installer. Around line 1484, you will find a line that says

if tonumber(ownhership[1]) == 0 then

delete the errant h in the word ownership and save the file. Now, go back to your terminal and run sudo sh startupinstaller.sh in the tmp folder. The installer will work as expected now.

Update: Special thanks to Mathieu Triclot for your $5 donation! Glad I could help! :)