BozoSort

yet another CS blog

Browsing Posts published in October, 2009

Update ( 5/5/2010) : The link was broken when I updated the URL scheme for wordpress, so it has been fixed now and should be readily downloadable. Thanks for the tip.

This is the Android DevTools app previously found only on the Android Emulator, now available for download.


Download Android DevTools

—————————————————

Those who are familiar with the Android SDK are likely to know of the DevTools app available on the emulator that ships with the SDK. While it may not be the end – all be all of useful apps, it does have practicality for developers looking for more ways to gather information about their device as the programs they develop run on them. For example, it can provide a graphical cpu usage display, show currently active processes, and highlight screen updates while the screen updates.


Who knows why Google does not want this dandy app publicly available on the market? Or even online, from Google’s own servers?
To pull it off of your own emulator, the command is:
adb pull /system/app/Development.apk
Of course, you can replace Development.apk with whatever app you want, if you are interested in acquiring other built in applications. You should also be able to use this technique to pull the market or youtube apps off of a real device to put on your emulator, but I have yet to try this.


To download directly to your phone, you first need to enable installing apps from outside sources.

Click: Settings -> Applications -> Unknown Sources.



This guide is intended to help users who are trying to set up a printer on a linux machine, and then be able to print to that printer from a different linux machine

Whoever designed cupsys (Apple) must be pretty bad at making easy to use interfaces. By default, the cups web portal blocks.. everybody from accessing it, which makes setting up and using your printers over the network quite difficult. I mean really, how useful is a “403 Forbidden” anyway? The least they could do is give some better instructions on how to set the stupid thing up, but apparently the brief summaries provided in the man pages are enough to set everything up without any confusion what-so-ever.

So, if you’re in a position where you just installed cups daemon on your server, and you can’t even get to the configuration pages, I highly suggest taking a look at this configuration file.

But wait.. what’s so different about this config file and what do I need to do to make it work for me?

This particular cupsd.conf turns of every “safety feature” that is enabled by default in the standard cupsd.conf file. With this file, all you need to do is navigate to the print server on port 631 using your favorite web browser to setup your printer and drivers, among other things. To make it work for you, you need to edit every  Allow 192.168.1.0/24 so that it matches your own little dhcp world. Actually, if you’re using a Linksys router, or many of the other common routers, this file will probably work of the box for you. (If you’re thinking, “wait, my router is 192.168.1.1, so do I need to adjust?” Then the answer is no, you do not. The /24 takes care of that for you.)

Tip: before editing the file, I strongly suggest making a backup first. That way, if you really buggar things up, you can start with a fresh file rather than having to uninstall and reinstall cupsys altogether. To make a quick and easy backup, run the command:
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original
In the event of catastrophic failure, restore the file with:
sudo cp /etc/cups/cupsd.conf.original /etc/cups/cupsd.conf

After you fix the cupsd.conf, you need to make the changes take effect by restarting the cupsd daemon. This is done easily by running the command:
sudo /etc/init.d/cupsys restart
If you see any errors, you probably made a typo in the config file. Fix them before moving on..

Now, navigate to the setup page by putting the local address of the host machine followed by :631 .
For example, my particular server is at 192.168.1.112, so to get to the setup pages I would navigate to http://192.168.1.112:631 . Hopefully you don’t have any issues with drivers for your particular printer. I did, but fortunately Brother (the best printer company in the history of the world) posts all of their linux drivers online with easy to follow install instructions. (Just involves using the dkpg tool for debian based systems, or the rpm equivalent for distros that use rpms).

If you can print the Test Page from the web-portal, you’re almost there. We also need to add the printer on the machine we plan to use on a daily basis and send print jobs from. Here’s the catch: on this mid – October day in 2009, it is not possible to use graphical tools in GNOME to make this happen. The “Add Printer” tools are extremely misleading in this aspect. If you look in the attached picture, you can see that I can see the network printer from the built in GUI tools, and even change its settings, but I cannot actually set that as a printer to print to(!).


So Close, Yet So Useless

So Close, Yet So Useless


So instead, on our own local machine, we need to edit /etc/cups/client.conf and tell it the address of the print server. All we need to do is add the line: ServerName 192.168.1.112 , adjusting the address to the assigned address of your own server of course. For a one-liner command to accomplish this:
sudo cat "ServerName 192.168.1.112" > /etc/cups/client.conf
If that command doesn’t work, just open it with vim or nano or emacs and add the line by hand..

I’m not exactly sure which service needs to be restarted to make the changes to this file take effect, so I just rebooted my own computer which worked perfectly :p .

If you still have trouble, leave a comment with a good description of your setup and I’ll at least try to help, but no promises! The forums of your respective distro are probably going to be the most helpful, or maybe LinuxQuestions.org.

**Bonus**
Setting up a windows machine (assuming Vista or 7) to use your linux hosted printer is actually super easy. Click Start -> Control Panel -> Hardware and Sound -> Add Printer -> Network Printer -> The printer I want isn’t listed
Then, copy and paste the URL for your printer into the “Select shared printer by name” box. (Click through the picture to see a larger version)


Windows Printer Forms

Windows Makes it Easy


WordPress Appliance - Powered by TurnKey Linux