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)
;
#NoTrayIcon
#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.

Hmm…

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.

Personal vs. Political Lives

I’m sure everyone out there has heard about the cheating South Carolina governor, Mark Sanford.

Picture from USAToday: http://i.usatoday.net/news/_photos/2009/06/24/sanfordaffairx-large.jpg

Picture from USAToday: http://i.usatoday.net/news/_photos/2009/06/24/sanfordaffairx-large.jpg

I don’t politically like the man, he is a polar opposite to my views in almost all ways.

That being said, I don’t care whether he has an affair. Big deal. He fails at his job as a husband. The people of South Carolina did not elect a husband, they elected a governor. As a governor, he isn’t adversely affected by having an affair. Apparently being unreliable is a habit of his, not a new trait due to this incident. He was an idiot to pay for the flights with state money, but obviously he isn’t the brightest governor around.

That goes for all politicians caught cheating or doing other bad things in their personal lives: I DON’T CARE. I highly respect and agree with politicians such as President Obama, for instance. If he was caught in an affair right now, with five seperate women, I would lose some respect for him as a person, but that has nothing to do with how good of a politician he is.

I find it unfortunate that many potentially great politicians have been effectively disqualified from government because the American people have decided that fidelity is more important than how well their elected officials are doing their actual jobs. The examples abound.

Picture from Washington Post: http://media3.washingtonpost.com/wp-dyn/content/photo/2009/06/17/PH2009061703705.jpg

Picture from Washington Post: http://media3.washingtonpost.com/wp-dyn/content/photo/2009/06/17/PH2009061703705.jpg

John Edwards was a fairly promising Presidential candidate when news of his affair broke. Now he is doing nothing instead of being in Washington.

Bill Clinton was the President, and almost impeached because he had an affair. A fairly timid one, at that, compared to others.

The examples go on and on. Why are Americans more likely to condemn a politician for being disloyal to their spouse than, say, corruption?

As an Illinois resident, I can confidently say I have experience bad politicians. Both (!) of our last two governors are currently in prison for corruption, embezzlement, etc. Oddly enough, they have both been loyal to their wives. Morality in one way does not indicate morality in others.

Well, that about concludes my rant regarding fidelity vs. doing your job. Enjoy, share with your friends. Leave comments.

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].

Simple!

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:

#!/bin/bash
cd ~/Data/Pictures/Wallpapers/
if [ !-e world_sunlight_map_rectangular.jpg ]; then
wget http://www.opentopia.com/images/cams/world_sunlight_map_rectangular.jpg
fi
wget http://www.opentopia.com/images/cams/world_sunlight_map_rectangular.jpg && 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!