29 November 2011

Debian Testing or Sid: KDE can't mount USB drives (Fix)

I've had my system stop allowing KDE to mount files. Why? UDisk and PolicyKit stuff, dunno. Here is the fix though.  To fix this, become root:
shell$ su -
edit the file at:
shell# vim /usr/share/polkit-1/actions/org.freedesktop.udisks.policy
and change the stanze which reads similar to this (note I had to remove all of the < due to blogger.com thinking I was entering code) :

action id="org.freedesktop.udisks.filesystem-mount">
    description>Mount a device /description>
    description xml:lang="da">Montér en enhed /description>
    description xml:lang="de">Gerät einhängen /description>
    message>Authentication is required to mount the device /message>
    message xml:lang="da">Autorisering er påkrævet for at montere et fil system /message>
    message xml:lang="de">Zugriffsrechte werden benötigt um das Gerät einzuhängen /message>
    defaults>
      allow_any>no /allow_any>
      allow_inactive>no /allow_inactive>
      allow_active>no /allow_active>
    /defaults>
  /action>
    
  
to now read (note the bold parts, which are the changes):

action id="org.freedesktop.udisks.filesystem-mount">
    description>Mount a device /description>
    description xml:lang="da">Montér en enhed /description>
    description xml:lang="de">Gerät einhängen /description>
    message>Authentication is required to mount the device /message>
    message xml:lang="da">Autorisering er påkrævet for at montere et fil system /message>
    message xml:lang="de">Zugriffsrechte werden benötigt um das Gerät einzuhängen /message>
    defaults>
      allow_any>yes /allow_any>
      allow_inactive>no /allow_inactive>
      allow_active>yes /allow_active>
    /defaults>
  /action>

If this helps you at al please let me know!  Note, the next installation of the udisks package will overwrite these changes.

28 November 2011

Debian Sid+ gets KDE 4.7.2: install instructions

Note: KDE 4.7.4 is now (2011 12 20) available in Debian Experimental

After months of idling at KDE 4.6.5, the Debian-KDE team has made 4.7.2 available in the Experimental repositories. Unfortunately, KDEPIM apps such as KMail are still not ready for Debian:
From: José Manuel Santamaría Lema
Date: Sat, 26 Nov 2011 16:35:55 +0200
While developing the 4.7 packages our fellow developer Eshat Cakar experienced some important problems with kmail.
On the other hand, kdepim 4.4.x wasn't tested against 4.7 by upstream KDE developers (unlike what happened with the 4.6.x releases). Therefore, this may raise some new bugs. In hope that we are choosing the lesser of two evils, we are skipping kdepim 4.7 for now.
Last but not least, note that kdepim developers work on one of the most "dangerous" module (this module can chew users' data if there are important bugs) so be patient with them, they deserve our respect.
The package maintainers absolutely deserve our respect; packaging software isn't an easy task.

You need to be running a fully-updated Debian Sid on AMD64 (aka x86-64 aka x64) to successfully install these packages, and be willing to experience possibly more breakage than Debian Sid itself provides. Sure, Sid treats us well, but if you're not willing to take the chance, I suggest you wait. If you're OK with running Experimental packages and not having the newest KDEPIM yet, let's install KDE 4.7.2 on Debian x64UPDATE: i386 packages are now available.


First, upgrade your system to the newest Sid has to offer:
# aptitude update
# aptitude dist-upgrade

Second, add these repositories to your file at /etc/apt/sources.list:
deb http://qt-kde.debian.net/debian experimental-snapshots main
deb-src http://qt-kde.debian.net/debian experimental-snapshots main

Third, update your catalog to include the new repository:
# aptitude update

Fourth, install the key to trust these packages:
# aptitude install pkg-kde-archive-keyring

Finally, install your packages by defining the release with the -t flag:
# aptitude -t experimental-snapshots upgrade

Log out of KDE and from the KDM menu (where you log into KDE), restart the X11 Server and then log into your KDE 4.7.2!   Or, you can reboot the full computer, but that is overkill.


How well did this work? How do you like KDE 4.7.2? Please leave us some results!  UPDATE: i386 packages are now available.

21 November 2011

Linux Hardware: External SATA Drive Dock (USB3)



I recently purchased an External Drive Dock for work; this allows me to plug 2 SATA drives into my USB3 card, power on the dock, and mount (up to) two internal hard drives as if they were normal USB drives.

This Cavalry "Retriever" Series is the second Cavalry dock I've owned, the other being a perfectly-functioning USB2 dock.  But while buying new hardware, we wanted to get the newest and fastest, so USB3 it was, in conjunction with this great USB3 card.

The USB3 Cavalry dock works perfectly in a USB2 port as well, and isn't any slower than it should be, meaning that there aren't any USB3/USB2 compatibility issues.

Another cool aspect of the Cavalry Retriever series, although we've not yet used it, is that it allows one to plug two dries in and duplicate one drive to the other.  Very cool to be able to do drive duplication without even needing a full-blown OS.

The Cavalry wasn't our only attempt at this; we tried with a Sabrent DSH-USB30 dock but it couldn't maintain the USB3 connection, and I don't recommend it.  I was getting many kernel errors (Linux 3.0.x) in dmesg while I was using the Sabrent on my Debian Sid system, such as:

 xhci_hcd 0000:02:00.0: WARN: Stalled endpoint
USB3 is a relatively new technology.  Linux has drivers for USB3 before the other OSes, but that doesn't mean the manufacturers are making great hardware yet.  Stick with what works.

19 November 2011

HowTo: Use Amarok as an Alarm

This was a requested HowTo and I hope that it helps you also!   Thanks much for the IRC people in #Debian-KDE on irc.debian.org to assist with the X11 display stuff when I was first fighting this.

In today's HowTo, we're going to write a script to start Amarok playback on a schedule.  You can play a streaming URL, as I do for a Friday afternoon Science Friday program which I like on NPR, or you can play a local file, or you can just have Amarok start to play whatever is at the top of its playlist.

This is a two-part task; first we need to write the script that will call Amarok, and second we need to create the Cron entry to have something start at a specific time.  This probably could be written as one line in Cron but this is how I have it working.

First, create your script.  I have it stopping Amarok with the -s flag, and then starting the URL that I want Amarok to play.  (See other Amarok options at the command line with amarok --help ). I append the URL so that my playlist isn't wiped out.  Create this file and save it somewhere, such as in your ~/scripts/ folder (note that the second amarok call has a URL listed, in case it gets a line break — this is only 5 lines long, see the screenshot)

#!/bin/bash
# Script to start Amarok, info at gnuski.blogspot.com
# http://gnuski.blogspot.com/2011/11/howto-use-amarok-as-alarm.html
DISPLAY=:0 /usr/bin/amarok -s
DISPLAY=:0 /usr/bin/amarok http://minnesota.publicradio.org/tools/play/streams/news.pls
exit

Here it is as a screenshot for formatting purposes, slightly different as it doesn't have the above comments:


Save that file (we'll call it ~/scripts/amarok_alarm.sh for this example) and make it executable, and let's tighten it by removing other people permissions as well (we don't need them changing our file to execute something evil!).  You can run these commands, or right-click on the file and adjust its permissions:
linux-prompt$  chmod u+rwx ~/scripts/amarok_alarm.sh
linux-prompt$  chmod go-rwx ~/scripts/amarok_alarm.sh
You should be able to test this at the command line if you wish; running this should start Amarok's playback:
linux-prompt$  ~/scripts/amarok_alarm.sh
OK, we got that working.  Now we set up the Cron entry; again you can use crontab -e to edit your Cron Table, or you can use the KDE Task Scheduler (package named kde-config-cron) or something like that.

With KDE's Task Scheduler it looks like this:


In the crontab itself, it looks like this (crontab -l to see the cron table):
# m h  dom mon dow   command
#Start playing Science Friday
0 13 * * 5      /home/lefty/scripts/amarok_alarm.sh

Notice in the Cron Table, you have the Minutes column listed first (0), then the Hours column (13, aka 1pm). then the Date of Month (and number works for me), then the Month (all months), then the Day of Week (Fridays is when this program airs, and Friday is set with a 5).  If you're not familiar with Crontab, I suggest you check out this article.

I hope that you found this article useful and please let me know if I can improve it or let us all know how you've put it to use!  It's important to note that the computer must be powered on and not asleep, it must have internet access if you want to stream, it must have speakers...

18 November 2011

HowTo: Using Aptitude to Minimize Software Bloat in Debian, Ubuntu

In my recent writeup of Specific Debian Package Installation, I came across an article by Jeff Hoogland about minimizing bloat when installing software with apt-get.  Here is the same thing, but with our friend aptitude:

root-shell#  apt-get install --no-install-recommends packagename
root-shell#  aptitude install --without-recommends packagename

Using the above --without-recommends flag to install the metacity window manager (usually used on GNOME and so my KDE systems don't have it), aptitude wants to install 98 packages when it pulls in the recommended apps and libraries, and their recommended apps and libraries, and so forth:
root-shell#   aptitude install metacity
The following NEW packages will be installed:
 alacarte{a} app-install-data{a} brasero{a} brasero-common{a} capplets-data{a} deskbar-applet{a} desktop-base{a} desktop-file-utils{a}
 evolution-data-server{a} evolution-data-server-common{a} gnome-about{a} gnome-applets{a} gnome-applets-data{a} gnome-control-center{a}
 gnome-desktop-data{a} gnome-dictionary{a} gnome-doc-utils{a} gnome-icon-theme{a} gnome-media{a} gnome-media-common{a} gnome-menus{a}
 gnome-netstatus-applet{a} gnome-panel{a} gnome-panel-data{a} gnome-power-manager{a} gnome-session{a} gnome-session-bin{a} gnome-session-common{a}
 gnome-settings-daemon{a} gnome-system-monitor{a} gnome-user-guide{a} gnome-utils-common{a} gstreamer0.10-plugins-ugly{a} gvfs-backends{a} hwdata{a}
 libbrasero-media0{a} libburn4{a} libcamel1.2-14{a} libcdio-cdda0{a} libcdio-paranoia0{a} libebackend1.2-0{a} libebook1.2-9{a} libecal1.2-7{a}
 libedata-book1.2-2{a} libedata-cal1.2-7{a} libedataserver1.2-13{a} libedataserverui1.2-8{a} libegroupwise1.2-13{a} libexempi3{a} libgdata-google1.2-1{a}
 libgdata1.2-1{a} libgdict-1.0-6{a} libgmime-2.4-2{a} libgnome-desktop-2-17{a} libgnome-media0{a} libgnome-menu2{a} libgnome-window-settings1{a}
 libgnomekbd-common{a} libgnomekbd4{a} libgucharmap7{a} libgweather-common{a} libgweather1{a} libisofs6{a} libmetacity-private0{a}
 libnautilus-extension1{a} libnet-dbus-perl{a} liboil0.3{a} liboobs-1-4{a} libpanel-applet2-0{a} librsvg2-common{a} libsidplay1{a} libslab0a{a}
 libtie-ixhash-perl{a} libtotem-plparser17{a} libtracker-client-0.8-0{a} libunique-1.0-0{a} libupower-glib1{a} libxml-parser-perl{a} libxml-twig-perl{a}
 libxml-xpathengine-perl{a} metacity metacity-common{a} nautilus{a} nautilus-data{a} python-gconf{a} python-gmenu{a} python-gnome2{a} python-gnomeapplet{a}
 python-gnomedesktop{a} python-gnomekeyring{a} python-libxml2{a} python-pyorbit{a} python-wnck{a} system-tools-backends{a} upower{a} xsltproc{a} yelp{a}
 zenity{a}
0 packages upgraded, 98 newly installed, 0 to remove and 23 not upgraded.
Need to get 126 MB of archives. After unpacking 330 MB will be used.
Do you want to continue? [Y/n/?] n
Abort.
Using --without-recommends, aptitude only pulls in 3 packages to install metacity, and the chain of dependencies has shrunk considerably.  Much better:
root-shell#  aptitude install --without-recommends metacity
The following NEW packages will be installed:
 libmetacity-private0{a} metacity metacity-common{a} zenity{a}
The following packages are RECOMMENDED but will NOT be installed:
 gnome-session lxsession openbox xfce4-session
0 packages upgraded, 4 newly installed, 0 to remove and 23 not upgraded.
Need to get 6,107 kB of archives. After unpacking 17.9 MB will be used.
Do you want to continue? [Y/n/?] n
Abort.
root-shell#  

Thank you Jeff Hoogland for the insight into apt-get and the inspiration for this HowTo!

HowTo: Use APT or Aptitude to install specific packages (Debian, Ubuntu)

Debian's APT, the Advanced Package Toolkit, is a fantastic command-line frontend for the dpkg package handler.  Together with 'aptitude' and 'the 'apt-get' families of tools, Debian's package installation and dependency handling is a very powerful set of tools to keep your OS and software updated.  There are graphical frontends to APT and dpkg, such as Synaptic, but today we're working with the CLI.

As I mentioned, dependency handling on Debian and its derivatives (such as Ubuntu) is a breeze.  What happens when you need a specific version of a program, however?  What if an update breaks an application because, say, your website requires a specific version of PHP or your SingleClick UltraVNC client will only connect to a specific version of XTightVNCViewer?  The APT family of tools can help you to find specific versions of software, install those versions, and hold (or pin) that software version.

First, of course, let's update our catalog of available software.  I use 'aptitude' for this and as many installation options as I can, since aptitude has better dependency handling than apt-get.  (aptitude is also a bit more finicky, so if it doesn't like my upgrade path, sometimes I'll bypass it with apt-get.  Anyways...)  So first, we update our catalog:

root-shell# aptitude update
Hit http://debian.uchicago.edu squeeze Release.gpg
Ign http://debian.uchicago.edu/debian/ squeeze/contrib Translation-en                                                                                           
Ign http://debian.uchicago.edu/debian/ squeeze/contrib Translation-en_US                                                                                        
Ign http://debian.uchicago.edu/debian/ squeeze/main Translation-en                                                                                              
Ign http://debian.uchicago.edu/debian/ squeeze/main Translation-en_US                                                                                           
Ign http://debian.uchicago.edu/debian/ squeeze/non-free Translation-en                                                                                          
Ign http://debian.uchicago.edu/debian/ squeeze/non-free Translation-en_US                                                                                       
Hit http://debian.uchicago.edu squeeze-updates Release.gpg                                                                                                      
Ign http://debian.uchicago.edu/debian/ squeeze-updates/contrib Translation-en                                                                                   
Ign http://debian.uchicago.edu/debian/ squeeze-updates/contrib Translation-en_US                                                                                
Hit http://security.debian.org squeeze/updates Release.gpg
...
...
...
root-shell#  

We'll use 'apt-cache policy' to see which versions of a package we have; for an example with ffmpeg, we have:

root-shell#  apt-cache policy ffmpeg
ffmpeg:
  Installed: 5:0.7.7-0.0
  Candidate: 5:0.7.7-0.1
  Version table:
     5:0.7.7-0.1 0
        500 http://www.debian-multimedia.org/ squeeze/main i386 Packages
 *** 5:0.7.7-0.0 0
        100 /var/lib/dpkg/status
     4:0.5.5-1 0
        500 http://security.debian.org/ squeeze/updates/main i386 Packages
     4:0.5.4-1 0
        500 http://debian.uchicago.edu/debian/ squeeze/main i386 Packages

This output gives some very specific information.  There are four versions available, three of which aren't installed with their 'apt preference' set to 500 (more on that in the upcoming HowTo: Pinning Debian and Ubuntu Packages), and the installed version (marked with ***) with its apt preference set to 100.

We also get to see the repository for each package, in case we want to use a specific maintainer's package (such as the Debian Multimedia repository).

If we needed to install a specific version from the above list, we can specify that with:

root-shell#  aptitude install ffmpeg=4:0.5.5-1

This works with 'apt-get install ffmpeg=4:0.5.5-1' as well, which will have different dependency handling; I try to only fall back to apt-get if aptitude is really looking for trouble and wants to remove things that I think it shouldn't.  I'm not necessarily right, of course!


I'll write up an article on Aptitude Pinning soon, so stay tuned, readers.  (I have some less focused info here about it).

17 November 2011

Save Tabs when Quitting Firefox 4, 5, 6, 7, 8, 9, 10...

When quitting Firefox, back in the day it offered to save your tabs:
Do you want Firefox to save your tabs for the next time it starts?
Firefox no longer offers to "Save and Quit" by default, but its an easy fix to get Firefox to ask this question again.

Open a new tab and, rather than visiting a website, go to "about:config" (without the quotes).  In the filter bar that shows up, type in "showQuitWarning" (again, no quotes).  Double-click to change the value to "True" and, because this is a modified setting, it should turn bold.  Now, when quitting Firefox (only the last open window tho, not every Firefox window!), you should be offered to save your tabs for the next session.  If you checkmark the "Do not ask next time" box, it will reset your "showQuitWarning" setting.
Click to embiggen

UPDATE: If this change alone doesn't work you may need to also toggle (with a double-click) these settings in that about:config page:
  • browser.tabs.warnOnClose 
  • browser.warnOnQuit 
  • browser.warnOnRestart

This works great on my Firefox 4, 5, 6, 7, 8, and 9, and it should also work on Debian's Iceweasel and other Firefox clones.  If anyone has tips about improving this let us know!

11 November 2011

iPod Filesystem Structure

If anyone is wondering why iPods are a headache, it's partly due to not having a filesystem structure that makes any sense. Look at this image, below: rather than sorting the files as folders like Artist/Album/Songs.mp3, iTunes (and programs that work with the iPod, such as Amarok) needs to work with some crazy database to get the files on the device and labeled in a way that the iPod can read the files. This is why I recommend the Sansa Clip, or really anything other than Apple: Apple tries its hardest to lock you in to what it produces and lock out all other competition.

Click to embiggen

Full-fledged Ubuntu or Debian GNU/Linux on your phone!?




This past week I was introduced to a great Android app: Linux Installer. This sets up a chroot environment with a loop file on your phone which will boot into a full-fledged Debian or Ubuntu OS; between these two distros you can pick among various releases.

I installed the Debian Testing distro and the Linux Installer app walks you through a number of steps to get the loop file created and formatted, mounted, and the OS installed. On my Motorola Cliq, which is somewhat slow in comparison to newer phones, this base install took a few hours and I was happy to have the phone plugged into a power source.

My first installation attempt failed and the step-by-step installer has a button to email the console logs to the developers as feedback.  Within a day, I received a response and an updated Linux Installer was released to patch the error that I experienced.  That, my friends, is FLOSS dedication!  The new version worked perfectly.

Unlike one of the poor Terminal Emulators out there, this is a full-fledged Debian Testing OS.  My coworker installed X11 and tightvncviewer on his phone and was able to remote-access his desktop and interact fully, with a touch screen interface.  Wow!

This changes so much.  Finally I can run a webserver to share files, I can run 'host gnuski.blogspot.com' without permission failures, I can view remote machines and work on them, I can run KTorrent (well, maybe).  Finally, my phone can run the GNU/Linux that I know and love, not the Linux/Android stack that works well but isn't quite what I want it to be.

If you want to install Ubuntu on your phone or Debian on your tablet or something along these lines, I suggest you start with the CyanogenMod ROM to get your device working tip-top and to get the rooted permissions that you'll end up needing anyways.  Then, check out the Linux Installer in the App Market and enjoy!

08 November 2011

Mozilla releases Lightning 1.0 calendar, Thunderbid 8 email client, Firefox 8 browser

Mozilla Lightning, the Calendar plug-in for the Thunderbird email client, has finally reached the 1.0 release today, after years in development. The Thunderbird email client also had a release today, to version 8, as well as Firefox 8.

With Lightning's official 1.0 release, users can finally send and receive appointments tied to emails, like with other PIM solutions such as KDE's Kontact and MS Outlook. Lightning events/appointments are compatible with Google Apps calendar and with other existing calendar platforms, including MS Outlook 2000 SP3 and newer. The Lightning plugin can be installed on older Thunderbird releases, but the Thunderbird 8 release today should be a useful, suggested upgrade to anyone running Thunderbird.

Firefox 8 was also released today, as a part of Mozilla's increased-frequency release schedule. Improvements include better memory management, faster rendering, faster tab loading, and increased search options such as Twitter.

Congratulations to the Mozilla team on their new releases! Readers, any feedback on this software? Do you use Lightning and Thunderbird?

07 November 2011

Reworked KDEnlive has 0.8.4 release coming

KDEnlive, the video editing software for Linux and other *nix desktops, is looking to release version
0.8.4, an update to the recent 0.8.2 push that has unknown bugs which only appeared after the release.  The KDEnlive team is taking two weeks or so to ready this newest version with various bugfixes, and are hoping to make a public release during the week of Monday the 14th November.


After some discussion, the release may be named 0.8.2.1, to reflect that it is just a maintenance release rather than containing new features. Update: release has been planned as 0.8.2.1, more info here


KDEnlive is one of the more advanced FLOSS video editing programs for the GNU/Linux desktop and other *nix workstations.  We've discussed KDEnlive here in the past and the software has improved in its functionality and stability in the last three+ years.  Speedier parts help the experience as well, of course :)