Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Sunday, April 11, 2010

Great News and Bad News for Wizardpen Linux driver

It's been more than a year since I posted any updates on the Wizardpen driver, and I have both good news and bad news in relation to that.

First, the bad news is that: I'm now on the Mac == any breakage of the driver with the latest release of Ubuntu will not be captured or spotted by myself.

But! Here's the good news: the Wizardpen Linux driver is now more actively maintained at Launchpad. I have been subscribing to their code commits for the past year and the code base and configuration files have been cleaned up significantly. And the best part is that they are currently maintaining a list of supported devices the FDI rules so that make using the Wizardpen almost a plug-and-play experience. (well, if PnP doesn't happen, do file a bug report there :))

So, in many ways, I'll be officially stepping down from the responsibility of maintaining the build documentation (which has been pretty stable since 0.7) as well as tracking code updates (as, hopefully, Launchpad will be its permanent home and there's will always at least a code maintainer there to assist).

In case you'd still like to update me on the progress on the driver so that I can post it up here, feel free to email me at seh_hui@yahoo.com.

Sunday, September 13, 2009

What the Linux Wizardpen driver needs right now

To be honest: I don't really check this site often - I am quite used to only log into Blogger when I had something new to say about the progress of the Linux Wizardpen driver. And only recently I found out a lot of comments that was pending moderation and I was completely flooded by old comments, so greatest apology to everyone who had left their questions unanswered, unpublished and unnoticed for the past three months =.=.

Such experience points to a fatal functional flaw: that the driver does not have a functional project structure. Currently here's a few items that the driver need, in order of importance:

  1. A support forum
  2. Package the driver to make it user-friendly, which includes the following:
    • Precompiled packages (DEB, RPM) - I'm aware that there are a few people who had already done so and a couple others working on making it PnP. We need some way for these package maintainers to collaborate with each other
    • Generic FDI rule that could allow PnP to be possible
    • A graphical calibrator program - Similar to what has been done for Aiptek (Or would it better for us to use the gAiptek software and make it more general purpose?)
  3. Choosing a project home for the driver. Currently there's two that has been setup, which I'm aware of:
    1. Feature request and bug fixes, e.g.
      • Better mouse support (i.e. the Genius tablets that came with the stylus and mouse)
      • Correct detection of screen in driver and removal of ScreenX and ScreenY parameters
      • Lines drawn on GIMP/Inkscape not as smooth as what that could be drawn on Windows (workaround: Modify the ScreenX and ScreenY parameters that doubles the current screen resolution)
      • Etc.
    Personally I have to admit I couldn't do it by myself: I really needed a lot of help. Both in terms of building a community site and the programming effort. If anyone is interested, please comment on this thread (with the e-mail followup checkbox checked :), so you get the latest updates on who has the same interest on this project as you do).

    Saturday, September 12, 2009

    Wizardpen driver 0.7 series compatible with Ubuntu Karmic Koala

    Just upgraded my machine to the Ubuntu 9.10 Karmic Koala Alpha 5 and I'm happy to say that Wizardpen would work seamlessly with the next version of Ubuntu. So when October comes, you don't need to worry about the upgrade breaking support for your creative pursuits. (I'll keep you updated in case it breaks some time before the actual launch occur in October)

    Recently there isn't any progress on the driver due to a lack of a active maintainer for the code. Currently there are a few project pages being setup for the driver, currently the one with recent activity was the one at the Wizardpen project in Launchpad: which they are taking up an ambitious goal of setting up the appropriate FDI rule to have it auto-detect most (hopefully all) supported tablets. Greatly appreciate that you'll be able to submit the appropriate `lsusb` output for them to maintain a database of sorts ;).

    Anyway, it is to be noted that Ubuntu 9.10 introduced a lot of major changes in packages: e.g. SCIM input to iBus, utilizing GRUB2 and Ext4 and eventual migration to DeviceKit in replacement for HAL in the future (meaning that the setup guide will need to be updated as soon as Xorg deprecates HAL as well). So I do greatly suggest that you prepare for the release by reading these new changes up.

    Tuesday, April 21, 2009

    wizardpen-0.7.0-alpha2 DEB package now available

    First of all, all thanks to Giorgo Enrico who made the package! I have personally tested it and find it to be working, so I suppose it'd be of great help to those who aren't too comfortable in compiling :).

    Anyway, here's the place to download the packages:
    Driver: http://www.mediafire.com/file/nyzyynygiyy/wizardpen_0.7.0-alpha2_i386.deb
    Calibrator tool: COMING SOON!

    I'm not particular sure about whether it does support 8.10 or not, so if somebody had tested it, please let me know ;)

    Friday, April 17, 2009

    Driver Update: wizardpen-0.7.0-alpha2

    Hi all, I've just made a quick bug fix in relation to the compilation issues with Ubuntu 9.04 and (reportedly, from what I read from the linuxgenius project page) Fedora 11. The code fix should allow the compilation of the driver for both Ubuntu 8.10 and Ubuntu 9.04, however I do need someone to help me test to compile the driver for Ubuntu 8.10.

    The latest driver is available here:

    Till then, have fun!

    Wednesday, November 26, 2008

    Updated Wizardpen Driver (0.7.0-alpha1? :p)

    Out of the blue I received an updated source file in my mailbox for the Linux Wizardpen driver from a very nice guy called Mike. The driver itself addresses a significant amount of improvements including optimization for performance, which I was completely astonished and blown away by it as I previously have to deal with sluggishness when painting in a maximized GIMP window.

    You can download it from the link below:

    (*Note: Yeah, I'm being a stupid dumbass for plugging a version number myself... but I suppose the improvement warrants a major number increment ;)

    List of features: (*Note: UNTESTED means I was never able to test it myself, please feedback if you had problems with it)

    • Major performance and reliability improvements
    • (UNTESTED) Support for bundled scroll-wheel mouse (I know a lot of people wanted this, hence bolded ;)
    • Pressure sensitivity now configurable (Xorg param: TopZ and BottomZ; range: 0-1024)
    • Reliable button press/release event mechanism (using pressure thresholds)
    • (UNTESTED)Support vertical tablet orientation (useful if are using stacked dual monitors and want the tablet layout to the vertical orientation) (Xorg param: Rotate90 - "0" or "1"
    • [UNTESTED] Ability to tell driver your screen size in case gets confused (xorg param: ScreenX and ScreenY)
    • Debug mode (Xorg parm: debugyn - "0" or "1")

    Do have to iterate the fact that Mike should be credited fully for his work and I'm just disseminating this piece of good code :).

    Have fun experimenting and post any bugs or issues found!

    P/S: The installation steps are already outlined here

    (*NOTE: My webhost is acting stupid again, so have to exploit the resources of the "empire" from now :p)

    Sunday, November 02, 2008

    No more shitty Chinese/Japanese display font

    This is sort of a follow up to my previous blog post on fontconfig, and also part of my efforts in making the EeePC a simple-to-use and pretty (in my own view) PC.

    With such a small screen and fonts, complicated Chinese characters will be rendered as unintelligible white space with black dots when using Sung/Ming fonts (宋体,明体). In this case, Gothic/Hei fonts (serif equivalent to East Asian font) are very readable as it is capable to be rendered even with small font sizes. In this case, WenQuanYi's Zen Hei is the best open source Gothic/HeiTi font (and I even highlighted it in one of my post).

    For this setup, I make it more simplistic: Copy a good template which specifies preferred Latin fonts (e.g. /etc/fonts/conf.d/60-latin.conf in Debian) to ~/.fonts.conf. Once that's in place: paste <family>WenQuanYi Zen Hei</family> in each <prefer> section.

    Once that's in place, execute `fc-cache -fv` and restart your applications, and TADA! browsing Chinese sites on Firefox has never been more enjoyable with unified and readable text :D.

    Saturday, November 01, 2008

    EeePC Wireless Toggle Fn+F2 - Quick Troubleshooting Note

    Just installed Debian Lenny to my EeePC 701, after screwing my eeeXubuntu over.

    One of the most common Linux gripes about EeePC is the wireless chipset it's using (probably Asus should choose a more compatible from the start ^^||).

    Have been spending the whole day trying to get the wifi toggle to work, finally I got it to work. Checklist being as follows:

    1. Check whether ath5k is blacklisted or not
    2. Check whether "options pciehp pciehp_force=1" was set properly
    3. Ensuring pciehp was loaded (best way is to add it to /etc/modules)

    With the latest custom, EeePC Lenny installer, item 1 and 2 has been addressed (but no harm double confirming it). So should it not work, try to perform Item 3 and see whether that works for you before you ask the mailing list ;).

    Wednesday, April 16, 2008

    Hello world, Nokia

    That goes without saying ;)

    Don't underestimate this simplistic program though, getting it compiled is hard enough without official Linux support from Nokia and there's no concrete and definite community documentation that outlines how to use the Nokia SDKs in Linux (after Nokia dropping the Concept SDK for Linux, that is). It took me quite a lot of obscure googling to get that working.

    I'm still working out a simpler way to get this done instead of a very hack-ish bash script that I assembled just now. From the steps that was needed, I'm pretty sure that I could do somthing about having it to work with EclipseME (hopefully I'm right at the fact that it'd only involve modify some files that Nokia supplied in their SDKs ;) ).

    Will post a follow-up on my progress while I tinker with it.

    Sunday, April 13, 2008

    Swinging Preferences

    Having more time for myself, I'm back into the continuous effort in tuning my Ubuntu installation to match my usage preferences and making it more pleasant and efficient to use.

    Two of the most interesting switches in my own preferred software: namely favouring Quod Libet over Rhythmbox; Emenese over Pidgin (previously GAIM). What's more interesting that both Quod Libet and Emesene were written in Python and were fairly new players in the open source universe.

    Now, as we know it, the beauty of software in general is all about choice: there's a lot of different implementations of any application domain and users are free to choose any alternatives that were available to them. However, what kept me thinking is that: what had me making the switch from more established open source projects (Rhythmbox and Pidgin) to newer projects instead.

    To think about it, Rhythmbox and Pidgin have served me very well indeed to a point I didn't see the need to change: afterall, it does what I wanted and probably more. But then came Quod Libet and Emenese that not only does everything plus the "killer feature" that I wanted badly:

    • Quod Libet: The "Random by album" plugin (Implemented as a plug-in)
    • Emesene: MSN personal message feature

    Now, looking at the two features above, it's not hard to notice that these two features were never "essential" features; but rather, they were "highly desired" non-critical features. Granted, both of these software doesn't do everything their similar counterparts does, but the thing is that they position themselves as a promising alternative by not only providing all the essential features while being stable but also being able to adapt to more "minor" but "highly desirable" features.

    So really that begs the question: how high such small but highly desirable features be in terms of development priority? On one hand, you need these new features to be in to attract a larger user base (especially if the feature is perceived to be important to a large number of users); on another hand, the feature may as well be a fad that lasts for a short term and devoting too much time with such "features" spells disaster for any projects. I suppose in the end, it's important to have an extensible infrastructure (the plug-in infrastructure?) and a means for users to install and uses these features in a prompt and user-friendly manner (either by bundling them with the main package like Quod Libet, or provide an easy way to obtain them like Firefox).

    Saturday, April 12, 2008

    Sync'ing Nokia 3500 classic with Ubuntu

    It's been about a month or two since I got my Nokia 3500 classic and have had whined a lot about Symbian S40 with it:

    1. Unable to do full phonebook backups on the phone itself
    2. Unable to restore a vCard File (.vcf) that contains multiple phonebook entries on the same file, which is considered a common means of doing backup (at least I'm aware that Sony Ericsson and LG phones does that)

    But at least it supports SyncML, which provides a platform-independent means of information synchronization. So with some effort, I got OpenSync and MultiSync setup to have Evolution and my mobile phone to sync with each other. At the moment I'd say that using these tools made me feel like such information sync'ing architecture is still quite in its infancy stage: mainly due to a lack of user-friendly graphical frontends and seamless integration with the desktop environment. Which is quite a pity really, especially the rise of handheld devices, I'm currently looking forward to more development with such a capability.

    But anyways, for those needing a working syncml-obex-client configuration for the Nokia 3500 classic (via Bluetooth), here's the configuration that I'm using at the moment:

    <?xml version="1.0"?>
    <config>
    <!-- (Only for bluetooth) The bluetooth address if the bluetooth mode is selected -->
    <bluetooth_address>[The Bluetooth address for your Nokia phone]</bluetooth_address>

    <!-- (Only for bluetooth) The bluetooth channel to use. `sdptool browse $MAC` to search for the correct channel -->
    <bluetooth_channel>11</bluetooth_channel>

    <!-- (Only for USB) The usb interface number of the SYNCML-SYNC target. use syncml-obex-client -u (you will need access to the USB raw device) to find it. -->
    <interface>0</interface>

    <!-- The string that the plugin will use to identify itself. Some devices need a special string here. -->
    <identifier>PC Suite Data Sync</identifier>

    <!-- The syncml version to use: 0 for 1.0, 1 for 1.1 and 2 for 1.2 -->
    <version>1</version>

    <!-- if the plugin should use wbxml -->
    <wbxml>1</wbxml>

    <!-- The username to use. Leave empty to not require a username -->
    <username></username>

    <!-- the password for the username -->
    <password></password>

    <!-- sets the connection type to use. 5 means obex over usb, 2 means obex over bluetooth -->
    <type>2</type>

    <!-- If wbxml is enabled, defines wether the wbxml should use string tables -->
    <usestringtable>1</usestringtable>

    <!-- Never send ADD command, but send REPLACE (not needed normally) -->
    <onlyreplace>0</onlyreplace>

    <!-- Workaround around for mobile phones which only use local timestamps and _no_ UTC timestamps! -->
    <onlyLocaltime>0</onlyLocaltime>

    <!-- Sets the maximum allowed size in bytes of incoming messages (some device need this option set). Example: 10000 -->
    <recvLimit>10000</recvLimit>

    <maxObjSize>0</maxObjSize>

    <!-- The name of the contacts db. Must be the same as the phones sends -->
    <contact_db>Contacts</contact_db>

    <!-- The name of the calendar db. Must be the same as the phones sends -->
    <calendar_db>Calendar</calendar_db>

    <!-- The name of the note db. Must be the same as the phones sends -->
    <note_db>Notes</note_db>
    </config>

    Genius Wizardpen with Ubuntu Linux (8.04 only)

    NOTE
    • AN UPDATED TUTORIAL FOR INTREPID IBEX IS AVAILABLE! Need someone to check whether that tutorial is compatible with Hardy Heron
    • [Compatible with Hardy Heron (8.04) ONLY]
    • [TODO]
      • Add a FAQ section (especially the fact that only realized that recently the original forum was down x_x...) -- main proof that I have been neglecting this blog and WizardPen progress these days
      • Any update if necessary

    UPDATE HISTORY:

    21 October 2008

    • Verified that steps are compatible with Intrepid Ibex (using compile by source method),
    • Added draft FAQ [Big TODO item, help needed]

    27 May 2008

    • Added a troubleshooting step in the setting up section which recommends you to regenerate a fresh xorg.conf

    27 April 2008

    • Updated link to download the driver source (Contributor: zack)
    • Included instruction on how to using precompiled driver
    • Modified xorg.conf on where to put the "CorePointer" option

    As Ubuntu 8.04 (Hardy Heron) was released end of April 2008, one of the major change is XOrg 7.3, which sports hot-plugging, auto-configuration, better support of multiple input device and other powerful features. However, with those features in place, the existing Genius Wizardpen driver was not compatible with the latest XOrg.

    Currently, Miriad (whom participated in the original Wizardpen driver forums) have updated the driver to make it compatible with XOrg 7.3 (rejoice!). Here are the instructions to configuring your Wizardpen:

    Obtaining the driver
    Option 1: Using a precompiled driver (Recommended)

    Miriad have provided a precompiled driver for Hardy and can be obtained from http://specificcrap.arbitrarycrap.com/wizardpen_drv.so. Just download the driver and put it in /usr/lib/xorg/modules/input/.

    Option 2: Building from source

    (*Note: I haven't tested this with completely fresh Hardy system though ^^||)

    1. Download the source package: http://specificcrap.arbitrarycrap.com/wizardpen-0.6.0.2.tar.gz
    2. Unpack it somewhere with following command: tar -zxvf wizardpen-0.6.0.2.tar.gz
    3. Grab the necessary packages (UNCONFIRMED! Let me know if I missed out an important package): sudo aptitude install xutils libx11-dev libxext-dev x-dev build-essential xautomation xinput xserver-xorg-dev
    4. Change directory to where you unpacked the source code: cd wizardpen-0.6.0.2
    5. Compile and install the driver: sudo ./configure --with-xorg-module-dir=/usr/lib/xorg/modules && make && make install
    6. Verify that the driver is installed correctly (Check for wizardpen.la and wizardpen.so): ls /usr/lib/xorg/modules/input/wizardpen.*
    Configuring and using your Wizardpen
    1. Connect your Wizardpen tablet (if you haven't already done so)
    2. Find out the name of your tablet : cat /proc/bus/input/devices | grep Name
    3. Edit your /etc/X11/xorg.conf file and type the following (or to verify against your last working xorg.conf with the Wizardpen in Gutsy):
      Section "InputDevice"
      Identifier "Configured Mouse"
      Driver "vmmouse"
      Option "Emulate3Buttons" "true"
      EndSection

      Section "InputDevice"
      Identifier "WizardPen Tablet"
      # Paste the name of the tablet as found in the previous step
      Option "Name" "UC-LOGIC Tablet WP5540U"
      Option "SendCoreEvents" "true"
      Driver "wizardpen"
      Option "TopX" "5619"
      Option "TopY" "6554"
      Option "BottomX" "29405"
      Option "BottomY" "29671"
      Option "MaxX" "29405"
      Option "MaxY" "29671"
      EndSection

      Section "ServerLayout"
      Identifier "Default Layout"
      Screen "Default Screen"
      InputDevice "WizardPen Tablet" "SendCoreEvents"
      InputDevice "Configured Mouse" "CorePointer"
      EndSection
    4. Restart your X server: sudo /etc/init.d/gdm restart (*Note: It'd be better for you to logout, press Alt-F1 to go into the command prompt screen to execute this command)
    5. If X fails to start up, or that the cursor runs amok with unpredictable and unacceptable behaviour (e.g. button mapping screw-ups), I greatly recommend that you execute sudo dpkg-reconfigure xserver-xorg to regenerate a new working copy of xorg.conf and reattempt to configure the Wizardpen again (i.e. repeat Step 3-4 in this section). It may be helpful to read the IMPORTANT NOTE I had below.

    IMPORTANT NOTE: The "SendCoreEvents" option is mandatory to prevent focus stealing between your mouse and Wizardpen, which would lead to a jerky pointer which is not what you'd want when you're drawing ;). It may be required to have your mouse being set with the "CorePointer" option (Reason I'm setting this option for the mouse is because without the actual mouse configured with "CorePointer" would give X11 an option to select the Wizardpen as the core [read: main] pointer and royally screw the button mapping of my mouse).

    Should you find your Wizardpen not working yet, check out the /var/log/Xorg.0.log to see what went wrong (Search for "EE" and "WW" would give you some important hint). Google and the UbuntuForums are always your friend when it come to troubleshooting things ;).

    Till then, good luck and have fun!

    [FAQ - DRAFT]
    1. Wireless mouse for Wizardpen is not working: From my understanding is that support for the wireless mouse that comes with Wizardpen is NOT IMPLEMENTED yet. Therefore it won't work.
    2. Pressure sensitivity not working in GIMP: Check your GIMP preferences at "Edit > Preferences". Under the "Input Devices" menu item, click on "Configure Extended Input Devices...". Choose the WizardPen device and MAKE SURE YOU SET THE MODE TO SCREEN/WINDOW (not "Disabled"). Without that setting, it won't work ;)

    [REFERENCE AND RESOURCES]

    1. WizardPen driver and XOrg 7.3
    2. TabletSetupWizardpen (Ubuntu Community Help)
    3. HOWTO: Setup a wizardpen-based tablet (Ubuntu Forums)

    Wednesday, January 16, 2008

    New Gadget! Asus Eee PC :D

    Here's a new addition to my list of gadgets: say hello to my Asus Eee PC! :D

    This ultraportable is definitely a god-send in my opinion, not only it's small, light-weight and most excitingly, it's really inexpensive! (with UMPCs carrying a much higher price tag) Despite being slightly underpowered, it's already powerful enough for most office applications, which makes it really suitable for myself to lug around should I be outstation for one reason or the other. Neat, huh? :)

    Anyway, been spending two days of restless night to have pre-loaded Xandros Linux removed and have eeeXubuntu installed in its place: together with all the minor tweaks and package installation to make it a personalized power house.

    Still not used to the extremely small keyboard with keys just the size of my own fingertips, so that makes it pretty unsuitable for tasks that require speed typing. But things like normal surfing and stuff was pretty usable. The small 7" screen is really something that needs to get used to as well, my eyes felt strained from time to time (mainly due to the LCD brightness though, 8pt fonts are still very readable in its current state).

    Other than that, I'm looking forward on the possibilities this ultraportable will bring to my work and the computer market overall. With the critical success of the Eee PC, I'm pretty sure most manufacturers will really want to have their slice of the pie as well.

    Do have to say a well job done to the Asus design team whom get it right during its first launch! :D (compared to the hyped tablet PC which no manufacturer seems to make it take off in any sense)

    Monday, November 12, 2007

    No More Hard-to-Read Chinese Text!

    NEWS: Currently the font is included in the Ubuntu Hardy Heron repository! Install the "ttf-wqy-zenhei" package

    Recently I have been continually fine-tuning my Ubuntu to give me the best (i.e. most comfortable) environment for me to work with. One of the major quirks is the hard to read Chinese fonts, which is due to the fact that it's pretty hard to hint SongTi (宋体) fonts.

    Somehow it's pretty surprising that Ubuntu's repositories doesn't come with HeiTi (黑体) or Chinese Gothic fonts, which has thicker strokes. But luckily there's this open source, GPL'ed font foundary, Wen Quan Yi, which does provide their HeiTi variant called "Zen Hei". Basically what I do is grab the package, install the Debian package (execute `dpkg --install wqy-zenhei-0.2.15-1.deb`), adding the configuration to match the font in my /etc/fonts/local.conf file (see my previous article for details) and lastly execute `sudo fc-cache -fv`.

    Once I done that and restart my applications, now I had 100% reliable and perfectly readable Chinese pages! :D

    Friday, November 09, 2007

    From Gentoo to Ubuntu

    By some circumstances, I found myself migrated to Ubuntu Linux from Gentoo. It's not a intentional flavour change, to be honest: but rather just happened that I royally screwed my partition table as I shuffle them around. An attempt to raking in dormant partitions (mainly my old Linux installations) and salvaging them for better use ended up having myself wiped out the LVM partition that my Gentoo lives in. Whoops! No doubt that fdisk may as well be your best friend or your best enemy.

    Luckily I have my home partition and personal data separated out and I didn't have any production MySQL databases (phew...), so I'm still safe :). (that coming from someone who have screwed up Linux several times, my best advice is better to keep all your important out from your OS partition :p)

    So, mainly due to my own laziness of not wanting to spent a whole day just to set a razor-edged Gentoo (i.e. which is very time consuming but you do get to craft every single nook-and-cranny of the system: customized the way you wanted it to), I opt for Ubuntu instead.

    But that said, installing Ubuntu using their Desktop Installation CD is only a breeze if you didn't find the need to use LVM. But in the end, it's not as hard as it seemed as Chantra from Debuntu.org did posted up a tutorial on how to do so, which basically needs you to:

    • Execute `sudo apt-get install lvm2`
    • Setup your LVM partitions; or if you have an existing LVM setup, just activate the volume group by executing `vgchange -ay VolGroup` (where VolGroup is the name of your volume group)
    • Once make sure that the logical volumes have entries in /dev/VolGroup/... (again, VolGroup is the name of your volume group), kick up the installation GUI. Remember to use the "Manual" option when you reached the partitioning section
    • Once installed, DON'T REBOOT FIRST! Mount all your logical volumes and the /boot partition into /target. Chroot into /target, perform an `apt-get update` there then install LVM2 (Otherwise you won't be able to boot into your computer)

    So now I'm running Ubuntu and got it setup in a breeze and I'm pretty impressed on how polished the Ubuntu team have made it to be. Coming from a Gentoo background, I'm really impressed because if you happen to build everything yourself, you'd end up noticing a lot of small quirks which give some rough bumps in interacting with the user interface (especially Compiz, during my days in Gentoo I never seemed to get it "right").

    And never needing to leave my PC overnight to let emerge do it's thing (i.e. compiling updates) is a definite plus :).

    Tuesday, August 14, 2007

    Annoyances: Firefox on FAT, Rhythmbox with iPods

    There had been two minor annoyances that I had faced until now:

    Mozilla Firefox downloading problems on FAT32 partitions

    The Problem: Personally I used a FAT32 partition where I placed all my data that is to be shared, so naturally all downloads will go there. However, downloading with Firefox had been a pain to me: it tends to give me zero bytes zip file downloads as well as the behaviour of appending something extra at the back of the filename (for instance, music.mp3 will become music.mp3.bin, or that package.tar.gz will become package.tar.gz.tar).

    Honestly speaking, that's extremely annoying.

    But apparently I'm not alone, and the reason for that happening, according to one of the analysis being done "In a way it seems to be a permission problem... As soon as the Fat32 partition is mounted with permissions rwx on files and directories, aLocalFile is always executable. When downloading a regular file (something not a binary executable), Firefox seems to set the mode of targetFile to 600, so the expression is true and I get a aborted download and a 0 byte file."

    The Fix: So in a way, this problem highlights one of the biggest mistake I had made to my current Linux setup: I set the mount parameters (/etc/fstab) for my FAT32 partition wrongly. I set the fstab entry as "umask=0007", which is blatantly wrong because that means that all files and directory are set as executable. This can prove to be a great security risk as I might accidentally execute something nasty without me knowing it.

    The more correct way of setting the /etc/fstab entry is to utilize the fmask (file permission mask) and dmask (directory permission mask) parameters, which should be set to something like this "fmask=117,dmask=007", equivalent to allowing read and write (but not execute) to files and all permissions to directories. And that other users whom are not the owner or within the designated group are not able to access it.

    After that is done, remount your partitions and Mozilla Firefox will now download files into FAT32 without problems. (other users reported that this is also the solution for the same problem in NTFS)

    However, it'd be nice if Firefox can acknowledge and fix this minor pet peeve. Or at least throw some sort of a rejection or warning message would be better.

    Rhythmbox doesn't actually "delete" files from iPod

    The Problem: Having an iPod myself, the ability of synchronizing songs from Rhythmbox is definitely a convenience to myself without having to rely on iTunes. However, easy synchronization is only half of the story; deleting them from your iPod is completely different story altogether.

    Now, as a user, I came to expect that I can free up some disk space by right-clicking the songs that I don't want anymore from my iPod's playlist and select the "Move to wastebasket". End of story... or is it? The actual situation wasn't completely so: Yes, the playlist entries were removed, but it doesn't free up any disk space on my iPod at all! Not to mention that my desktop Trash icon doesn't show any indication that the files had been there for me to cleared away.

    Now, that means that the files were dangling somewhere in my iPod and search for these orphans are a complete pain. And it just doesn't make any sense to format my iPod completely because of that either. Double whammy! ARGH~~~!!!

    The Fix: Searching online, apparently this issue has been in Rhythmbox's Bugzilla for quite some time. And worse, the maintainers can't seem to agree the behaviour of "Move to wastebasket" option... for more than one year!

    Although someone has made a patch which does delete the files in iPod from Rhythmbox, if you are having some reason that patching it on your own is not an option (to me it's just because I hate to make a local portage overlay ebuild of Rhythmbox every time the software is updated), there's another workaround to it.

    The workaround is that after you mounted your iPod, go to the root directory of your iPod and add the ".Trash-[username]" directory, where [username] is the username which you usually use in your Linux instance. Which now the "Move to wastebasket" option will move the files that you chose to removed there. And to free up iPod's disk space, just delete the files manually.

    I know, I know, it's a two steps process. But it's better than formatting my iPod completely. And until the time that the maintainers agree that deleting files from the iPod is perfectly OK (or at least have some other intelligible solutions to the problem), that's the safest way to do it.

    Probably it might be a good time for me to search/write a Rhythmbox plugin that does just that.

    Friday, August 10, 2007

    Rsync from Windows to Linux

    With the mounting documentations that I'm having at work, there's always the insecurity that losing them, especially those "critical work-in-progress" documents. To most of us, having some sort of an easy backup solution is a must, but "making things easy" is one of the biggest hurdles that I ended up delaying to find the solution until recently.

    And so I bumped into rsync, which is a fast and secure way to perform backups. And having it installed by default in our office's development server (a Redhat Enterprise Linux 4), I sort of gave it a go.

    So the idea is to have a shortcut at windows so that it can mirror all important documents into Linux, which goes through rsync. Since Redhat have rsync daemon setup to run via xinetd, so the first thing is to setup rsync client for Windows, which is a piece of cake if you install Cygwin packages. Gaztronics.net provides a good tutorial for it (See 1. Cygwin and 3. Client section).

    All is good but now the problem is that everytime when rsync is executed the server always asks for a password. Reason being the rsync that came with Redhat using SSH as the transport protocol, which means you can't simply do a "rsync --password-file=[file]". To automate the authentication step (i.e. not needing to key in the password every time), Troy Johnson had a tutorial which explains how to do it.

    Just for your quick reference, this is the big picture on what I have done ([text in square brackets] denote fill in the blank fields :) ):

    1. Install rsync and ssh Cygwin packages in Windows
    2. Perform a rsync transfer to make sure that it works (basically just a "rsync [local file] [linux-username]@[linuxserver-address]:[remote directory]" would do)
    3. Perform a ssh-keygen at Windows to get a public-private key pair (*Note: You'd have to use "ssh-keygen -t dsa -b 1024 -f [key filename]" command)
    4. Transfer the public key (the file with the .pub extension) to Linux
    5. Copy the contents of the public key into ~/.ssh/authorized_keys and make the necessary modifications (See Troy Johnson's tutorial above)
    6. Perform a rsync transfer test again to make sure that it works and without requiring a password from you ("rsync -e "ssh -i [private key file]" [local file] [linux-username]@[linuxserver-address]:[remote directory])
    7. Write a batch script (refer to Gastronics' tutorial) which automates the whole backup process
    8. Add the shortcut on your desktop and your done :)

    Note that you might face some problems if you have directory names having spaces (especially if you want to backup documents in your My Documents folder. Basically here's my working script for your reference:
    @cls
    @echo off

    rem Rsync job control file

    set DOCROOT=/cygdrive/c/Documents and Settings/shleong/My Documents

    C:\Cygwin\bin\rsync -e 'ssh -i rsynckey' -vrtz --delete --include-from='%DOCROOT%/bin/filelist' '%DOCROOT%/' shleong@linuxserver:docstore

    Monday, July 30, 2007

    Solving unreadable Simplified Chinese text on Gentoo

    It's been a while I have been facing font display issues with Simplified Chinese text in my Gentoo machine. Main reason being the fact that without special fontconfig configuration, it tends to mix Sungti (宋体) and Kaiti (楷体) fonts to display Simplify Chinese text. Not only it's aesthetically unpleasing to see two different fonts on the same line, Kaiti is extremely hard to read under small font sizes due to font hinting. Worst being sometimes you can only see a character space filled random pixels (due to the line too thin to be rendered on screen after hinting) and it's pretty annoying to enlarge your font-sizes just to read those characters.

    The solution can be found in this Chinese article that I had found online. For those who aren't all that proficient in Chinese, here's my own translation to it:


    Title: Font problem in Gentoo

    by yangtse (?)

    Q: I'm using SimSun font in my Gentoo machine. But I don't like how the English alphabets looked in SimSun, is it possible to set the English alphabets to be displayed using other fonts, while still having Chinese characters displayed using SimSun font?

    A: Yes. That's how it's usually done. But most users don't use SimSun; use Uming and WenQuanYi instead.

    In /etc/fonts/local.conf, configure the fonts that you wanted in the serif, sans-serif and monospace font family: Specifying your font of choice for Roman characters first, then specify the Chinese fonts that you wanted next. Then configure KDE or GNOME to use these fonts as the default display font.

    Please refer to my /etc/fonts/local.conf configuration:

    <?xml version="1.0"?>
    <fontconfig>
    <alias>
    <family>serif</family>
    <prefer>
    <family>Bitstream Vera Serif</family>
    <family>DejaVu Serif</family>
    <family>AR PL ShanHeiSun Uni</family>
    <family>WenQuanYi Bitmap Song</family>
    <family>AR PL ZenKai Uni</family>
    </prefer>
    </alias>
    <alias>
    <family>sans-serif</family>
    <prefer>
    <family>Bitstream Vera Sans</family>
    <family>DejaVu Sans</family>
    <family>AR PL ShanHeiSun Uni</family>
    <family>WenQuanYi Bitmap Song</family>
    <family>AR PL ZenKai Uni</family>
    </prefer>
    </alias>
    <alias>
    <family>monospace</family>
    <prefer>
    <family>Bitstream Vera Sans Mono</family>
    <family>DejaVu Sans Mono</family>
    <family>AR PL ShanHeiSun Uni</family>
    <family>WenQuanYi Bitmap Song</family>
    <family>AR PL ZenKai Uni</family>
    </prefer>
    </alias>
    <match target="font">
    <edit mode="assign" name="antialias">
    <bool>true</bool>
    </edit>
    <edit mode="assign" name="autohint">
    <bool>false</bool>
    </edit>
    <edit name="hinting">
    <bool>true</bool>
    </edit>
    </match>
    <match target="font">
    <test name="family" compare="contains">
    <string>Song</string>
    <string>Sun</string>
    <string>Kai</string>
    <string>Ming</string>
    </test>
    <test name="weight" compare="less_eq">
    <int>100</int>
    </test>
    <test compare="more_eq" target="pattern" name="weight">
    <int>180</int>
    </test>
    <edit mode="assign" name="embolden">
    <bool>true</bool>
    </edit>
    </match>
    <match target="font">
    <test name="family" compare="contains">
    <string>Song</string>
    <string>Sun</string>
    <string>Kai</string>
    <string>Ming</string>
    </test>
    <edit name="globaladvance">
    <bool>false</bool>
    </edit>
    <edit name="spacing">
    <int>0</int>
    </edit>
    <edit name="hinting">
    <bool>true</bool>
    </edit>
    <edit name="autohint">
    <bool>false</bool>
    </edit>
    <edit name="antialias" mode="assign">
    <bool>true</bool>
    </edit>
    <test name="pixelsize" compare="less_eq">
    <int>18</int>
    </test>
    <edit name="antialias" mode="assign">
    <bool>false</bool>
    </edit>
    </match>
    </fontconfig>

    Q: Where can I find these fonts?
    A: Please emerge these packages: media-fonts/wqy-bitmapfont, media-fonts/arphicfonts



    Additional steps

    Once you have copied and saved the above /etc/fonts/local.conf file, perform the following command to refresh the font cache:
    fc-cache -fv

    You'd have to restart your applications in order to see the effect.

    [Original article link]

    Tuesday, December 13, 2005

    [LinuxEXP] ADSL Modem/Streamyx Installation

    Just get my ADSL router modem up and running. And to be honest, living without any provided manuals is definitely painful.

    Anyway, long story cut short, here's the basic installation steps:
    (*Note: I'm now using Aztech's DSL600E router modem, connecting to Streamyx)


    1. Connect the ADSL modem to the uplink port of the network switch (usually it's located at the extreme left/right port of the switch, which is usually labelled as "up" or something that is not numbered. Some better switches would have all its port capable of becoming an uplink port, like my ECOM switch)

    2. Connect your client (read: PCs) to the ports on the switch

    3. Configure your network settings to run on DHCP (can be done by accessing Fedora Core 4's menu: System Setting > Network. Click on your network card and edit its setting)

    4. IMPORTANT! This is different from configuring your Windows system: Configure your DNS setting to the DNS server IPs that your ISP provides. (For Streamyx, the DNS IP are 202.188.1.5 [primary], 202.188.0.133 [secondary])
    5. Configure your router setting, usually by accessing to its web interface (in Aztech DSL600E, the address is http://192.168.1.1/. Installation and configuration information can be accessed here

    6. Execute Firefox and see whether you can surf away!



    Note that to configure Windows, the DNS IP is the IP address of the router (in my case, 198.168.1.1). Kinda strange why Windows and Linux behave so differently in this aspect.

    Tuesday, November 01, 2005

    [LinuxEXP] Yum on 28.8K

    Good thing about YUM (aka Yellowdog Updater Modified): It provides one of the simplest ways to install and update your Linux programs without worrying much about dependency issues.

    The ugly thing about YUM: The repository data would take a long time to download on dialup!

    Being a dailup user isn't much fun when it comes to updating software, and the thing that initially frustrates me is that the initial YUM configuration isn't meant to be used for dialup users, which ended up me seeing a lot of YUM complaining about socket timeouts and broken downloads.

    That ain't fun when every second is billed in cents.

    So, what needs to be done is to make the YUM configuration a bit more dialup friendly, this can be done by setting the timeout period a little bit longer, and probably cut down the retries -- Just not to waste time retrying a server which isn't in tip-top condition. Here's what I did with my /etc/yum.conf:

    cachedir=/var/cache/yum
    debuglevel=2
    logfile=/var/log/yum.log
    pkgpolicy=newest
    distroverpkg=redhat-release
    tolerant=1
    exactarch=1
    timeout=60
    retries=1
    obsoletes=1
    gpgcheck=1

    # PUT YOUR REPOS HERE OR IN separate files named file.repo
    # in /etc/yum.repos.d


    And the next thing to make it more dialup friendly is to use less repositories: as in, use only the ones that is only needed. My own preferable way of doing it is to disable every single repository by default, as in modify every single repository's configuration file in /etc/yum.repos.d folder and set enable=0. This will disable YUM from checking the repository upon execution.

    Then, everytime I wanted to execute YUM, I'll enable them manually by executing the command: yum --enablerepo=[repository id] [command, e.g. install/update] [package name].

    So, if you are only upgrading your Fedora packages, probably the only thing that needs to be enabled is Fedora Updates (repository id: updates-released, in file fedora-updates.repo).

    Personally, I use rpm.livna.org repository for some popular open source software which is not included in Fedora Core and Fedora Extra. Since Livna is a complement of Fedora Extra, it's best to enable Fedora Extra together with Livna.

    And as an alternative, which I strongly recommend, is to use a nifty tool called yumex (YUM Extender), which provides a GUI frontend to YUM. The best part of it is that it grabs the repository updates silently in the background, so you can see the repository software list instantly. And it's much more simpler to enable which repository that you want to access to.

    You can grab off from Fedora Extras (try to execute this in the command line to grab it: yum -y install yumex. (Needs to enable extras [Fedora Extras] and probably updates-release [Fedora Updates])