Suramya's Blog : Welcome to my crazy life…

January 6, 2010

Problem with gnome Applications looking ugly in KDE4 continues

Filed under: Linux/Unix Related — Suramya @ 10:43 PM

A few days ago I had posted that I figured out a way to stop Gnome Applications from looking ugly in KDE4. Turns out that my statement was not 100% accurate.

Running of gnome-settings-daemon does make the applications look normal but for some reason it only seems to do so for applications already running. If I start a new application that uses GTK then the interface still looks ugly as hell. So till I find a permanent fix, I start all the gnome applications that I need then run the gnome-settings-daemon.

I think that this could be a setting that I can change to fix the problem, but I will have to research/test the solutions before I fix the problem once and for all.

– Suramya

January 5, 2010

Having a Translucent cursor in KDE4 on Debian Testing (Squeeze)

Filed under: Knowledgebase,Linux/Unix Related — Suramya @ 11:03 PM

One of the things I liked about KDE3.5 and KDE4 on Ubuntu was that the mouse cursor was this translucent arrow which looked a lot better than the default one on Windows. When I switched to Debian for some reason I didn’t have that theme installed by default. So I tried searching for it but couldn’t find the theme as its kind of hard to search for translucent cursor in kde and get sensible results.

Today I decided to search again and found this forum post about customizing Ubuntu. Over there he mentioned the names of the the cursor themes installed on Ubuntu. Using that as a base I did some more digging/searching and finally found the name of the package I had to install to get my translucent cursor back.

The package you have to install is called ‘xcursor-themes’ and the theme I needed is called ‘whiteglass’. On Debian you can install it by issuing the following command: apt-get install xcursor-themes

Hope this helps.

– Suramya

December 30, 2009

Getting my HP-Deskjet F380 scanner/printer/copier working on Debian Squeeze

Filed under: Knowledgebase,Linux/Unix Related — Suramya @ 11:20 PM

I have a HP Deskjet F380 All-in-One scanner/printer/copier systems and it is a great machine. I plugged it into my system and started GIMP to scan an image from it. Within about 20 seconds of me powering on the printer I got a popup message in Gimp telling me that my HP printer is ready for use. I printed a test page and it came out fine.

Then I tried to scan an image and I got a message back from SANE that it didn’t find any devices. Checked the system log in /var/log/system and noticed the following error message in the log:

Dec 28 13:36:04 Wyrm python: io/hpmud/musb.c 136: unable get_string_descriptor -1: Operation not permitted
Dec 28 13:36:04 Wyrm python: io/hpmud/musb.c 603: invalid product id string ret=-1

Did a search on the net about the error message and in one of the forums it suggested that I run hp-check to see if I was missing any of the required files. The program gave me a list of missing dependencies that I installed. But the problem still wasn’t solved.

While searching for a solution I found a post on a forum that stated that this person was able to scan an image when running as root but not as a regular user. So I decided to try running xsane as root. When I did that the program ran successfully and detected my scanner. I was also able to scan an image without any issues.

However since its not a good idea to run programs as root, I needed a permanent fix. The same forum gave me a not so elegant but permanent solution to try.

To fix the problem run lsusb and locate the line containing your printer information. On my system the output of the command is:

Bus 002 Device 002: ID 046e:556a Behavior Tech. Computer Corp.
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 009: ID 03f0:5511 Hewlett-Packard DeskJet F300 series
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

As you can see the third line gives the the information for my Printer. Now we need to get the vendor and product ID for the printer. The first set of alphanumeric after the ID is the Vendor ID and the numbers after the ‘:’ denote the Product ID. In my case the ‘Vendor ID’ = 03f0 and the ‘Product ID’ = 5511.

Once we have that information we need to create a new file as root at ‘/etc/udev/rules.d/99-custom.rules‘ with the following content:

ATTR{idVendor}==”VendorID”, ATTR{idProduct}==”ProductID”, MODE=”0666″, GROUP=”lp”

where the ProductID and VendorID are the values we got earlier. Once you make the changes, save the file. Then you can disconnect the printer and reconnect it for the new changes to take effect and your scanner will be ready for use.

Another approach which could have worked was to add the user scanning the image to the group ‘lp’ and ‘scanner’ to give them access to the printer. Keep in mind that I haven’t really tried this approach yet

Thanks to Meson at LinuxQuestions.org for the steps to make the printer accessible to all users.

Hope this helps.

– Suramya

December 28, 2009

How to set different backgrounds for each desktop in KDE4

Filed under: Knowledgebase,Linux/Unix Related — Suramya @ 11:52 PM

As some of you know, linux allows you to have different virtual desktop when using either KDE or Gnome (I haven’t really used any of the other environments). Which is quite useful when you are working on a lot of things and want to reduce the clutter on the screen. I usually separate the windows by task type and then put each task in its own desktop. Makes it easier to work.

In KDE3.5 you could have different background image for each of the virtual desktop which made it easier to identify what desktop you were on currently. In KDE4 that functionality was initially missing for some reason. (Probably because it had to be coded in). Now in KDE4.3 (Maybe 4.2 also. Not sure) this functionality is available again though its not as easy to find as it was in KDE 3.5.

To configure it follow these steps:

  • Click on the desktop cashew located at the top right corner of the screen.
  • Click on ‘Zoom out’ in the drop down menu
  • Choose “Configure Plasma” from the toolbox that appears on the top right corner of the screen
  • In the screen that comes up check the “Use a separate dashboard” option.
  • Check the “Use Different activity for each desktop” option
  • Click on OK
  • Click on the magnifying glass at the bottom of the applets to zoom back into the desktop
  • Now you will be able choose individual backgrounds for each desktop by Right click on the desktop and clicking on ‘Desktop Settings’ . After that change the background like you usually do. But now this background will only be applied to the current desktop and you can repeat this process on another desktop to choose another background for it.

    Thanks to http://userbase.kde.org for the nudge in the right direction.

    Hope this helps.

    Update (12th Jan 2010): Added one step that I had forgotten to include earlier. Thanks to Sebastian for pointing that out.

    Update (19th Sep 2011): These steps no longer work for KDE 4.6.5. New instructions are at: How to set different backgrounds for each desktop in KDE 4.6.5

    – Suramya

    December 27, 2009

    Stop Gnome Applications from looking ugly in KDE4

    Filed under: Knowledgebase,Linux/Unix Related,Tech Related — Suramya @ 3:28 AM

    Since I have been using KDE (even in v3.5) I have noticed that Gnome applications look ugly in KDE. (see screenshot below) In KDE 3.5 I had to install the Gnome theme controller application and apply a theme and it fixed the issue. (I can’t recall the name right now, but it was something gnome-theme-something) but in KDE4 that didn’t work so well.


    Firefox without GTK Themes

    Did a little research and tried various options but none of them worked that well and caused loads of issues. Finally I found a way to get the applications to use the current GTK theme in KDE even after I rebooted the system without any manual intervention.

  • Open a shell prompt or open the Run dialog by pressing Alt-F2
  • Type gnome-settings-daemon and press enter
  • Once you do this all running GTK applications, as well as any more you launch, will switch to your GNOME theme and will look a lot nicer (See screenshot below)


    Firefox with GTK Themes

    As you can see the program looks a lot less ugly with the themes applied. However if you reboot the system without configuring the gnome-settings-daemon to auto start, the applications will go back to the default no-theme state.

    To set the daemon to autostart create a text file called theme.desktop (Actually This can be anything you want as long as you keep the .desktop extension) in the ~/.kde/Autostart directory with the following contents:

    [Desktop Entry]
    Exec=gnome-settings-daemon &
    Name=GNOME Settings Daemon
    Type=Service
    X-KDE-StartupNotify=false
    OnlyShowIn=KDE;

    Once you create the file and save it, KDE will start the Gnome settings daemon everytime it starts.

    Note: On some systems the autostart directory is located in the ~/.kde4/share/autostart folder.

    Hope this helps.

    Source of the tip: Tombuntu.com

    – Suramya

    December 26, 2009

    Installing Nvidia Video drives on Debian Testing (Squeeze)

    Filed under: Knowledgebase,Linux/Unix Related — Suramya @ 3:15 AM

    The default VGA drivers in Debian Testing worked fine for normal use, but when I tried to activate some of the effects like Fade, Shadow, Translucency etc the system told me that it couldn’t do it. I thought that this could be because I have an Nvidia video card and hadn’t installed the Nvidia driver yet.

    I tried installing it using synaptic but for some reason when I added the nvidia driver it told me that I would have to remove pretty much most of my xorg (the GUI backend) install. So I aborted it. Did a little search on the web and found the following instructions to install the driver at pendrivelinux.com:

  • Log in as root
  • Type apt-get install build-essential linux-headers-$(uname -r) (to install the Linux headers)
  • Type cd /usr/src (Change to the source directory)
  • Type ln -s linux-headers-$(uname -r) linux (To create a virtual link ‘linux’ that points to the latest linux-headers downloaded)
  • Type wget http://us.download.nvidia.com/XFree86/Linux-x86/100.14.23/NVIDIA-Linux-x86-100.14.23-pkg1.run (Download the NVIDIA installer)
  • Type /etc/init.d/gdm stop (to stop gdm and drop to a terminal)
  • Type cd /usr/src && sh NVIDIA-Linux-x86-100.14.23-pkg1.run (to launch the nVidia installer script)
  • I ran all the commands above but the installer kept telling me that the kernel-headers were missing. Tried a couple of things that didn’t work.

    Finally ran NVIDIA-Linux-x86-100.14.23-pkg1.run –help to see what command line parameters are supported by the installer. Noticed that they had a –update parameter that was supposed to update the installer to the latest version. I ran the installer with –update and it downloaded the latest version of the installer. After the download completed it automatically ran the installer which updated my system without any errors.

    So if you are trying to install the nvidia drivers using the installer and it keeps complaining about the headers missing even though you have them installed try running it with the –update option.

    Now I have all the effects I wanted to enable working fine.

    – Suramya

    Installing Debian Testing “Squeeze”

    Filed under: Linux/Unix Related — Suramya @ 2:55 AM

    As I said in my previous post. I have gotten tired of Ubuntu and am in the process of going back to a standard Debian install. This is the first time after a lot of years that I am installing Debian from scratch on my system, before this the last Debian version I installed from base was version 3. What I have been doing recently is that I boot off a Kanotix CD (Live CD based on Debian) and write that to the drive. Once that was done I would point the system to Debian repositories and then do an upgrade.

    This time I decided to do a plain install, so I downloaded the “Debian GNU/Linux testing “Squeeze” – Official Snapshot i386 CD Binary-1 20091221-04:49″ from the Debian site and burned it to a disk. I downloaded this version instead of the Stable snapshot because I was anyways going to upgrade to Testing so this should save me some time in downloading new/updated packages.

    I hit a couple of issues during the install which might be because I was using the testing snapshot but can’t be sure:

    1. The graphical install didn’t work. If just gave me an error when I tried to run it. So I did a text install, which worked fine
    2. After the install completed, I found that grub was not installed correctly. If kept giving me an error that grub_printf was undefined. To fix this, I booted the system off the installation CD in ‘Rescue Mode’ and told the system to reinstall grub on the main harddrive. That fixed that issue.

    Other than that I had no issues installing Debian on my system. All built-in devices have been working ok so far. Will post more on any issues I hit during customization etc later.

    – Suramya

    December 17, 2009

    I am now an Official RHCE (Red Hat Certified Engineer)

    Filed under: Linux/Unix Related,My Life — Suramya @ 2:40 AM

    I gave my RHCE exam yesterday morning and today I got the email confirming that I have cleared the exam and am now a Red Hat Certified Engineer. Go me 🙂

    Now I can put this image next to my name and everything: red_hat_cert_eng_logo-clr

    Next I am thinking about going for the Red Hat Certified Security Specialist (RHCSS) exam sometime early next month. Still have to plan it out though, ’cause I want to go scuba diving also. Lets see.

    – Suramya

    October 3, 2009

    Upgraded my desktop and OS

    Filed under: Linux/Unix Related,My Life — Suramya @ 5:14 PM

    As some of you know I have been complaining about my old desktop for a while now. It was a good system for its time but it had its issues. For example, if I hooked up more than 3 harddrives to the system it would refuse to boot, if I left my USB drive connected during boot it wouldn’t start up. Too much data transfer over USB would cause the entire USB subsystem to shut down. Finally it got to the point that I couldn’t leave my Bluetooth adapter connected to USB if I wanted the system to boot. So I decided to upgrade.

    Now I am the proud owner of an AMD Phenom X4 9650 Quad core processor with 2 GB of RAM. It works great. Initially I had some issues with it but now its all sorted out and the computer is super fast. The problem I faced initially was that my old hard-drives were too slow for the new motherboard and when I installed the OS on any of the old drives the system was spending anywhere from 20% to 55% of its time waiting for data from the HDD.

    Now I also have a 1 TB (Terabyte) SATA drive which is very fast so I had to create a partition on it for Linux which involved moving 500GB of data to different partitions which took me almost 3 days, thanks to interruptions and slow computer speeds etc. But now that I am running off the SATA the system is superfast and responsive.

    In addition to upgrading the system I have also moved to Ubuntu (from pure Debian) and am running KDE 4.x now instead of KDE 3.5. Its a bit irritating trying to figure out how to do stuff again but I am slowly getting used to the new look/feel. What I find most annoying is that it feels like they have removed features from KDE3.5 and have come to KDE4. For example in KDE3.5 I could set my konsole to be translucent and it would show my desktop but in KDE4 it shows the windows behind it. Also I can’t seem to be able to set the size of the window (80×25 lines etc) in the config.

    In all there are minor irritations but over all its working the way I want it to. Mostly.

    Well this is all for now. Will post more later.

    – Suramya

    September 3, 2009

    Sort a file list by Date in Linux (Including Subdirectories)

    Filed under: Computer Tips,Linux/Unix Related,Tech Related — Suramya @ 7:35 PM

    I use Amarok to play music and I really like it, however my Playlist was created in Winamp/XMMS which I initially thought that Amarok couldn’t read. So all the new music I got since I switched to Amarok was no longer being added to a playlist, I just added the new songs manually then used the select 50 random songs option to play music.

    Yesterday I figured out that Amarok does indeed read .m3u files (Winamp Play lists) so I wanted to add all the new music I have to the top of the old playlist. So basically I needed a list of all music in my system sorted by date. If you have been using Linux and are reasonably familiar with it then I think the first thing that came to your mind must have been: “Why can’t we just use ls -lRrt”? That’s pretty much what I thought. But unfortunately this command doesn’t work very well for what I wanted to do.

    After playing around for a while I finally managed to get the system to show me a list of all music files in my system sorted in reverse chronological order. The command I used for this is:

    find -name "*.mp3" -print0 | xargs -0 stat --format '%Y %n'|sort -r

    Now the explanation:

    • find -name “*.mp3” : returns a list of all mp3 files in the current directory and any subdirectory under it.
    • -print0: This tells find to use the ASCII NUL character instead of space to separate the filenames. If we don’t use this then xargs chokes on the spaces in file names.
    • xargs -0: This tells xargs to use the ASCII NUL character instead of space to separate the filenames.
    • stat –format ‘%Y %n’: This runs the stat command on every file returned by find. This command returns the Time of last modification as seconds since Epoch followed by the name of the file.

      e.g.

      suramya@Wyrm:~$ stat --format '%Y %n' unison.log
      1251802152 unison.log

    • sort -r: sorts the list using the first column (the creation time) and displays the result.

    ——-

    Example execution result in my Scripts directory:

    suramya@Wyrm:~/bin$ ls -l
    total 2648
    -rwx------ 1 suramya suramya      77 2009-01-10 04:30 bookfixer.sh
    -rwx------ 1 suramya suramya      76 2009-01-10 04:30 cardDesigner.sh
    -rwx------ 1 suramya suramya     548 2009-01-10 04:30 change_wan.sh
    -rwx------ 1 suramya suramya     478 2009-01-10 04:30 compare_entire_dir.sh
    -rwx------ 1 suramya suramya    3462 2009-01-10 04:30 delay.pl
    -rwx------ 1 suramya suramya      66 2009-01-10 04:30 EditPlus
    -rwx------ 1 suramya suramya      88 2009-01-10 04:30 export_xterm
    -rwx------ 1 suramya suramya     203 2009-01-30 04:29 extract.sh
    -rwx------ 1 suramya suramya   82558 2009-01-10 04:30 lit2html
    -rwx------ 1 suramya suramya     320 2009-01-10 04:30 makedir.sh
    -rwx------ 1 suramya suramya      49 2009-01-10 04:30 mapsql
    -rwx------ 1 suramya suramya     369 2009-01-15 02:11 MuteUnmute.sh
    -rwx------ 1 suramya suramya 2350194 2009-01-10 04:30 pdftohtml
    drwx------ 2 suramya suramya    4096 2009-01-10 04:30 Poet
    drwx------ 2 suramya suramya    4096 2009-01-10 04:30 Remote
    -rwx------ 1 suramya suramya     109 2009-02-08 19:47 resize.sh
    -rwx------ 1 suramya suramya      48 2009-01-10 04:30 rootscan
    -rwx------ 1 suramya suramya     397 2009-01-10 04:30 S41firewall
    -rwx------ 1 suramya suramya     111 2009-02-21 20:15 sync_website.sh
    -rwx------ 1 suramya suramya     116 2009-01-10 04:30 text2img
    -rwx------ 1 suramya suramya     122 2009-01-10 04:30 uncompress.sh
    -rwx------ 1 suramya suramya  180580 2009-01-10 04:30 vcdgear
    


    suramya@Wyrm:~/bin$ find -name "*" -print0 | xargs -0 stat --format '%Y %n'|sort -r
    1235227520 ./sync_website.sh
    1235227520 .
    1234102660 ./resize.sh
    1233269990 ./extract.sh
    1231965676 ./MuteUnmute.sh
    1231542033 ./vcdgear
    1231542033 ./uncompress.sh
    1231542033 ./text2img
    1231542033 ./S41firewall
    1231542033 ./rootscan
    1231542033 ./Remote/StarFlight
    1231542033 ./Remote/Firestorm
    1231542033 ./Remote/CyberNibble
    1231542033 ./Remote
    1231542033 ./Poet/poet.tar.gz
    1231542033 ./Poet
    1231542033 ./pdftohtml
    1231542033 ./mapsql
    1231542033 ./makedir.sh
    1231542033 ./lit2html
    1231542033 ./export_xterm
    1231542033 ./EditPlus
    1231542033 ./delay.pl
    1231542033 ./compare_entire_dir.sh
    1231542033 ./change_wan.sh
    1231542033 ./cardDesigner.sh
    1231542033 ./bookfixer.sh

    As you can see, the ‘sync_website.sh’ script is the latest script in that directory.

    Hope you find it useful.

    – Suramya

    « Newer PostsOlder Posts »

    Powered by WordPress