Linux

Goodbye OpenSUSE. Hello Fedora.

It seems obvious that I just can't commit. I just can't commit to a single Linux distribution. I run different flavors on different systems, but even on my desktop, relationships are short-lived. Most recently, I was running OpenSUSE and you know, it was going along pretty good. We seemed like a good fit. And then, one day, I find myself looking at other desktops.

17
Jan

Sysadmins

From the amazing xkcd at xkcd.com


Just because . . . 

09
Jan

Hating the Touchpad

I hate touchpads. I sincerely hate the things. Maybe it's because I have big gorilla hands, but when I am trying to write at the keyboard, the darn things always pick up the slightest brush from my apparently huge, verging on monstrous, hands and translate those inadvertent touches into the most egregious of errors. Words, and sometimes whole sentences, are selected, to be overwritten by the next character I type at the keyboard. If I'm not paying attention, such as when I am looking away from the keyboard as I type, I have to go back several levels of "undo" in order to recapture the lost text, the net effect of which is that I lose the new text. I hate those things. And so I always plug in an external mouse and turn off the touchpad. But I digress . . . 

My old Acer laptop's hard drive crashed over the holidays. This is, remarkably, the first time in some 30 plus years that I've owned computers in which a hard drive actually crashed. In those many years, I've seen many crashed drives, including one belonging to Sally's PC, but never to mine. In my first book on Linux, back in 2001, I wrote that it wasn't a question of if your hard drive would eventually fail, but when. Marcel, meet "when". 

I actually liked my Acer notebook and I've had excellent luck with Acer products over the years, so despite the crashed hard drive, I decided to buy another Acer notebook. This one, the one I am writing on, is an Aspire V3-771 with an Intel i3-2370M processor, a 750 GB hard drive, 6 GB of RAM, and a bright 17 inch LED display. At $499, I simply could not pass it up.

The notebook came with Windows 7 but I erased it when I loaded the latest Linux Mint (based on Ubuntu Quetzal). It worked beautifully except for one thing. The touchpad wasn't being reported by the system as a touchpad. It worked fine in that I could use it to navigate the desktop, right-click here, left click there. Except that since I don't want the thing; remember, I want to use an external mouse. The trouble is that I just couldn't turn the thing off using the standard touchpad control programs. What to do, oh what to do?

We can find out how the X window system sees the various devices it works with by using the xinput command.  I opened a terminal session and typed "xinput list" at the shell prompt.

$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech USB Optical Mouse                id=11   [slave  pointer  (2)]
⎜   ↳ PS/2 Generic Mouse                        id=13   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]
    ↳ HD Webcam                                 id=10   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]
    ↳ Acer WMI hotkeys                          id=14   [slave  keyboard (3)]

As you can see, the touchpad is being recognized as a generic PS/2 mouse and not as a touchpad (I've bolded the appropriate line for emphasis). This is all fine and dandy except that I can't use touchpad control software to turn the thing off as I usually do when I load up a new notebook. This is a known issue for this particular chipset, and not just for Acer.  Luckily, the above command told me everything I needed to know in order to write a script that would do the job for me. I called my script, "disable_touchpad".

$ cat disable_touchpad 
#!/bin/bash
# 
echo "Disabling touchpad"
xinput set-prop 13 "Device Enabled" 0

The "0" at the end of the xinput line at the end of the script tells X to disable the device at id #13, which the "xinput list" command told us about. If you rerun the same command but add a 1 at the end of it instead of the 0, you will reactivate the touchpad. Consequently, I have a second script called "enable_touchpad" that does just that.

Now I can happily type away, with my touchpad safely locked away where it won't accidentally destroy all the work I've done. 

23
Sep

KDE Plasma Does Gestures Globally

This is going to be a surprise to a number of people out there, but not only does the KDE Plasma desktop environment have gestures built in, but it has had them since the 3.2 (roughly) release. Gestures in KDE Plasma aren't just tied to the browser (I covered Firefox mouse gestues here), but pretty much anything in the desktop environment. With a few flicks of the mouse, you can make magic happen across your entire desktop experience. It all sounds new and exciting, but the functionality has been there for years and few people seem to know about this excellent feature. Let me tell you how it works.

Note : In this article, I am running KDE Plasma 4.9.1 on Kubuntu precise.

To see existing mouse gestures that you can use, or create your own, fire up the KDE System Settings program. To do so, click the Application Launcher (the big K in the lower left, and select it from there; it's usually in the Favorites menu, or you can find it under the Computer section (or you can just type "system settings" in the search field of the launcher). When the System Settings window appears, click "Shortcuts and Gestures" which you'll find under the "Common Appearance and Behavior" section (see Figure 1).

Figure 1 : Mouse gesture configuration is found in KDE's System Settings.

First, make sure you enable gestures by clicking that text box in the top right section, then click apply (see close-up in Figure 2).

Figure 2 : Make sure you have enabled gestures as well. On a two-button wheel mouse, button 2 is the clickable wheel.

The Shortcuts and Gestures window has a sidebar to the left that offers three sets of shortcuts. These are custom shortcuts, standard application specific keyboard shortcuts, and global keyboard shortcuts. It doesn't specifically say "gestures" here because keyboard shortcuts are one type of shortcut while mouse gestures are another. Since the selection defaults to custom, and this is where we want to be, look at the middle section where you'll see "Input Actions settings" for a handful of applications, each label representing a group of applications with one of more shortcut (or gesture) defined below. To see the various predefined gestures, click the small arrow to the left of the label (see Figure 3).

Figure 3 : Every pre-defined gesture can be viewed, or changed.

Click on any action (e.g. Home under Konqueror Gestures) and a three-tabbed pane will appear to the left of the window. The tabs are labeled Comment, Trigger, and Action. The comment is exactly what it sounds like, a description of the shortcut with as little or as much information as you want. The trigger, in this case, is a mouse gesture. Using Home as our example, the gesture trigger is a stylized "h" that starts at the light green end of the line and ends at the dark blue. Click the Action tab and you'll see that it actually translates into the Konqueror "Ctrl+Home" keyboard shortcut which loads the home page.

14
Sep

Linux Nonsense

Original image from http://openclipart.org/detail/99001/nonsense-circle-monster-by-10binaryIt's rather amazing just how serious nonsense can sound. Take for instance the following corporate mission statement.

It's our mission to execute a strategic plan to efficiently syndicate relationships and streamline schemas. Our obligation is to continue to conveniently transform our cyber-portals and generate our e-functionalities to enable us to produce more dividends for our serfs. We have committed to embrace technologies in order that we may produce earnings for our venture capitalists and get out of debt.

You have to admit that it does sound an awful lot like the mission statement of many a Fortune 500 company, but unlike some of those corporate mission statements, this one is pure nonsense. If you could write something like this, your friends will think you are either crazy or brilliant. Luckily, my friends don't have to ask that question. What they don't know is that I didn't actually write that. Instead, I generated it from a Linux bash prompt. How, you might ask, did I manage to create something so incredibly real sounding with nothing but a Linux system and a few keystrokes of the command line? How indeed.

To sound this clever yourself, check out the aptly named nonsense. In essence, nonsense is a clever generator of, well, nonsense. Just extract the archive bundle into a directory of your choosing and you are ready to go. No compiling and no nonsense (pardon the circular reference). Nonsense is a Perl script that works with a collection of templates. If you look in the directory you just created, you'll see an executable file called nonsense and a number of data files as well as a few HTML templates. 

Here's how it works. To create the amazing corporate statement above, I simply executed the following command.

     nonsense -f mission.data

Brilliant, isn't it? 

For nonsense, this is quite a wonderful and useful program. With command-line switches, you can make nonsense generate business plans, strange names for people, imaginary political organizations, and even an impressive geek resume (see the screenshot below).

Figure 1: Warning! This nonsense resume is not guaranteed to get you a job. (Click the image for a full sized view)

For this masterpiece of curriculum vitae, I executed the following command.

     ./nonsense -f resume.data -t resume.html.template > resume.html

But wait, that's not all. With a little nonsense,you can create bizarre laws (“It's a Class C felony in Yellow Walnut, Michigan, to hit a poison ivy plant with a cardboard box”), newspaper headlines (“Computer Possessed By Satanic Dæmon”) and even a pretty realistic Slashdot web page. Some of the output is in HTML format and is suitable for web pages—all silly, of course. The many other options and their results may well keep you busy for hours.

You might also want to take a moment to read the README file because that isn't nonsense. Although it is. Sort of.

You can read this and other Linux and Free Software articles over at CookingWithLinux.com .

14
May

Firefox Gestures

Firefox is default Web browser in many Linux distributions and one of the most popular browsers around. Firefox is an excellent browser on many counts, but one if its coolest features is its ability to add features and capabilities through a system of extensions. A good thing too, at least from the perspective of this discussion. You see, gestures aren't built in to Firefox, so we need to get them elsewhere and we do that by installing an extension. Extensions are program enhancements that can dramatically change how you work with your browser. This framework of extensions makes Firefox not just a great browser, but a superior browser; extension support is another idea that has legs. But I digress . . .

To experience Firefox gestures, we're going to find a suitable add-on (or extension) for gestures -- yes, there's more than just one. Click Tools on the menu bar and select Add-ons. A new tab will appear with a list of categories running down the left side from which you can manage your extensions, change the browser's appearance, and more. To see a list of the extensions already in your system, cilck Extensions. On a fresh install, there is usually only a handful of things here. To find ourselves an extension that does gestures, click on "Get Add-ons" then type the word "gestures" in the search bar. You'll see FireGestures listed there; to find out more about the extension, click the More link which is to the right of the Install button. You'll get a defailed description about the extension you're looking to install (see Figure 1).

Figure 1: The Firefox Add-on window lets also lets you search for extensions, like FireGestures.

Click "Install now" to finish the installation. And no, I won't repeat the joke about the user who is asked whether he read the End User License Agreement (his answer is, "Sure, it said click OK to continue") That's it. You must now restart Firefox to activate FireGestures; there's a link telling you to restart so go to it.

Using this extension, you can use your mouse to move forward or back in your history, open or close a new tab, and pretty much do anything you would with keystroke or by manually navigating the menu. There are many gestures pre-configured allowing you to work with FireGestures as is. Gestures are typically entered by clicking and holding the right mouse button and tracing out a path which is highlighted in green. The mouse trail color is of course configurable via the extensions preferences dialog which you can access with its own gesture (see Figure 2). Click and hold the right mouse button and trace left, then down, then right, then up, then left again (LDRUL) or click Tools, Add-ons, then select preferences from there.

Figure 2 : Open the FireGestures preferences with gestures; left, down, right, up, and left.

Once the preferences dialog appears, it provides you with three main sections via a top icon bar. These icons are labeled "Main", "Mapping", and "Advanced. (see Figure 3).

Figure 3 : FireGestures has a gesture activated preferences dialog.

Under the Main section, you may want to change the color of the mouse trails, change its size, or turn it off altogether. This is also where you can select the mouse button to use should you decide that the right mouse button doesn't work for you. One I find particularly useful is the gesture timeout. The idea here is that if you start a gesture and don't complete it in some defined period (a few seconds), the gesture is ignored.

To find out, change, or add to the list of gestures, click the Mapping button at the top. You'll see a huge list of common browser functions and the mouse movements needed to achieve them (see Figure 4). Each gesture is mapped using single letters to indicate direction. It's pretty easy to figure remember; up is "U" and down is "D", left is "L", and right is "R". Move forward with a right motion and back with left flick of your mouse. Zoom into the text by moving left, right, then up. Left, right, then down zooms out. It doesn't take long to get the hang of this and after a while, it all seems perfectly natural.

Figure 4 : Each gesture is mapped using single letters to indicate directions.

Down at the bottom of the mapping options, and on every tab, and on every tab actually, there's a blue link that says "Get Scripts". On the FireGestures site, there are a number of gesture sequences (or scripts) that do things not included in the extension's main package. Adding these scripts is pretty easy; make sure the mapping options are open, visit the site, then drag the script that interests you into the mapping window. It's that easy. If you'd rather create your own gesture, click the "Add Script" button.

I'll let you explore the advanced tab which gets into things like mapping the buttons, and using features like mouse wheels with left/right rocker buttons and so on. But for now, that's it. That is how you enable gestures in Firefox.

03
Apr

How Linux Is Built

You may not know it, but you use Linux every day. 

19
Jan

Sanitized For Your Protection

Over the next few days, visitors will be treated to some changes. The first, and fairly obvious change, is that I've changed the look. In point of fact, I have completely reloaded the old "Marcel Gagné, Writer and Free Thinker at Large" site so that it's modern, up to date, and basically doesn't give me errors because I'm still paying for some experimental site work I did years ago that didn't quite work out. So the look will hopefully be something you enjoy as well. Then, there's content.

The first problem with content is that migrating comments was somewhat more difficult than migrating my blog and various articles from the site. Meaning that a lot of older comments may be gone forever (for this, I apologize but if you really need to check on what you said, I've kept a copy of the old site, locked in its last incarnation, at old.marcelgagne.com. Now, given that this is my personal Website, I feel that I can talk about whatever my little heart desires. And I do. A lot of the content has to do with Linux, Free and Open Source Software, a subject on which I am rather passionate, having written six books and several hundred articles for several different magazines.

But I also write about other things . . . 

These 'other things' include, but are not limited to, current events, science, politics, publishing, religion, atheism, and whatever else catches my attention including videos of little children facing off against Darth Vader. On some of these topics, most notably religion and politics, I may offend some of you. I consider this a good thing. Not because I like to offend people, but because it means I wrote about a subject that stirred something in you that you may not have wanted stirred, something that might be of value if you choose to explore the reasons why it offended you. This is all open to interpretation, much of it by you, the reader.  

All that said, I accept that you may not be coming to read my stuff because you want to hear me talk politics but because you want to learn or read about Linux and Free and Open Source software. To that end, I will from this moment on, post all Linux and FOSS stories to my Cooking With Linux site as well as here. If you just want the Linux/FOSS stuff without the extraneous attitude on other topics, stick with Cooking With Linux. Be warned, however, that I do occasionally include wine reviews on that site.

Hey, I'm only going to sanitize so much here.

Comments

Subscribe to RSS - Linux