Wednesday, 28 November 2007

Jerky Video off CD .avi in Kaffiene after /hdd Permisison Problems

I've noticed sometimes when I get problems like listed earlier this day (finicky CD/DVD ejecting & unmounting permissions), I get jerky motion when I finally am able to play something like an .avi off the mounted disc. I can stop Kaffiene and even pkill it, but it still continues. The problem stops if I reboot and run the .avi off the cd/dvd again.

Any idea what's going on in the background here? Is there another process I have to kill, or do I simply have to wait a long time before jerkiness doesn't become an issue? Or is reboot the only solution?

CD Will Not Eject, Unmount

  1. burned using k3b
  2. still showed as blank cd-rom on desktop
  3. used physical eject button on cd, closed drive after it opened
  4. tested data on cd: cd showed up with label, file opened
  5. tried to eject (gave error)
  6. tried to unmount (gave error i.e. "error: kio_media_unmounthelper unmount: /media/hdd is not in fstab")
  7. (light on cd-rom drive is flickering)

Solution: If I wait a couple minutes, I can then use right click->eject

I guess other apps aren't releasing permissions to the drive to preven accidental manipulation and use by other programs?

(edit: same dealie with my USB flash stick. I moved files into a directory on my desktop. Well after it was finished, I attempted to right click-> safely remove, and it gave me the same error)

Tuesday, 23 October 2007

PDF Manipulation; Tesseract OCR

Little bit of story to begin.

Working in a small print shop, I've had to deal with pdfs a lot more. One reason is setup: customers bring in all sorts of wonky files at the incorrect finished size and setup. Customers make files in Word, which may spontaneously change formatting (hey... how are WE supposed to know what your document is supposed to look like?) We get a lot on bands printing 11x17 posters, but they also want handbills, which are not set up. "Ready to print" is rarely the case.

Word also likes to not printed coloured backgrounds, even if you tell it to.

For pdf manipulation, I use three main tools: Adobe Photoshop, Adobe Acrobat Professional, and Xerox Freeflow Makeready.

The beauty about Photoshop is that you can actually open up a PDF. It will rasterize the file (essentially "make it into a picture") , which is great if you have you're getting issues with formatting. The downside is that it rasterizes the image. Gone is the editability (is that a word?) of the PDF. Always save as a copy before working on an image!

This concept gives light to the structure of the pdf as well. PDFs are similar in concept to web pages (HTML, if you're familiar with it). The document doesn't contain an image. It is a document explaining the structure of different elements, and how they should be displayed. This is why you are able to search many pdfs.

With extended use of Freeflow, it becomes obvious too that making a document n-up (multiple copies of the same thing in a page) is a function of the markup in the PDF. If you make a document 4-up, the size of the file doesn't change (or does by a miniscule amount). However, if you make a (rasterized) image 4-up and save it as an image again, it gets much larger.

Acrobat Professional is great for some purposes, but some of the tools are clunky to use. Worse still, some tools that look intuitive to use, aren't. Furthermore, it's still buggy. Crop kind of works. The "layers" tab is essentially useless.

Freeflow has some great tools. For example, you can view the contents of a pdf in its layers, and manipulate the layers (you could insert an image which is one colour and move it to the bottom of the layers... making it the background colour). It's also really easy to make things n-up. I'm surprised I don't see this more. Computers can do math much more quickly than we can. As humans, it's not that difficult for us to do (if nice round-numbered measurements are used), but it is time consuming.

Put into perspective the hundreds/thousands of dollars these programs cost and the fact that I still have to switch between them to solve some problems, plus there are still some problems they don't solve...

A large problem I would like to solve:
Collecting some of my images together at home into pdfs. Some of these are just images, some are images of text.

Using Linux, I wasn't about run out and buy a $440 copy of Acrobat Professional. Kpdf is a great lightweight viewer, but that's about all it can do. I supposed I could use a workaround using LaTeX, OpenOffice, or ImageMagick, but that might get tedious or cumbersome. I asked on IRC about ImageMagick, but I couldn't get a definite answer.

I came across some solutions quite by accident.

PDF Hacks contained a solution. Apparently you can make all images in a directory into a pdf with ImageMagick ("hack" 48, p125).
convert -density 100 -quality 85 \ -page "800x800>" -resize "800x800>" *.jpg album.pdf
Well, that's simple. Easy to write as a shell script or program, too.

I came across Tesseract quite by accident. It happened to be a July 2007 Linux Journal article. Tesseract can take a uncompressed tif image and use OCR to port it into an actual text document. It does it with an excellent success rate (97-100%).

The author says he uses it to scan in his textbooks, so he doesn't have to lug heavy books around campus.

Plus: both ImageMagick and Tesseract are free.

Installing and Switching Between Extra Desktops / Window Managers

You don't have to commit to one Desktop style. You can install GNOME, KDE, XFCE (among others), and just switch between them.

  • GNOME is the desktop used in Ubuntu.
  • KDE is the desktop used in Kubuntu.
  • Xfce is the desktop used in Xubuntu.

To switch between the desktops, log out. When you log back in, click the "session" button and select which window manager you want to use. Easy as pie.

To install, you can use Synaptic Package manager, or apt-get (on the command line). However, these methods don't keep track of dependencies, so it's recommended you use aptitude (on the command line) instead:

sudo aptitude update
sudo aptitude install kubuntu-desktop
sudo aptitude install xubuntu-desktop
Link in title as always, or here.

Monday, 17 September 2007

DVD-R Discs Seem Blank After Sucessful K3B Burn

Discs burned as Data DVD with K3B defaults

1st problem: really old version on K3B

Install K3B using directions here:
Make sure requirements are installed.

Great generic howto on K3B burning here:

Similar problem to mine here, ... solution?

Monday, 3 September 2007

Lost Running Applications / Programs in Toolbar

A while ago, I was adding and removing applications from the panel, and the spacing between them got all screwy. Next thing I know my list of running applications is gone.

Couldn't find it for the life of me. Gave up trying to find an answer, said "screw it", and just started using alt+tab to switch between running programs. Still annoying though.

Incidentally, I discovered if you move your mouse cursor over the title (top) of a window that's open, using mouse's scroll wheel will make you switch between the last two windows.


Happened to be on #kubuntu ... and someone there posted a similar problem. To get back your application list in your toolbar / panel:
  1. right-click on toolbar in an empty spot
  2. click "Add Applet to Panel" (this is where you say AHHHHHH!)
  3. click Taskbar and OK.

Import Thunderbird Mail into Kmail

I wanted to import my messages from Thunderbird into Kmail, so I could use Kontact as my entire personal information tool. I could not find a tool anywhere in Kmail / Kontact (or even just right in Kmail) to import mail from another program. After Googling it, I found it should be in Tools -> Import Messages. The odd thing is I didn't have that menu option. Another thing to try is using a tool, but that didn't work for me.

Cliff's Notes:
  • make sure kmailcvt is installed. Use Synaptic Package Manager to get it.
  • then in Kontact/Kmail use File -> Import Messages to import messages from Thunderbird.

Kmail 1.9.1 using KDE 3.5.2

Found some wonky directions here, but that seemed too complicated.

I looked up the Kmail (via the menus in Kontact/Kmail). The help file seemed to be out of date, web address gets rerouted here.

A bit of a beef I have with the Kontact web site is that they don't give you the current revision of the entire package, nor the current revision of the components of the package. I looked at FAQ of the Kontact page. I didn't see a link to an IRC channel, but I tried out #kontact
The channel does exist, but appears to be a small developer's channel. No one seemed to be awake.

The aforementioned script had to be run with
chmod +x
sudo ./
which gave an error that "./home/kat/Mail is not a directory."
To get help you need to type
./ --help
which is different than indicated ("mozilla2kmail --help")! This command gives me
"You need to install the perl-doc package to use this program."
I install perl-doc using Synaptic Package Manager, but I still get ". /home/kat/Mail is not a directory." after doing a "sudo ./"

Did more searching and came up with the Cliff's Notes solution, which works. The only stickler is that when the import runs, it doesn't make it obvious what it wants you to open. I selected the entire mail folder (/home/kat/.thunderbird/fzcc2crp.default/Mail/) which had two folders in it: a "Local Folder" and a " folder." This seems to work.

Sunday, 29 July 2007

Installing Microsoft Truetype fonts on Ubuntu

"You can install the MS core fonts by installing the msttcorefonts package. To do this, enable the “Universe” component of the repositories. This is done by default in Feisty. After you do that, use the following command from the command line:
$sudo apt-get install msttcorefonts
This will give you the core fonts, but if there are other TrueType fonts that you want installed, it is as easy as copying the font files to the ~/.fonts/ directory.

After installing new fonts, you will have to log out and log in again to be able to see and use the new fonts. If you want to avoid this, you can regenerate the fonts cache by issuing the following command:"
$sudo fc-cache -fv

Thanks to Carthik's Ubuntu blog.

Lost Sidebar in Thunderbird (folders & calendar)

While using Thunderbird, I clicked on the left somewhere, and all of a sudden my folders and my mini-calendar were gone. What happened? I attempted to click and drag on the very left edge where the edge of the window was, but that didn't work.

Tried all the options in the view menu, looked for other menus. Nothing.

Googled it, and came up with nothing.

Went back into Thunderbird, tried again. This time, it worked. My folder list and calendar re-appeared.

BFI sometimes works. You just have to try harder.

The reason this happened is that the resize is "sticky". You can make the width of the folders panel smaller to a certain point, then BANG, it's gone. The same goes for resizing it from nothing to something. If you only drag the mouse a small distance, the folder frame will not resize. If you drag it to a certain width, then the folder pane will pop back up.

Thursday, 7 June 2007

Lost Menubar in Konqueror

When I was using Konqueror as my file browser today, I got all click-y and accidentally lost my menu. My entire menu was gone. Right-clicking gave me numerous options, including enabling toolbars. However, they didn't work (the menu is is not a toolbar, it's a menu bar). Apparently this syntactical nitpicking makes a difference.

Quick internet search: CTRL + M fixes it.

I wonder if there's a way to enable it with a mouse?

Saturday, 19 May 2007

Converting m4a files to mp3

I have some m4a files I would like to keep in mp3 or ogg format. From what I found, you need to do this via the command line in Linux/Kubuntu.

For a refresher, m4a file are propietary iTunes music files. They may or may not have DRM, so they may or may not convert properly.

To convert a m4a file to mp3, you need faad and lame installed. Use Synaptic Package Manager to get them. Install. In your konsole/terminal, type:
$ faad foobar.m4a # to convert to wav
$ lame foobar.wav foobar.mp3 # to convert to mp3
If you need to change it to ogg, you need oggenc. Then you can do:
$ for nam in *.mp4; do nice mplayer -ao pcm "$nam" -ao pcm:file="$nam.wav" && nice oggenc -q5 "$nam.wav" -o "$(basename "$nam" .mp4).ogg"; rm "$nam.wav"; done
That's all one line. See link here and here.

Monday, 14 May 2007

Frostwire won't shut down, exit or quit

No matter if I closed Frostwire in the menu or the window button (X), it would not shut down. It would stay in my title bar. It did not move to the process bar on the right (unlike Frostwire on Windows).

I tried to shut down the service using the terminal/konsole:
ps -e | grep frostwire
No luck. But if you do
ps -e
you notice something. Ah, that's right, Frostwire uses JRE and looks like "Java", so that must be it.
kill ProcessIdOfTheJavaThingy
Does not kill the process. Nothing happens. (Replace ProcessIdOfTheJavaThingy with the number beside the program you want to kill). For fun, I tried:
sudo kill ProcessIdOfTheJavaThingy
That doesn't work either. Well, I guess I'll actually Google it or something.

This is not a bug (though that may be a matter of opinion...); it's a feature. Frostwire will not shutdown if there are items still waiting to finish. To fix this lovely feature, go into the Frostwire menus:
System Tray (on the left)
Select Shutdown Immediately
Well, that was easy.


UPDATE: easily kill a process that has a window - use a weird combination of both graphical and command line to kill a window! In your terminal, type
and then the system will prompt you to click on the window you want to kill. Great method for those of you who don't want to remember ps options and pipes.

Or... kill a process by name (say... "amarok") using pkill.
pkill amarok
Great link here about that.

Wednesday, 2 May 2007

Newbies aren't mind readers

Internet message boards are ripe with people who are willing to help with technical problems but don't explain ideas fully. This is especially true of Linux helpers. Linux jocks are really proud of using Linux, and are really smart. They are very encouraging of new users "discovering" Linux. Unfortunately, many of these types are horrible at explaining to users how to fix their problem, despite all good intentions.

So what you see is speedy willingness to answer a question, and then an intimidating response that only frustrates the user further.

"Oh great, someone answered me! But I still don't have any idea how to fix my problem. And now everyone thinks my problem is solved, therefore I'll get ignored."

(I added the last post three years after the fact because I had the same problem and figured it out... and would like others to use this knowledge if needed. This post came up #1 on Google when I searched for the problem.)

What smart people fail to realize is newbies aren't mind readers. In Linux, many users are coming from Windows systems where the very concepts of how to solve a problem are different.
  • I have to use a command line? What is a console?
  • It looks like I click and download stuff, why isn't it there already? What do you mean, add a repository? How?
  • What do you mean, I have to compile it? Can't I just install it? What do you mean, I have to get the right one? It says it's for Linux!
When helping a newbie, you have to tell them
1) where to type any commands or look for options
2) exactly what to type, if it's command line

To newbies, it's not so obvious where to look. Did you even tell them what program you are talking about? Or if it's in their computer/system menu? They likely don't know every UNIX command out there.

Be direct and concise. You don't have to hold their hand for them, but don't take "the obvious" for granted. If you don't want to write too much, do a little legwork and find a couple URLs where the problem is already concisely spelled out.

This actually isn't so much a "newbie" problem as a "new to Linux or a piece of its software" problem.

Furthermore, if you really want to encourage newbies, you need to check back to a message you responded to to make sure you didn't confuse them any further.

Burning .nrg images with K3B

I downloaded a file and it was a .nrg file, which I know is an image file you can use to burn an image of a CD.

What I forgot is that .nrg files are images used in Nero. I don't have Nero, I use K3B.

Thanks to the folks at, they gave some insight as to the situation. If you strip the first 300 bytes of data off the .nrg file, the remainder is an ISO file.

So to change a .nrg file to an .iso file so you can burn it, open up a terminal/console/shell (Konsole) window. Change to the directory the .nrg file is in, and type:
dd bs=1k if=image.nrg of=image.iso skip=300
Replace image.nrg with then name of your .nrg file (something.nrg), replace image.iso with the name you want your outgoing file to be (something.iso)

Then burn the disc using K3b and the .iso file that you just created.

Uh... don't forget to burn the disc as an image, not as data.

Here's the link I found for the UNIX command dd.

Disclaimer: K3b did a checksum before burning and it was successful. So I guess the checksum is on the actual data and not the extraneous Nero data. I haven't actually installed the CD yet, though, so we'll see...

Tuesday, 1 May 2007

WindowsXP/Kubuntu Dual Boot video

I am considering installing a dual boot system (Windows XP and Kubuntu) on a friend's system. I have no idea how to get started nor do I know anyone who has done this before.

I'm reasonably secure in formatting drive, partitioning drives, and setting up Windows. However, despite finding some instructions, I would like to know what to expect. What actually happens? What does the screen look like at this point? What do I need to pay close attention to? This video explains exactly that.

How to set up dual boot Windows XP and Kubuntu in video. Great idea!

(I'm a little on the fence on the crack about women getting turned on by the install. On one hand, it is kind of funny because women tend not to be turned on by nerds oogling a Linux box. On the other hand, from watching the video you can see why. Point is, the comment wasn't very mature and didn't belong in this type of video. If you want to encourage women in computing, don't turn it into adolescent boys' club. Looks like someone needs to read HOWTO Encourage Women in Linux. I'm not really upset about this, but I'm saying it was a stupid thing to do.)

Sunday, 18 March 2007

How to Manually Force a Program to Close

Yes, programs in Linux can crash.

If you need to force a program to close, but are wondering what the heck Kubuntu folks use instead of Task Manager (CTRL-ALT-DEL), try using the terminal instead.

(I suspect there is a GUI like Task Manager kicking around somewhere that you can install, but that would require installing it or finding it. You already have a terminal).

What you need to do is find the Process ID of the program that is running, and then kill that process. First: open a Konsole window. In the window, type
ps -e | grep NameOfProgramYouWantToKill
ps aux | grep NameOfProgramYouWantToKill
Sometimes the name of the program not obvious or not what you expect it to be. In that case, you can just do
ps -e
ps aux
and scroll through the list to find it. Once you find it, you'll notice a number beside it, on the left. Type:
kill number
And hopefully you've shut the right program down. The program should disappear from the taskbar. As always, if you are consistently starting to experience problems with hanging programs, you should try rebooting the computer. If you still experience problems, Google for bugs or an update or patch for the software.

Monday, 12 March 2007

Getting International and Accented Characters in Kubuntu/Linux

I've been practicing my French again. One of my local friends grew up in Québec virtually all his life, and one of my local friends is studying French in Québec for a year. When I chat to them, I like to type the French words as they're meant to be written, which includes the accents.

Anyway, I had fun finding where to switch my keyboard so I could use the layout. In Windows, you do it by switching to an American English International Keyboard layout (Control Panel -> Regional and Language Settings, I believe... not in Control Panel -> Keyboard like you'd expect).

I found where to change it. There are lots of options. In addition to the language settings, there are variants in the language settings (dvorak, international...)

In Kubuntu with KDE, I found it in:
System Settings -> Regional & Accessibility -> Keyboard Layout
For reference:
Ubuntu U.S. International Characters Chart
I'm a Canadian with a normal American keyboard (Microsoft RT2300). I've added several keyboard layouts in the list as I want to mess around to see which one I'm the most comfortable with. I seem to be using U.S. English layout with the variant "international".

You can set up other options by using the tabs in the top (Switching Options Tab with "Show indicator for single layout" checked gives you the list in your taskbar so you can easily switch back and forth between keyboard layouts.

The only difference I notice from Windows is the cedilla. The comma key does NOT give the cedilla. You have to use the RIGHT ALT key, and then type comma. This gives you "ç"

Wednesday, 7 March 2007

Sometimes no audio in Firefox pages with Flash

After having my system up and running for a while, I noticed that if I use Amarok and then open Firefox, videos in YouTube would have no sound. I figured this was just a wonky Kubuntu feature until I decided to actually research the problem.

This problem was solved if I would reboot the system and open Firefox and watch videos first (before playing music). The problem still was recurring, though.

Apparently this is more than an ALSA sound driver fight between Firefox and Amarok. It's actually a bug (see link).

How to fix your Firefox audio: open a terminal/console, and type
cd /tmp
mkdir /tmp/.esd
ln -s /tmp/.esd-1000/socket /tmp/.esd/socket

Friday, 5 January 2007

CD and DVD Drive Hanging

On rare occassion, my CD or DVD drive will hang. The disc will show up on the desktop, but I can not eject it by right clicking. When this is the case, pressing the physical button on the drive often doesn't work either.

(I'm actually writing this post long after the fact... I think I did this to get it solved: )

In /etc/fstab, edit the line that looks like this:
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,ro 0 0
to this:
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,user,ro 0 0
Also try:
chmod 777 /bin/mount /bin/umount