Fly together Forever 比翼恒飞 http://www.liucougar.net/blog Sat, 26 Mar 2011 06:37:08 +0000 http://wordpress.org/?v=2.9-rare en hourly 1 Lexmark Pro900 printer linux driver http://www.liucougar.net/blog/archives/275 http://www.liucougar.net/blog/archives/275#comments Fri, 25 Mar 2011 06:42:27 +0000 liucougar http://www.liucougar.net/blog/?p=275 It seems there is little documentation on how to setup Lexmark Pro900 printer driver in linux. Lexmark does provide linux driver,  but it’s only for RPM or DEB based systems, without a manual installation option, which does not help much for installing to a Gentoo distribution.

After jumping through several hoops by reading the various scripts embedded in the install script and postinstall script in RPM, I finally managed to install it manually onto my Gentoo, and add the network printer to CUPS just fine. Test page shows up properly as well.

In order to save other gentoo users (and myself if I need to reinstall this driver), I spent sometime on writing a gentoo ebuild.

To use it, add my overlay first:

layman -f -o http://github.com/liucougar/portage/raw/master/profiles/layman.xml -a liucougar

keyword the package:

echo "net-print/lexmark-inkjet" >> /etc/portage/package.keywords

install it as root and restart cups

emerge net-print/lexmark-inkjet
/etc/init.d/cups restart

go to the web UI of CUPS (make sure the printer is properly setup and accessible via network), and add a printer, now you should see lexmark in the add printer page.

I think this ebuild should support the following printers: Pro200-S500, Pro700, Pro800-Pro900, S300-S400, S600, X2600, X3646, X4900, X5666, X7600, Z2300, Z2400.

There are quite some extra features in the provided binary driver package: scanner support (sane, only locally connected via USB is supported as far as I can tell), firmware updater among other things. There are not yet supported by the ebuild.

DISCLAIM: I only tested with Pro900, so if it does work for you with other printers listed above, please leave a comment below.

]]>
http://www.liucougar.net/blog/archives/275/feed 0
announcing kojslint: komodo jslint integration with autofix http://www.liucougar.net/blog/archives/269 http://www.liucougar.net/blog/archives/269#comments Mon, 20 Dec 2010 01:47:37 +0000 liucougar http://www.liucougar.net/blog/?p=269 Just uploaded kojslint to komodo extension site: a komodo jslint integration with additional feature of auto-fix some of the most common jslint warnings.

Kojslint is a fork of kjslint: thanks Ben Smawfield, the author of kjslint.

Give it a try if you use komodo IDE or Edit. Currently kojslint inherits all features from kjslint, and added some more (check out details on the project kojslint):

  • provide UI to modify all available JSLint options
  • save jslint options as profiles (called modes) which are shared for all files/projects
  • add/delete profiles (modes)
  • auto-fix some common jslint warnings
  • all jslint warnings on the same line are grouped in the “JSLint errors” output tab
  • profiles can be locked (it can’t be changed/deleted until unlocked)
  • bundled with JSLint 2010-12-08
]]>
http://www.liucougar.net/blog/archives/269/feed 0
Debug komodo extensions http://www.liucougar.net/blog/archives/262 http://www.liucougar.net/blog/archives/262#comments Mon, 13 Dec 2010 22:35:27 +0000 liucougar http://www.liucougar.net/blog/?p=262 After asking in komodo extension forum, and then digging in google search result, I finally found out how to record all errors in chrome (including all komodo extensions)  in the error console window:

According to this MDN article on how to setup mozilla extension development, set javascript.options.showInConsole = true would log errors in chrome files to the Error Console.

In order to change this option, I think “Komodo developer extension” extension has to be installed, so you can access a JSShell. Once in a JSShell, run window.openDialog("about:config", "_blank"); to open a config UI to change that option. Alternatively, with the same extension, there is actually a control on the UI to set this option for you automatically: ‘Tools” -> “Extension Developer” -> “Enable Debugging Preferences” (according to the source file, this control toggles the following 3 boolean options:  “nglayout.debug.disable_xul_cache”, “javascript.options.showInConsole”, “browser.dom.window.dump.enabled”)

Now all chrome errors should show up in the Error Console, but Komodo does not provide a UI control to open it. Dock Error Console extension can be installed, or the following line of js code can be executed in JSShell to open one:

window.openDialog("chrome://global/content/console.xul", "ErrorConsole");
]]>
http://www.liucougar.net/blog/archives/262/feed 0
Fixing virtualbox X video driver http://www.liucougar.net/blog/archives/256 http://www.liucougar.net/blog/archives/256#comments Wed, 10 Nov 2010 04:31:11 +0000 liucougar http://www.liucougar.net/blog/?p=256 It has been quite a while since I started X server in one of my development gentoo virtualbox guest. Today, when I tried to startx, I got the following error:

dlopen: /usr/lib/xorg/modules/drivers/vboxvideo_drv.so: undefined symbol: resVgaShared
(EE) Failed to load /usr/lib/xorg/modules/drivers/vboxvideo_drv.so
(EE) Failed to load module "vboxvideo" (loader failed, 7)

And X failed to start.  I tried to reinstall virtualbox-guest-additions, and rebooted, but X still exists with the same error. It turns out, in order to “properly” re-install virtualbox driver in the guest, I have to re-emerge the following two packages:

emerge x11-drivers/xf86-video-virtualbox x11-drivers/xf86-input-virtualbox

The problem is caused by upgrading xorg-server from 1.6.x to 1.7.x, after which virtualbox guest drivers have to be re-installed (portage does not show a warning, so it took me some time to figure that out).

]]>
http://www.liucougar.net/blog/archives/256/feed 0
s3ql ebuild for gentoo in liucougar overlay http://www.liucougar.net/blog/archives/247 http://www.liucougar.net/blog/archives/247#comments Sun, 03 Oct 2010 17:41:51 +0000 liucougar http://www.liucougar.net/blog/?p=247 After some research for a S3 backup strategy, I settled with s3ql which looks to be one of the most promising solutions for a maintained, compressing, de-duplicating, encrypted, chunked, S3/ssh/sftp based, backup filesystem.

However, the installation of s3ql is non-trivial work because there is no ebuild for it, so I decided to write one. I just pushed the ebuilds to the liucougar overlay on github (which currently contains s3ql and two of its dependencies missing in official gentoo portage tree). As of today, unless you are using testing branch of gentoo, in order to install s3ql, the following lines has to be added to /etc/portage/package.keywords:

sys-fs/s3ql
dev-python/pycryptopp
dev-python/pyliblzma
dev-python/unittest2 #only useful if you intend to test the package
dev-python/apsw
dev-cpp/gccxml
dev-db/sqlite

Please report any issues with github.

Note: if you want the contrib scripts shipped with s3ql installed, contrib use flag should be specified when emerging s3ql.

]]>
http://www.liucougar.net/blog/archives/247/feed 0
psycopg2 “hidden” dependency of mx.DateTime http://www.liucougar.net/blog/archives/233 http://www.liucougar.net/blog/archives/233#comments Sat, 10 Jul 2010 20:40:30 +0000 liucougar http://www.liucougar.net/blog/?p=233 While trying to run our tests in a clean virtualenv (–no-site-packages), psycopg2 (tried both 2.0.13 and 2.0.14) can not be imported with a error traceback like the following:

File "....py", line .., in
  import psycopg2
  File "build/bdist.linux-i686/egg/psycopg2/__init__.py", line 69, in
  File "build/bdist.linux-i686/egg/psycopg2/_psycopg.py", line 7, in
  File "build/bdist.linux-i686/egg/psycopg2/_psycopg.py", line 6, in __bootstrap__
ImportError: can't import mx.DateTime module

However, search python source files in the install psycopg2 package does not yeild any hits on mx, so my conclude was that it’s being imported in the psycopg2 c library.

It becomes clear after I took a look at the setup.py in the source tarball of psycopg2: while building the package, the setup.py will check whether it can find mx header files under the python include dir. If it can, it would just compile in the above import line into its c library. I don’t see any way it can be disabled given you have egenix-mx-base header files installed (even if you don’t have mx python module available, it will still compile in mx.DateTime support)

This would only happen if you have the egenix-mx-base header files install in the global python installation.

One workaround I came up with is to copy over the mx dir under site-packages from the global python installation into the virtualenv environment I am using to do test. Alternatively, don’t install the header files for egenix-mx-base (although in gentoo, that means you have to manually remove the header files). For now, I settled on the former workaround.

]]>
http://www.liucougar.net/blog/archives/233/feed 0
Fix Skype (2.1.0.81) video in Gentoo Linux http://www.liucougar.net/blog/archives/220 http://www.liucougar.net/blog/archives/220#comments Tue, 15 Jun 2010 06:20:40 +0000 liucougar http://www.liucougar.net/blog/?p=220 I have a USB camera I want to use with Skype to make video calls. The camera has the following lsusb output:

Bus 004 Device 002: ID 0471:0328 Philips SPC 700NC PC Camera

My gentoo is 64bit, using multilib (has 32bit libraries as well). After fiddling with Google to find the proper linux kernel driver for a while, I found a useful website  Linux Kernel Driver DataBase (LKDDb) (the kernel module is called CONFIG_USB_GSPCA_SONIXJ). After installing the kernel driver, reboot, Skype can detect a camera device /dev/video0, but when clicking the test button, nothing show up (the light on the camera comes on briefly then turns off). Further google leads me to this solution: Edit /usr/bin/skype, add the following line before the last line (exec ./skype "$@"):

export LD_PRELOAD=/usr/lib32/libv4l/v4l2convert.so

skype is a pre-built 32-bit binary, so I have to specify the lib32 explicitly above. Note: if you receive any of the following errors:

ERROR: ld.so: object '/usr/lib32/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/usr/lib64/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/usr/lib32/libv4l/v4l2convert.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/usr/lib64/libv4l/v4l2convert.so' from LD_PRELOAD cannot be preloaded: ignored.

You are probably trying to set LD_PRELOAD on a shell script (the /usr/bin/skype is actually a shell wrapper around /opt/skype/skype, the real binary), so the following would lead to one of the above errors:

LD_PRELOAD=/usr/lib32/libv4l/v4l2convert.so skype

Try to add that line to the script instead as suggested above.

]]>
http://www.liucougar.net/blog/archives/220/feed 0
“setting a property that has only a getter error” Error in FF 3.6 http://www.liucougar.net/blog/archives/207 http://www.liucougar.net/blog/archives/207#comments Fri, 19 Feb 2010 20:12:11 +0000 liucougar http://www.liucougar.net/blog/?p=207 I have been seeing “setting a property that has only a getter error” poping up in my firebug for a while, which I believed was a Firefox extension conflict with new version of firebug.

A recent post to dojo-interest mailing list caught my eye: basically, a user can reproduce this problem by just loading dojo from google CDN.

I decided to take a look at this and try to figure out why.

A firebug bug report is filed about this error: with FireFox>3.5.2, modifying window.console (or attributes on console) would trigger this error. However, in the test case mentioned in the post, even if dojo is not loaded, the error still pops up in firebug, so it must be in some firefox extension, rather than dojo.

The only other extension I have in my development firefox profile is Selenium-IDE 1.0.4. Disabling it, and the error immediately goes away. Searching selenium-ide bug report, it turns out it has just been fixed in Selenium-IDE 1.0.5 (direct link to the xpi file).

In a summary, if you are getting “setting a property that has only a getter error” Error in FF 3.6 with any page, make sure you have at least Selenium-IDE 1.0.5. If you don’t use it, then you are probably messing around with window.console. (the error message would be much more helpful if it states what property is being accessed)

]]>
http://www.liucougar.net/blog/archives/207/feed 3
Bug fixes and a new feature in DOH http://www.liucougar.net/blog/archives/186 http://www.liucougar.net/blog/archives/186#comments Mon, 16 Feb 2009 08:50:47 +0000 liucougar http://www.liucougar.net/blog/?p=186 Over the weekends, I spent some time on Dojo Objective Harness (DOH) to fix a reported bug: in some cases the global progress bar overshoots 100%. This is obvious in the dojo test suite, the progress bar goes beyond 900%.

After some digging, it turns out the algorithm to calculate the global progress bar has a flawed assumption: the number of tests in each group is known before the tests start. That’s not the case if nested test suites are used, such as the case in dojo._base.test.

The fix is quite simple as well: rather than trying to create a portion in the global progressbar for each test, we only create one for each group.

Another problem noted in the original bug report is overflow of test group progressbar. I never noticed it before, but keeping a close eye on each group progressbar when running dojo test suite does reveal it. By removing tests in the dojo test suite, I isolated the problem to dojo.date and dojo.date. The problem is the test group progress bar is not updated at all due to the fact that they don’t have a html page (instead both dojo.date and dojo.data test cases only use javascript files). The fix for this turns out to be quite straghtforward as well as soon as I know what causes it.

After the bug fixes, I feel like to add a new feature to DOH, clickable test cases which will hilight the relevant log line after the test finishes. Searching a failture/error in the log pane is a real pain especially if you have lots of tests generating huge number of messages. The log line will be hilighted according to whether the test failed or succeeded. (Note: the hilighting requires dojo, so if DOH is used without dojo, you won’t be able to see the hilighting animation.)

Similarly, when clicking on the global progressbar, the test group associated with that portion of the bar will be scrolled into view (for any failed test group, a tooltip is also attached to the global progressbar portion to indicate which test group it is). This is useful when locating a failed test group.

In addition, a tfoot is added to the test list table after all tests finish, which contains a summary of the test run. Check out the online demo in our nightly. This will be part of dojo 1.3 release.

]]>
http://www.liucougar.net/blog/archives/186/feed 0
Switch user interface language in google maps http://www.liucougar.net/blog/archives/179 http://www.liucougar.net/blog/archives/179#comments Fri, 06 Feb 2009 08:58:21 +0000 liucougar http://www.liucougar.net/blog/?p=179 Apparently, google maps has different features/capacities based on different user interface languages. My parents just complained to me that they can’t find “place of interests” in their google maps any more. After obtaining more information from them, it appears that they are actually using Chinese version of google maps, while when they were using the English version, “place of interests” was indeed visible as an option.

So the problem is how to change the UI language. The website URL for the Chinese version of google maps is the same as the English version, both of which is maps.google.com, so must be another way of doing it. Searching the UI, I can’t find a control to change language anywhere. However, I did notice on one page when clicking around, where I have this in my address bar.

http://maps.google.com/maps/mm?hl=en

by chaning it to:

http://maps.google.com/maps/mm?hl=zh-CN

As expected, I get Simplified Chinese version of google maps. So to switch UI language in gmap is to append “?hl=LANG_CODE” to the URL, such as:

http://maps.google.com/?hl=en

Will load the gmap front page in English. Some LANG_CODE I tried which are recognized by gmap is: de, en, fr, ko, ja, ru, zh-CN and zh-TW. (See language identifier for a complete list)

]]>
http://www.liucougar.net/blog/archives/179/feed 0