Print to a non-supported printer from Linux

My mother bought a Kodak ESP 7 multifunction printer a few months ago. Since then, she has started using a netbook with Ubuntu Netbook Remix on it full-time. For a while now I have been intending to find a way to print to it from the netbook.

Unfortunately, Kodak decided to be one of the few printer manufacturers providing no linux support whatsoever. Attempts to make a driver have failed repeatedly.

I came up with a way to print to this machine without ever actually finding a working driver. I use a connected windows machine (our family computer) and Dropbox.

Here are the steps to set this up:

  1. Install Dropbox on the Linux and Windows computers. Make an account, and link them both. Now, you will have a Dropbox folder on each. I’m assuming that they are in the default places – change the paths if you put them elsewhere.
  2. Make a folder named print in the Dropbox.
  3. Now, install autohotkey on the Windows computer.
  4. Make a new autohotkey script in the Dropbox print folder. I named it printer.ahk, but it doesn’t matter.

Inside the file put these lines, modifying if needed:

; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Loop {
Loop, %A_ScriptDir%\*.pdf, , 1
Run, print %A_LoopFileFullPath%
Sleep, 30000
FileDelete %A_LoopFileFullPath%
Sleep, 10000

Now, run the script by double-clicking on it. I recommend that you place it in the startup folder as well so that it comes on always.

If you want, this is all you have to do. You can use print to file in Ubuntu to print to a pdf in the print directory. After a few seconds it will begin to print on the Windows machine’s default printer. However, I changed a few things to make printing even easier.

These are the steps:

  1. Install cups-pdf with synaptic or sudo apt-get install cups-pdf in terminal.
  2. In a terminal, run the following: ‘sudo chmod +s /usr/lib/cups/backend/cups-pdf’
  3. Run ‘mkdir ~/PDF’ in a terminal.
  4. Now, ‘ln -s ~/PDF ~/Dropbox/print’
  5. Open Printing (System > Administration > Printing), and set the printer called PDF to default.

After doing that, you should be able to open any app, go to print, and just hit print. after 10-15 seconds adobe reader will open up on the windows computer and print the document.

It takes a bit to set up, but is worth it. As a nice side-effect, it turns any printer into a network printer from Linux.

Fix volume control in mpd on Ubuntu Jaunty 9.04

I have mpd installed on my jaunty server. It works well, except that I found the volume control in my clients never worked.

Reading around, I found a slightly cryptically mentioned solution. In your /etc/mpd.conf, uncomment the line that says mixer=software, then restart mpd (sudo /etc/init.d/mpd restart). All should be well!

Mobile development.

I saw earlier on Smashing a list of things required to make and sell an iphone application. Here it is:
Below is a list of items you’ll need (*starred items are required, the rest are nice-to-have’s):

  • join the Apple iPhone Developer Program ($99) *
  • get iPhone or iPod Touch *
  • get an Intel-based Mac computer with Mac OS X 10.5.5,
  • prepare a Non-Disclosure Agreement (here’s a sample) *
  • download and install the latest version of the iPhone SDK if you don’t already have it.
  • a spiral bound notebook*

You then develop in their IDE and distribute it with their app store.
I have correspondingly made my android app checklist:

  • A computer. Win, Mac, or Linux.
  • The SDK (free).

You then develop with any IDE, right down to nano if you want, and can distribute as easily as putting the file anywhere on the internet.


How to change desktops with a shell command or script?

Does anyone know how to change desktops (in Compiz) with a shell command or script? I have been wanting this for a while, and would be cool to integrate with my new MX Revolution.

Resuming Posting

I am bored, so I have decided to resume posting to my blog. It’s been a while. Now that I have my aforementioned Android phone, I can post from there as well. I will try.

It may end up being all rants and such, but, hey, why not. I might as well.

I have an android phone

I just got an android phone, and it is awesome. About a million times more open than iphone plus background apps = perfect.

Qwerty keyboard is nice too.

Posted this to see how it works for blogging. I may start posting more often if I can do it from my cellphone…

Why does the YouTube video player suck?

These days, flash players can do amazing things. Look at Hulu, Veoh, and 5min‘s incredible players. However, Youtube has used the same, basic, crappy flash player that they have for years. It’s big, ugly, and doesn’t even work well. It has A/V sync issues, can’t handle going to fullscreen and back, no transparency, all of the UI is visible all of the time.

Considering that the player is easily the most important part of the flash player experience, they really need to make a new player.

Not to mention the horrible video quality. Veoh and Hulu in hi-res is actually watchable full-screen, but youtube is horrible.

Gnome users, watch in Movie player! See lifehacker. Don’t forget the Hi-def plugin. much more palatable, and faster as well. another plus is lack of idiotic comments.

Fix for can’t start graphical apps as admin.

Earlier today I would get an error about not being able to read the users Xsession file or something when I tried to start any Administrator program from the menu. sudo worked fine, but gksudo (the graphical password entry thing) didn’t.

Solution: full root partition.

Tips to free up space:

  1. Restart. This clears /tmp
  2. sudo apt-get autoremove && sudo apt-get clean (remove cached and unnecessary packages)
  3. check /var/tmp
  4. Maybe uninstall a hefty program or two. Games take up a *lot* of space.
  5. Don’t be like me and make a 10gb / partition on a terabyte hard drive [facehand].


Easy Auto-Update Sunlight Wallpaper

I used a post at Lifehacker to create my own, auto-updating, sunlight tracking wallpaper.

It is quite easy. It assumes that your Pictures directory is located at ~/Pictures. Change it in the script if yours is different. Just put it anywhere and execute it. If it doesn’t execute, just chmod +x changer.

Here is the script:

cd ~/Data/Pictures/Wallpapers/
if [ !-e world_sunlight_map_rectangular.jpg ]; then
wget && rm world_sunlight_map_rectangular.jpg && mv world_sunlight_map_rectangular.jpg.1 world_sunlight_map_rectangular.jpg && echo "Finished."

Save it in your home directory.

Use the normal wallpaper selector to set ~/Pictures/world_sunlight_map_rectangular.jpg to your wallpaper. It’s a pretty big image, so most screens will look fine with it. If you want to do anything else to it, I suggest you look into imagemagick or phatch. Note you will need to put the image manipulation in the script so it is run on the image every time you download it.

Then, install gnome-schedule from the repositories. It will add System > Preferences > Scheduled Tasks, where you need to add a new, recurrent task that runs changer every hour. After that, it should auto-update itself with no help from you.

It really is a nice effect. Since Gnome-Schedule uses cron, the linux job scheduler, doing this will add no background processes to your computer, or even slow it down in any way.

Most systems can get some sort of program that does this. Now we have one, and all it needs is one file!

I intend to create a script that does the installation at some point in time. I might even package it in a .deb!

The easiest way to rip DVDs ever.

I like to back up my DVDs for ease of watching on my computer. This was hindered when I switched to Linux, as I had no idea how to do it on Linux. Now, after a while, I have come up with the exact perfect way to rip DVDs.

This guide assumes you have done nothing to begin. (I think! I’ve done a lot to my computer, so no guarantees!)

Step 1: Enable DVD Playback

  • Add the Medibuntu repository to get libdvdcss2. [link]
  • now, install libdvdcss2 from medibuntu and libdvdread3.
  • now, open a terminal and run ‘sudo /usr/share/doc/libdvdread3/’ That enables the DVD playback.
  • Download the Handbrake CLI from [here]. Make sure to get the Linux one. Extract it to some folder. Your home directory will work just fine.
  • Now you should be ready.

Step 2: Ripping. (this is the one you do every time you want to rip a DVD)

  • Insert the DVD. If a movie player comes up, close it.
  • Go to a terminal. Run ‘./HandBrakeCLI -i /media/cdrom0/ -o DesiredFileName.mp4’. This assumes that Handbrake is extracted to your home directory and you are in your home directory. Also it assumes your DVD drive is on /media/cdrom0/. I t may be cdrom, or something else. I only tested it by myself. Put your desired filename (plus .mp4 at the end), as the final argument.

This uses the Default Handbrake preset. It’s pretty quick, comes out to 700mb-1.3gb, with excellent quality. It should autocrop as well. For other presets and advanced options, see the documentation. I personally like the default. If you have an ipod, there are presets for that as well so it will play better and at a smaller size on it.

Each rip takes a while, depending on your processor. My Intel Core2 Duo 2.0gHz laptop can rip a movie in about half an hour. YMMV.

This happens to take around half the time of doing this the easiest way I found on Windows.