Archive for the ‘Projects’ Category

* firefox and dark theme in debian

Posted on March 15th, 2011 by Alex. Filed under Linux.


Readable drop down field of a web formThe main problem of using a dark theme is the way Firefox/Iceweasel displays the (drop down) fields of web forms. Most of the times black font is displayed on dark background render the fields completely useless. To read the text you have to mark it to make it visible. Finally I found a solution to overcome this problem at least in Debian (Squeeze with Iceweasel 3.5.16). This blog entry just summarizes everything up.

I prepared a zip archive with the necessary files. Before you overwrite any files, it is advisable to copy them to a save location in case you would like to restore them at a later point in time.

  • Copy forms.css to /usr/lib/xulrunner-1.9.1/res/ and userContent.css to ~/.mozilla/firefox/XXXXX.Default User/chrome
  • Restart the browser and enjoy readable fields from now onwards.

.



* autofs, automount and umount

Posted on January 20th, 2011 by Alex. Filed under Linux.


Recently I am playing around with autofs and configured my laptop such that a plugged in pen drive will be automatically mounted into well-defined mount points. I always disliked the way Ubuntu mounts devices: Since I am working on consoles most of the times, I have to figure out the name of the device that I just connected, each and every time, before I am able to jump to the according directory. To be honest, it also has an advantage: You know immediately which drive is mounted at which mount point in case multiple devices are plugged in at the same time. But that is not a problem for me.

I configured udev and autofs according to the following wiki entries:

But instead of udevadm info --query all --path /sys/block/sdb/sdb/ as suggested, I am using udevadm info --name=/dev/sdb --attribute-walk which shows much more information (and sometimes it is hard to find the right entry).

Everything worked fine and whatever I plugged into the USB ports, the drives got mounted to the configured mount points. However I ran into a problem that is not solved as the many unanswered threads in several forums of helpless users nicely demonstrate: If a drive is mounted by autofs, how does the normal user umount it without the necessity to change to root (if that is an option at all)?

As normal user and after autofs mounted the device, you will get usually something like:

alefel@jitu:~$ umount /media/usb0
umount: /var/autofs/removeable/usb0 is not in the fstab (and you are not root)

Ok, the /etc/fstab entry can be solved, so you add a line looking like this one:

/dev/sdb1 /media/usb0 auto noauto,noatime,nodiratime,users,rw,exec,suid,async,uid=1000,gid=1000, umask=0072 0 0

Please note the option users ensuring that other users apart from the one who actually mounted the device, can umount it. Try it out:

alefel@jitu:~$ umount /media/usb0
alefel@jitu:~$

You also have to set the options in the auto.removable right. E.g.:

usb0 -fstype=auto,noatime,nodiratime,users,rw,exec,suid,async,uid=1000,gid=1000,umask=0072 :/dev/usb0

To ease your configuration, I am adding my relevant files at the end of this post.

However it might be helpful to know, how autofs actually works. After reading and following the wiki entries given above, you will have something like

/var/autofs/removeable /etc/auto.removeable –timeout=2

in your /etc/auto.master. The man pages about timeout say that it “sets the global minimum timeout, in seconds, until directories are unmounted.” (man automount) or “sets the default mount timeout” (man auto.master). This entry is a little bit misleading. To explain the purpose of the timeout directive, shut down autofs:

root@jitu:/# /etc/init.d/autofs stop

and start it manually:

root@jitu:/# automount -v -f

(-v means, be verbose and tell us what autofs is doing and -f starts autofs in the foreground. Crtl+c will stop autofs again. You can also try -d instead of -v to see even more.)

Plug in your USB pen drive. What will happen in the console that shows the output of autofs? Surprisingly apart from text printed during the start of autofs

Starting automounter version 5.0.4, master map /etc/auto.master
using kernel protocol version 5.01
mounted indirect on /var/autofs/removeable with timeout 2, freq 1 seconds

nothing else is happening. Open another console and do an ls onto the supposingly mounted drive:

ls /media/usb0

Then autofs will print something more:

Starting automounter version 5.0.4, master map /etc/auto.master
using kernel protocol version 5.01
mounted indirect on /var/autofs/removeable with timeout 2, freq 1 seconds
attempting to mount entry /var/autofs/removeable/usb0
mount(generic): mounted /dev/usb0 type auto on /var/autofs/removeable/usb0
mounted /var/autofs/removeable/usb0
1 remaining in /var/autofs/removeable
1 remaining in /var/autofs/removeable

And exactly 2 seconds later, some lines will be printed additionally:

Starting automounter version 5.0.4, master map /etc/auto.master
using kernel protocol version 5.01
mounted indirect on /var/autofs/removeable with timeout 2, freq 1 seconds
attempting to mount entry /var/autofs/removeable/usb0
mount(generic): mounted /dev/usb0 type auto on /var/autofs/removeable/usb0
mounted /var/autofs/removeable/usb0
1 remaining in /var/autofs/removeable
1 remaining in /var/autofs/removeable
expiring path /var/autofs/removeable/usb0
unmounting dir = /var/autofs/removeable/usb0
expired /var/autofs/removeable/usb0

That means that the drive was idle for 2 seconds and hence got umounted. Therefore a manual umount does not make any sense, since most of the time, it is already umounted. If you do an ls /media/usb0; umount /media/usb0 (basically a back-to-back execution of commands), the drive is umounted successfully and the last 3 lines are not printed. In fact, if I do an cd into /media/usb0 the line “1 remaining in /var/autofs/removeable” is printed by autofs every second.

The configuration files:

.



* qr codes

Posted on December 4th, 2010 by Alex. Filed under Android, Cycle Tours.


Sometimes you can find strange squared black and white patterned images in the Internet these days like this one.

These images are called QR Codes (Quick Response) and they contain information such as an URL, binary data, or plain text. Nowadays an application (such as Barcode Scanner for Android) running on a cell phone makes use of the camera of the cell phone to read out its content. I started integrating the QR code to ease the download of the GPX, I collected during my cycles tours. If someone is interested in the same or similar tour, he can download the GPX traces easily by pointing the camera of his cell phone onto the code and the cell will start to download the file automatically. Ideally his cell phone has also a GPS receiver and a application such as TrekBuddy (with maps) installed so that the route can be followed easily. There is no complicated downloading the file to a PC, copying via e.g. Bluetooth etc. necessary anymore.

.



* froyo for samsung galaxy s arrived in india

Posted on November 29th, 2010 by Alex. Filed under Android.


Actually I did not want to wait more time to install Android 2.2 alias Froyo on my Samsumg Galaxy S (GT-I9000) phone and was ready to try out Kies Registry Patcher to force the update. So I rebooted into Windows and connected the phone to the PC. Started Kies to backup all contacts, memos, sms, etc (just in case) and suddenly a small window popped up, informing me about the software update.

The previous build number was ECLAIR.DDJG4 with firmware version 2.1-update1, kernel: 2.6.29 jh755.kim@SE-S605 #2 and baseband version I9000DDJG4
The new build number is FROYO.DDJP6, kernel 2.6.32.9 root@SE-S605 #1 and baseband version I9000DDJP2

Finally it has arrived….

.



* kies and samsung galaxy s

Posted on October 14th, 2010 by Alex. Filed under Android.


Finally after uncountable tries I was able to connect my Samsung I9000 (Galaxy S, Vibrant, etc) with Windows XP Professional (32bit). All the tips and tricks (trying USB debugging, different modes, etc) mentioned in the forums did not lead to any solution and Kies (version: 1.5.1.10074_45) was not able to detect the phone at all. At maximum something like “Kies cannot connect to the phone in mass storage mode, connection terminated.” came up. In my case it was Launcher Pro and after killing it, it worked.

Here is what I did:

  1. Do not connect the phone and exit/kill all Kies applications (especially Kies.exe) you find on your Windows box.
  2. In the phone go to Settings, About phone, USB settings and select Samsung Kies. Any other setting (e.g. Ask on connection) did not work.
  3. Go back to the main settings screen, choose Applications, Manage applications.
  4. Choose LauncherPro and select Clear defaults
  5. Go to home screen (press home key) and select TwLauncher instead of LauncherPro
  6. Connect the phone via the USB cable
  7. The home screen will vanish and an application called MTP Application is started.
  8. Wait till your Windows box is done with driver installation.
  9. Launch Kies.

One note: If you were successful and connected Kies to the phone, do not perform a firmware update immediately. Check you status of your backups, since all applications that you have installed, will be deleted during the firmware update process.

.



* purge removed debian packages

Posted on August 23rd, 2010 by Alex. Filed under Linux.


The package manager on Debian based systems differs between removing a package and purging it. When a package is removed, the executable files and libraries (if not shared by others) are deleted from the hard disk. However the configuration files remain so that, if you reconsider your decision and reinstall a package, it does not need to be configured anymore. If a package is purged, all files belonging to the package are removed.

For many years I used to remove packages only. The recent problem was that over the time some changes were done to udev and it started to complain about an old format of a configuration file.

udevd[8055]: SYSFS{}= will be removed in a future udev version, please use ATTR{}= to match the event device, or ATTRS{}= to match a parent device, in /lib/udev/rules.d/someFile.conf

However this file belonged to a package that was removed a long time ago and hence not updated along with udev. I wanted to clean up my system and purge all removed packages. This can be time consuming task, if the package count of removed packages crosses some hundreds. Use

dpkg --get-selections | grep deinstall

to show removed packages and use

dpkg --get-selections | grep deinstall | wc -l

to count them.

Fortunately the package manager provides an easy command to purge all removed packages at once:

aptitude purge ~c

.



* mobility radeon catalyst driver in windows

Posted on March 9th, 2010 by Alex. Filed under Projects.


AMD/ATI does not provide Catalyst drivers (Windows) for its graphic adapters in laptops. The Mobility product line is only supported through notebook manufacturers and hence someone has to download the drivers from the websites of e.g. Dell, Acer, ASUS, etc. But what if the drivers are outdated or worse, if a Mobility Radeon is built into a laptop that is not designed to have one? The politics of nVidia is different and everybody von a nVidia graphics adapter can download and use the nVidia driver. Honestly I assumed the same applies for ATI drivers and it took me some time that Radeon HD3650 mentioned in the supported devices list of Catalyst does not mean Mobility Radeon HD3650.

To install the Catalyst driver anyway, I needed to follow these steps (it was a clean Windows installation, so maybe you have to get rid of an old driver first):

  1. You need the Catalyst driver. Current is 10.2, but it is not supported in DH Mobility Modder.NET. The team is working on that though. Instead I downloaded Catalyst 9.12 (for Windows XP). There are also Omegadrivers maybe you want to try out one of those.
  2. Start the installation of Catalyst, but interrupt the process, when the first dialog comes up after all files got decompressed. Now all the installation files are in C:\ATI\support\9-12_xp32_dd_ccc_wdm_enu (or any other directory that you chose).
  3. Download and install DH Mobility Modder.NET (have a look at the compatibility list mentioned on this side). You need Microsoft .NET Framework 3.5 SP1 (online/offline installer) and MSXML 6.0 to run this program.
  4. Point DH Mobility Modder.NET to the files in the directory stated above and let it process the data.
  5. Execute setup.exe located in C:\ATI\support\9-12_xp32_dd_ccc_wdm_enu\Driver\. That will install the Catalyst Control Center (CCC). However the driver (and hence the most important part) fails to install due to the unsigned driver (missing certificate) as stated in the protocol. Furthermore, you might run into the problem that nothing can be installed at all and the installation process aborts with an error (I had the experience in 10.2, but I do not know, if it also occurs in 9.12). If it fails (error message: “Catalyst Install Manager has failed”), you should check this thread. By applying this patch (the filename starts with the language e.g. CHS = Chinese Simplified, ENG = English, etc and ends with the architecture: x86 = 32bit systems, x64 = 64bit systems), the installation worked on a clean Windows XP professional 32bit installation without hassle. However there are users who report crashes in various other applications after applying the patch.
  6. After installation is done and the driver is not installed, go to your Device Manager and update the driver manually. For that you choose the location of the driver to be in C:\ATI\support\9-12_xp32_dd_ccc_wdm_enu\Driver\Packages\Drivers\Display\XP_INF\. Confirm the unsigned drivers. Now the installation will be completed successfully.

[Update 16/04/2010]
The information given above is not up-to-date anymore. Since the release of Catalyst 10.3, it also supports Mobility Chips natively without the necessity to patch the drivers with DH Mobility Modder.NET.

.



* installation of ati hd 3650 in lenny

Posted on March 7th, 2010 by Alex. Filed under Linux.


I replaced my nVidia GT8600M with an ATI Radeon HD 3650. The installation of the fglrx driver is a complete mess. Maybe this posting will help you to enable the driver in your Debian/Lenny box.

My setup

At my workplace I have a external monitor (max resolution: 1280 x 1024@60Hz). However the DDC database reports this monitor to also support 1400 x something, which results in the display of “Cannot support current resolution” on the screen.
The LCD of my laptop has a resolution of up to 1680×1050 (Lovely, isn’t it? :D Btw, 15.4″, nice NON-glossy screen etc.)
At work I have to give a presentation sometimes, so the LCD screen should be mirrored at a resolution of 1024×768. Otherwise I would like to have a big desktop stretched over 2 screens, so that I can move windows from one side to the other.

At my home there is no external monitor and I rely only on the LCD.

Installation

I installed the proprietary drivers downloaded from ATI (fglrx, version 10.2). I tried to use kernel 2.6.33 (which was released a week ago), but despite a patch, the compiled module did not load due to some missing symbols. So I downgraded to 2.6.32.9. But even then, the installation failed. As far as I remember, the ati-installer script was complaining about a missing directory in /usr/X11R6/lib/modules or similar.
Soon I found a description which resulted in a flawless packaging and kernel module compilation. Despite the fact, the fglrx is in version 10.2, following the steps mentioned for 10.1 lead to success.

Configuration

The configuration was pretty easy and straight forward. However fglrx is heavily using xrandr and since I had nVidia earlier, I was not used to that nor did I know. The nVidia configuration relied heavily in xorg.conf and I thought the same about fglrx.

Issues

There are some issues with fglrx.

  1. The external monitor does not show the proper resolution despite the fact Modeline etc are mentioned in xorg.conf.

    Solution: The problem seems to be that fglrx is not interested in the data reported by the monitor at all. Even if a ModeLine is forced by UseMode, it is completely ignored by fglrx and the highest reported resolution is used (which is incompatible with this monitor as mentioned earlier). Here is an example of that section.

    Section "Monitor"
    Identifier "Monitor1"
    HorizSync 30.0 - 80.0
    VertRefresh 50.0 - 76.0
    Option "VendorName" "Dell"
    Option "ModelName" "E177FP"
    Option "DPMS" "true"
    ModeLine "1280x1024_60.00" 108.9 1280 1360 1496 1712 1024 1025 1028 1060 -hsync +vsync
    Option "PreferredMode" "1280x1024_60.00"
    UseModes "1280x1024_60.00"
    EndSection

    The solution is to alter the resolution bt xrandr while GDM is loaded. For that I added the lines
    EXTERNAL_OUTPUT="CRT1"
    INTERNAL_OUTPUT="LCD"
    xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
    if [ $? -eq 0 ]; then
    xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off
    fi

    before gdmwhich () (right at the beginning) in /etc/gdm/Init/Default. These additional lines switch off the external monitor (anyway it does not have to show anything) only if it is connected. My xorg.conf is available at the end of this post.

  2. After the user logged in, the attached monitor should be automatically detected and switched on.

    Solution: Thanks ThinkWiki there is a solution for doing so. To ease the switch between externalMonitorOff, mirror and bigScreen I created 3 executable files in /usr/local/bin/xrandr that allow me to switch the mode instantly. To access the files, you have to create starters in Gnome (e.g. right click on desktop -> “Create Launcher”)

  3. After suspend to RAM and resume, the external monitor is switched off and I have to execute something like
    xrandr --output LCD --auto --output CRT1 --off
    xrandr --output LCD --auto --output CRT1 --left-of LCD --mode 1280x1024

    to reinitialize my desktop and to power up my external monitor.

    Solution: A post in the Ubuntu forum leads to the solution. Put the commands into a file in /etc/pm/sleep.d/.

  4. Now the fglrx driver is installed, what about Compiz?

    Compiz should work without any problem, however the resize issue (nVidia, but nevertheless same issue) resurfaced here again. It is very much annoying and I do not use compiz and the moment. I really look forward for the driver radeonhd to support 3D acceleration so that I can discard the whole fragile installation of fglrx.

Download

The zip file contains

  • my xorg.conf. This also includes the old xorg.conf of the nVidia card. The xorg.conf can be found in /etc/X11/.
  • the scripts that allow me to switch between the modes rapidly. Depending, what is executed, I get a my desktop stretched of 2 displays, a mode with the external VGA port switched off or with the content displayed on my LCD mirrored. To figure out the names of the --output parameter, use xrandr in the console.
  • /etc/gdm/Init/Default
  • /etc/X11/Xsession.d/45custom_xrandr-settings. Do not forget to make this file executable. It is called by the next file.
  • /etc/pm/sleep.d/restoreScreen.sh. This file also needs to be executable.

Download!

.



RSS Feeds:

Search:


Pages:

Categories:

Archives: