Thursday, July 24, 2014

Linux Driver for Canon ImageClass MF3110/3112

I recently stumbled upon a treasure trove while looking for ways to make my old Canon ImageClass MF3112 all-in-one laser printer work with the latest OS around.

Background of the situation

If you're looking for drivers of this printer at the Canon official website, it only provides drivers to support 32-bit Windows XP, Vista and 7... none for Linux nor MacOS. This is pretty much a bummer especially if you have up-to-date workstations that "need" 64-bit OS (the > 4GB RAM thing). In my case, all my workstations and laptops run a Windows 8.1 and an Ubuntu Gnome 14.04, both 64-bit.

Canon actually published a package to install printer drivers for Linux-based OS, called the "UFR II". However, this is only for their not-so-late models, and apparently the one I need is the one they developed prior to this. The older models seem to be an implementation based on a raster-like format that I have no particular clue how it differs.

After a day of two of digging around the Internet, and exploring the vast "Page 2 and 3" Google search results, I found a guy who made a custom linux driver to support this "rastertocups" print driver thing that Canon has done and left to rot. He has a GitHub repo page which sort of discussed what the driver is and what other canon printer models are supported.

Since there's no HowTo wiki entry to use his codes, I opted to share what I did in order to use and install it (credits to ondrej-zary for the source code).

Pre-work Requirements
  • sudo rights (or root)
  • gcc and compiler (e.g. make, build-essential) is installed
  • cups, libcups2-dev, and libcupsimage2-dev is installed
  • even though it doesn't have the required drivers, I installed the UFR II Canon Linux Drivers because it seems that it is needed for the custom drivers to work
The Steps
  1. Download ondrej-zary's carps-cups source code (there's a zip file download link present)
  2. Extract it on the desired work-area folder (temporary use; mine was inside my home folder)
  3. Using the terminal, go to the location of the unzipped folder and run "make" 
    $ cd ~/carps-cups-master 
    $ make 

  4. If there are errors of missing dependencies, you can try to use "apt-file search " to check which packages you need install before trying to make it.
  5. If things look fine and there's no error, proceed with "sudo make install" (or make install for root users);
$ sudo make install
The Result

I've done this and made my printer work with Ubuntu Gnome 14.04 64-bit (cups 1.7.2) and Debian 7 Wheezy 32-bit (cups 1.5.3). I added printer and selected the compiled driver via the cups web interface (usually running at your linux machine "localhost:631").



Hope this helps somebody out there... and again a huge thanks to ondrej-zary!

Wednesday, August 14, 2013

Dual boot Debian 7 Wheezy on existing Win8 UEFI machine


I don't want to bother giving a lengthy background or info... So I'll just try to make this post a short mash up of what you need to know.

Prelude: Dual-booting a laptop/machine wherein there is an existing Windows 8 installed in a UEFI boot-up environment

First off, you'll probably need to do some shrinking of existing partitions. In my case, I just shrank my Windows8 drive C: using the disk manager build-in under the "Computer Management".

Afterwards, you'll need to use a UEFI-bootable linux image. For me, I used a PXE bootable Debian 7 Wheezy-stable image and created a root, swap, and home partition from the unused space. Do take note that you need to use the new GPT partitioning (for those with fresh hard drives); this option is usually asked or selected when using the "advanced mode" when installing.

Now here is the tricky part... after you proceed to install GRUB, that grub instance will not work later after finishing the installation. You will need to use an external USB linux image or disk that can boot as UEFI. This is not necessarily need to be a Debian USB image as I used a Kubuntu 13.04 image and placed it in a USB stick.

Use the USB stick to boot the machine up and use its GRUB rescue to manually boot the already installed Debian. For those a bit lost on using the GRUB rescue command line, below are the lines I used.

set prefix="(hdX,gptX)/boot/grub"
set root="(hdX,gptX)"
insmod normal
normal


Note that the prefix is just to denote the location of the grub installation folder, so the value might change depending on your partition layout. On the example I gave, I only have a root partition so I had to specify the "boot" folder. If your case is that you created a separate "/boot" partition, the prefix would probably look like...

set prefix="(hdX,gptX)/grub"


Once you have managed to boot-up to your installed Debian partition, log-in to your root (or use sudo if that's your preference) and install the following packages:

# apt-get install grub-efi-amd64 efibootmgr

We then have to mount temporarily the partition containing the already existing EFI loader of Windows. This is usually around 250-300MB in partition size and contains files and folders with names like "Boot" and "EFI". I'll leave it up to you which or what partition number that may be.

# mkdir /boot/efi
# mount /dev/sdaX /boot/efi

Next is loading the driver/module for the EFI support, which will then aid with the re-install and detection of GRUB of the existing EFI Windows 8 partition and creating a Debian EFI entry.

# modprobe efivars
# grub-install /dev/sda
# update-grub

Kindly check if there is a new EFI entry present on the output displayed upon executing the "update-grub". Also, check inside /boot/efi if there is a new folder or entry that matches in terms of the name of the EFI entry listed a while back.

If all goes well, you will see a new UEFI boot priority inside your BIOS apart from the UEFI Windows Boot Manager.

Hope this helps!


Other resources that you might find useful:



Sunday, July 21, 2013

GAM: basic scripting for Google Apps Admins

Hi everyone! It has been a while since I posted something useful in this blog site of mine...

I'm currently kept busy by one of my on-the-side projects recently, in particular deploying Google Apps for Education. One thing that I noticed is a need by some admins to automate some bulk task in managing and keeping up-to-date user accounts management in their respective domains. Since time is usually at the essence, and also a luxury, for most IT administrators... they don't have too much time to develop their own robust apps to deal with this kind of work.

One solution that I suggest that you guys can try out is using something called the "Google Apps Manager" (or GAM). It similarly works like the provisioning API of Google Apps but already ready for CLI usage (in my case, it works like a charm in linux).

To sum what GAM is, it is a python based library/command that you can use to connect to your Google Apps Admin Console and make the necessary administrative or user management work. Now the good thing with this is if you combine this with some basic scripting magic, you can now automate some bulk tasks like massive user creation or moving a huge amount of people to a mailing list.

For more info or to check what the Google Apps Manager can really do, check this link out.

Sunday, June 3, 2012

Amazon AWS as a good help for start-ups

I was quite happy and satisfied for being able to attend a talk about a demo/intro about Amazon's cloud-as-a-service solution, the Amazon Web Services. Apart from acquire more technical knowledge, it sort of gave some options to prevent too much cost on set-up of a server for public-viewable production use.

I don't want to bother talking and putting more details on what's the technical differences and the pros and cons of AWS from traditional in-house or other cloud-hosting providers since there is really no absolute truth or "standard" that can explain this in concrete sense. But one thing that I'm actually keen is on their "free tier usage" for new AWS account holders.

Well, on a marketing standpoint, the "free tier usage" is their proof-of-concept or demo-to-purchase to reel in customers and use their offered service... which is all true perhaps. But for tech-enterpreneurs who are looking for ways to deploy their apps or products over the net and be accessible to their target customers, I could really say that AWS should be there on the potential list for achieving it.

The "free tier usage" from what I understand is good for 12 months upon sign-up of a new AWS account... which for the record requires you to provide a credit card. But despite of that uneasiness for people that are not entirely comfortable of letting someone save your credit card credentials... it is a gamble worthwhile. The main agenda at the end of the day is to try out if the 1-year free trial service that AWS offer can meet the requirements of your start-up tech project. In turn, it will make you actually move forward to realization of launching your start-up project into production.

Everyone would like to spend (too much) money on a start-up that has to prove its value, and releasing it to the public market is the driver or decision-block on determining a winning formula or just another rubbish in the bin. Of course, when it does become a huge hit upon release to the public, you would likely need to think of scaling the capacity and performance. In AWS, you can scale your set-up as convenient as you can, and as their saying goes "pay for what you only use".

For more info on this matter, I suggest you to read their program details at Amazon's own website at this link.

Monday, April 30, 2012

[Bug] adding gateway route but with different subnet from network

I encountered a weird behavior from my recent projects that were related to some setup of gateway servers, for both Linux-based (Debian) and BSD-based (FreeBSD) systems... wherein there is an issue when adding static gateway routes that does not match or fall within the defined subnet network configured on a network interface.

To give a better detail or explanation of this predicament of mine, below is a sample network configuration scenario...
  • Network IP address subnet is 10.10.1.0/24, so that's basically 10.10.1.X correct?
  • Gateway IP address is... let's say 10.50.1.27...
Clearly on the scenario given, the IP address of the gateway is outside of the network subnet defined for a network interface. Here in the Philippines, this is a common case for leased-line internet connections coming from telco providers. 

From previous engagements, I don't have a problem hard-coding this on either the interfaces config file or in the rc.conf... but in the recent turn of events and experience, it seems that the latest linux kernels and BSD builds have incorporated a sort-of mechanism that prohibits this kind of configuration to be enabled and up upon start-up of the operating system. I've experienced this issue with a Debian Squeeze server and a FreeBSD version 8 I think (am not really a BSD proficient guy, just the basic UNIX made me survive).

The setup still works with this kind of interface configuration, but upon boot-up, you have to manual place the static routes (using "route" command) for it to recognize and see the gateway IP you want it to use.

My initial solutions involved adding static routes on the interfaces config or on the rc.conf files.

For Linux-based:

post-up route add -net 10.50.1.27 netmask 255.255.255.255 dev eth0
post-up route add default gw 10.50.1.27
post-down route add 10.50.1.27 netmask 255.255.255.255 dev eth0
post-down route add default gw 10.50.1.27

For BSD:

defaultrouter="10.50.1.27"
static_routes="net1"
route_net1="-net 10.50.1.27/32"

Sadly though, my attempts in fixing the BSD-based system ended up in failure. As for the Linux machine, well I have yet to fully test it out since the project suddenly reached the end without further testing.

Hope this rather weird post of mine helped to shed some light to their problem and looking for an answer.

Thursday, August 25, 2011

Finally part of the "exclusive club"

This is just a short brag-out post...

Finally, I was able to convince and treat myself into getting a Macbook Pro. Since I was still eyeing much on the budget, I just got the entry mode 13" with i5 processor. The unit came with a pre-installed Snow Leopard but I was able to register and get the Lion OS upgrade for free.

All I can say is... no wonder a lot of people like to have and own a Mac. The feel, look, the power and convenience...

Simply bliss!

At least I could now say that I know how to use a Windows, a Linux, and now a Mac.

Thursday, February 10, 2011

Toshiba Folio AS100 mod-ding

To those who were able to purchase and get their hands on a quite rare Toshiba Folio AS100 and are suffering greatly on the poor performance of the stock Android OS, there is someone who just saved us from almost throwing our tablets off the window.

A guy by the name (or screen name, not sure) Dexter Picard was very kind enough to develop and release a good and working "FolioMod" image for our tablet PC. There's an active thread running in the XDA Developers forum which discusses further about the actual ROM created and how to install it to your Folio device. Refer to Post #1 on this thread and follow the instructions.

Some key features that you get when using the FolioMod are:
  • fully working and somewhat latest Google Apps (Gmail, Maps)
  • a working Android Marketplace App (Yes, the same market app we have come to love and familiar to any Android device)
  • better tweaked response and performance
  • root privileges of course (very useful for uninstalling the crap-ware pre-bundled by Toshiba, but still it's up to you to remove them)
I'm currently using the FolioMod v1.3c and frankly, I'm quite happy with it. Hope that you will also do and feel the same.

A great deal of thanks and cheers to Dexter and the rest of the people who have contributed heavily on developing and improving the FolioMod image.