Like most people I use CUPS for printing and the cups-bsd package for printing from the command line.
Printing like this:
lpr filename
Resulted for some reason had started producing this error:
lpr: Error - no default destination available.
The command
lpstat -pgave a list of printers available. From this list choosing one to be the default fixed the problem:
lpoptions -d printername
Cool!
Posted: 4 February 2010 @ 21:30 GMT
Trying to upgrade TeX I got this error:
dpkg: error processing /var/cache/apt/archives/texlive-binaries_2009-5_i386.deb (--unpack):
trying to overwrite `/usr/share/man/man1/dviselect.1.gz', which is also in package dviutils
The fix was to force the overwrite like this:
sudo dpkg -i --force-overwrite /var/cache/apt/archives/texlive-binaries_2009-5_i386.deb
And then:
sudo apt-get -f install
Hopefully that won't cause problems in the future.
Posted: 4 February 2010 @ 21:14 GMT
This is how you can extract audio from a video file, without changing the encoding of the audio:
ffmpeg -i input.avi -vn -acodec copy output.mp3
Of course, change the extension of the output file to reflect the correct encoding!
Posted: 27 January 2010 @ 16:54 GMT
Converting a DivX .avi format video to a digital video .dv format is something that I need doing sometimes.
This is something that I just need to put on my really-important-commands list:
ffmpeg -i divx-input.avi -target pal-dv digital-video-output.dvPosted: 22 January 2010 @ 11:32 GMT
The Debian package system rocks. It really does.
Except when it breaks.
I used to always run a Debian unstable system because I figured that the occasional stability problems were a price worth paying for having up-to-date software.
But then suddenly, everything went wrong. And it was all the fault of KDE4.
I'd always been a KDE user. I much preferred all the options that KDE gave me above the false simplicity of GNOME. As KDE moved to version 4, so did Debian Unstable. I found KDE4 barely workable. After much agonising, I switched to gdm, openbox and fbpanel for my desktop. However, there were still some KDE applications I wanted to use like Amarok and Dolphin which I think is a great file manager.
To get usable versions of this software, I needed to use versions from Debian's 'testing' repository, so for the first time I was running a mixed Debian testing/unstable system.
It wasn't long before things started to break. It all really went wrong, when 'apt-get' wouldn't install anything at all and 'aptitude' would not install a range of KDE updates. The problem was that many KDE install scripts would try to run the update-mime-database script and it would exit with an error.
I poked around the system for awhile. I found out that many of the KDE packages were calling 'update-mime-database', which threw a non-recoverable error when it encountered '/usr/share/mime/packages/network.xml'.
Doing:
mv /usr/bin/update-mime-database /usr/bin/update-mime-database.bak
Fixed this.
Once this was done I could update the script:
sudo aptitude install shared-mime-info
And then update various KDE packages:
sudo aptitude install kmail
Seems to work so far.
Posted: 29 November 2009 @ 21:25 GMT
Say you get this error when you try to update your list of Debian packages:
W: There is no public key available for the following key IDs:
4D270D06F42584E6
W: You may want to run apt-get update to correct these problems
This is the way to fix it:
sudo aptitude install debian-keyring debian-archive-keyring
Easy!
Posted: 4 November 2009 @ 10:34 GMT
Do software reviewers need to use the software they are provided with it before they use it?
Not if you're the BBC's Rory Cellan-Jones. Then you play the faux-naif game that technology is so awfully complicated, that twits like a technology correspondent couldn't possibly use it.
This is what Cellan-Jones does with a ridiculous slamming of Ubuntu. You might think that this "technology correspondent" might use a technology during the review. But no that would be too much for the him:
I struggled to work out how I would organise photos, music and video with this system.
Really. F-Spot, RhythmBox, Kaffeine, VLC. This has to be one of the most pathetic put downs by anyone in the media ever.
Why does the BBC employ people like him? Oh, wait that's right, it is well documented that the BBC is a Microsoft front. By promoting Microsoft product, Cellan-Jones is doing his job.
This is your telly-tax at work.
Posted: 27 October 2009 @ 19:32 GMT
My system had just upgraded to mysql 5.1. I hadn't intended to upgrade. It was just one of those things that happens when you are trying to upgrade one or two packages on a Debian unstable system and find out that everything breaks.
The end result of this breakage was that mysql was uninstalled.
I needed to reinstall it:
aptitute install mysql-server mysql-client
It seemed to work. But if I (as 'root') tried to grant privileges to another user I got that 'access denied' error. What was going on?
The answer seems to be that when mysql was unintentionally uninstalled, it left the existing database files in place and when version 5.1 was installed it started accessing these old, slightly incompatible files. Running:
mysql_upgrade -u root -p
fixed the problem.
Then a second problem presented itself. The maintenance user 'debian-sys-maint' couldn't access the database. This is a fairly common and often discussed problem.
Logging into mysql as the root user:
mysql -u root -p mysql
and granting privileges to 'debian-sys-maint':
GRANT ALL PRIVILEGES on *.* to 'debian-sys-maint'@'localhost' IDENTIFIED BY '<password>';
where <password> is the password listed in /etc/mysql/debian.cnf fixed the problem.
Posted: 15 September 2009 @ 11:08 BST
I've been getting this error recently:
W: There is no public key available for the following key IDs: 9AA38DCD55BE302B W: There is no public key available for the following key IDs: 9AA38DCD55BE302B W: GPG error: http://ftp.cz.debian.org etch Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B W: You may want to run apt-get update to correct these problems
The way to fix it was to run these commands:
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 9AA38DCD55BE302B sudo apt-key add ~/.gnupg/pubring.gpg sudo apt-get update
Posted: 27 May 2009 @ 16:48 BST
Finally, after years of being harangued at how great Linux was compared to the evil Windows, my wife asked me to install Linux on her new laptop a HP Pavilion DV5-1020.
I'm a Debian user and on desktop machines I run 'sid'. For me this is appropriate, because sid gives me the latest technology and any problems that sid causes, I can either cope with or fix. For my wife, however something with a good GUI and preferably and 'just works', would be prefereble. I therefore chose Ubuntu.
I haven't used Ubuntu much, but my previous dabbles confirmed the hype that everything 'just works'. Was my experience this time as positive? And does Ubuntu deliver is it really the distro for non-technical users?
The Ubuntu installer is very good. Mostly, you just keep hitting 'return'. The partition system that it chose - shrinking Vista and installing Ubuntu on one big partition - was the one we went with.
The initial installation was so easy that I thought there was absolutely no point writing one of these how-I-got-Linux-running-on-such-and-such-a-laptop type posts. In fact, would anyone ever have to write one of those posts ever again? Yes, they certainly will.
Everything seemed to work well until I tried suspend/resume.
Firstly, on resume the built-in keyboard and mousepad where unresponsive, but aUSB keyboard and USB mouse both worked.
The fix was to upgrade the BIOS firmware from F.07 to the latest version at the time of writing F.32. This involved booting into Vista, downloading the firmware updater and running it. This is something that a non-technical user just can't do. Ubuntu therefore fails at the first hurdle for a non-technical user.
On resume there would be no network connectivity. However, subsequent hibernating/waking up causes the network to come back up.
At first I thought this was something to do with the r8169 driver for the RTL8111/8168B card.
So I tried the official r8168 RealTek module as explained here and here.
Switching the driver did not help. The kernel driver, r8169, therefore appears to work and the bug is probably something to do with ACPI.
Wireless doesn't work. The laptop runs the Atheros AR242x chipset. There is a discussion of this issue here.
It is reportedly fixed in Jaunty.
Oftentimes, webcams don't work well in Linux. This one appears to work flawlessly.
The Ubuntu generic kernels are big, very big. This is because they include absolutely everything. It also take hours to compile one, even on a dual-core AMD64. It make sense, therefore to custom compile. Ubuntu advises against it. This is bad advice, IMHO.
The HP DV5-1020 is not a good choice candidate for an Ubuntu Intrepid Ibex install. There are too many unresolved issues, may of which may not be solved for several months at the very least.
The experience has been salutary for me, as it shows that Ubuntu is not a panacea for desktop Linux. In fact, claiming that it is a newbie's distribution and then failing to run properly, may harm Linux take-up.
What is needed for Linux, and especially for Ubuntu, is to work with manufacturers who can confirm that their hardware is "Ubuntu ready" in the same way that they confirm hard where to be "Vista ready". This would require a team to work closely with manufacturers.
The Ubuntu GUI really shines however. In my view, it is several orders of magnitude better than either XP or Vista. The widgets are easy to find, easy to use and the setup is intuitive.
Posted: 19 April 2009 @ 15:27 BST
Here's how you change your time zone in Debian:
sudo dpkg-reconfigure tzdataPosted: 11 April 2009 @ 08:09 BST
My previous attempt to fix mplayer sound problems only worked sometimes. I looked up mplayer's configuration log file 'configure.log' and found that mplayer had been compiled with OSS sound but not ALSA sound.
This is the fix. Get the latest mplayer source:
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
Install the necessary development libraries, in particular the one that contains the alsa sources:
apt-get install libasound2-dev libxv-dev libxinerama-dev libgtk2.0-dev
then:
cd mplayer make make install
It works now.
Posted: 1 April 2009 @ 21:35 BST
In a shock move, today April 1st, Microsoft has announced that it will make the source code to Windows freely available under version 3 of the GNU Public License.
Steve Ballmer, CEO of Microsoft explains it like this, "I was using my laptop in Starbucks as I usually do; recovering from blue-screens of death, dealing with viruses and so on, when I saw someone else was using a sleek, lean, robust operating system."
That operating system was Crux Linux. Ballmer has now become a devoted user.
"I realised there and then that Windows was just rubbish and that we'd been conning the entire world. Microsoft wants to turn over a new leaf," he says.
All senior management at Microsoft have started using Linux for day-to-day tasks, but converting some of the developers and IT support staff at the software company has been more difficult.
"We're getting there," says Ballmer, "but some software developers are a bit stupid. They think they might lose their jobs."
The most recalcitrant body has, however, been the Business Software Alliance, the tax-farming organisation. It sees its whole existence under threat and there has been dark rumours of a coup d'etat to bring back the old order.
Microsoft has often been regarded as the bully-boy of the IT world using its armies of lawyers and substantial cash pile to sue anyone it didn't like into submission.
"Those days are over," says Steve Ballmer, CEO of Microsoft, "from now on it's Mr Nice Guy."
Posted: 1 April 2009 @ 09:27 BST
For a while, I've had a problem with mplayer.
If there was another application using the sound system, e.g. firefox, then mplayer would not produce any sound. If I paused mplayer, watched something, say on youtube.com, and then restarted mplayer, mplayer would crash.
There is a fix. That is to add this line to ~/.mplayer/config:
ao=alsa:device=ch51dup
Posted: 28 March 2009 @ 17:48 GMT
Now that I'm starting to use Openbox, and all these people post their cool desktops all over the Internet, I figure that I want a cool desktop too.
This requires certain things: control over the background and window decorations, the ability to have transparent terminals and of course the ability to change text colour in the terminals.
I've used konsole a lot as I like the 'tabbing' feature. However, konsole doesn't seem to do transparency at all in OpenBox. So, I've started to use urxvt.
There's a good rxvt configuration guide here
I found however, that clicking on the 'terminal' button in my taskbar still brought up konsole. The trick is that Debian uses a series of symlinks in /etc/alternatives to set up preferred applications. This command is how to update the default terminal emulator:
sudo update-alternatives --config x-terminal-emulator
and choose rxvt from the options.
There is a lot of discussion on various mailing lists about 'true transparency' which means you can see windows under the current window. This is really useful when you want to read and type at the same time. Anyway, I haven't been able to get it to work.
Posted: 25 March 2009 @ 10:41 GMT
Kmandla wonders why anyone reads his blog.
But there is a lot of the Internet that escapes me. Blogging is a perfect example. Why anyone would care or want to sift through the dreck I post here is confusing too.
Well, I can tell him. He writes very well on interesting Linux topics. In particular, he writes about getting low power machines doing something useful.
So far, kmandla has encouraged me to do two things:
Openbox the lite-weight desktop manager that is extremely configurable. It also has some beautiful themes. So open box is great. I have one major problem. How do I get konsole, and for that matter other terminal emulators to have transparent backgrounds?
Posted: 23 March 2009 @ 14:40 GMT
I was doing some random browsing and came across this; an article called "A Collection of the Best Linux Commands". It lists a few command line commands, such as 'hostname'. I'm a little confused about this - I understand that the hostname command is useful, but is it one of the 'best'?
It also lists 'whoami' which, I often find useful as I am always forgetting who I am. Some others I use all the time include top, du and df as well as cat.
However, there is something really wrong with the list. Take for example these:
du / -bh | more
ps axu | more
I mean who, in this day and age, uses 'more'? Everyone knows that less is more so I really doubt the writer's l33t status.
Posted: 20 March 2009 @ 14:47 GMT
How to switch the keyboard layout in X from the commandline:
setxkbmap xx
Where xx is the country code.
Posted: 19 March 2009 @ 20:45 GMT
Glyn Moody has an excellent blog entry on Microsoft's EU lobbying. It shows the way that Microsoft is rewriting EU policy documents to destroy, as far as it can, open source. The complete document can be found at the excellent Wikileaks.
Most telling, to me, are the passages that Microsoft deleted from the original document:
Over the past years it has become clear that specific patent licensing schemes, most importantly the so-called "RAND" 7 terms, discriminate against OSS implementation. This issue complicated the recent antitrust cases in Europe and was subject of a specific workshop on "IPR in ICT standardisation" 8 organised by DG Enterprise.
The workshop revealed a fundamental incompatibility of RAND models with OSS implementations, as well as a very controversial debate around this issue. From the perspective of OSS adoption,9 it could be said that RAND conditions fall short of the Common Patent Policy of ITU-T, ITU-R, ISO and IEC, which states that "a patent embodied fully or partly in a Recommendation | Deliverable must be accessible to everybody without undue constraints."
[...]
A recent development, which deserves the careful attention from the Commission, is the use of unsubstantiated threats of intellectual property rights infringements against those who attempt to develop interoperable software products. As an example, a major software company has publicly stated that it believes Linux and other open source software infringes 235 of its patents, but has never identified any of these patents.
Vague claims by patent holders that open source software may infringe their patent rights should be obliged to identify supposedly infringed patents or cease to make unsubstantiated allegations. This would prevent patents from being invoked to spread fear, uncertainty and doubt ("FUD") against open source software products in the minds of both developers and users. The behaviour of creating FUD against open source software solutions should not be tolerated, as it amounts to an anticompetitive strategy aimed at distorting conditions in the marketplace to the detriment of OSS products.
Here the original EU document clearly references the actions of Microsoft and its minions. Microsoft removed any reference to its actions.
These developments are clearly very serious for FOSS. Making these documents and Microsoft's methodology widely known is the only way to fight back. Please pass these links on.
Posted: 19 March 2009 @ 20:16 GMT
Here's a way to a line of text to all files in a directory:
sed ' /text on previous line/ a\ text to be inserted after ' files
Posted: 16 March 2009 @ 13:06 GMT
ACPI administration advocacy advocacy advocacy opinion alsa apache apple apt aptitude audio authentication awk bash business cache calendar censorship commandline cron database debian desktop development disk dvd economics emacs email europe exim files firefox firewall flash foss freedom ftp fun git grub hardware hardware html images installation ipod kde kernel keyboard knoppix laptop latex locale lockin longlines microsoft mplayer multimedia mysql network nfs openbox openoffice opinion opinion partition pdf perl php politics postgresql printing privacy rant rxvt script scripting scsi security sed server shell siteadmin sitenews sitesoftware skype skype slackware sound spam ssh subversion sudo svk swap t23 t43 terminal text thinkpad thunderbird time timezone ubuntu users versioncontrol video windows wine wordpress wordprocessing xwindows xwindows youtube