Skip to content

alsa and no sound in Debian Squeeze x64 GNOME

I started to use Gnome recently under my Debian Squeeze and I noticed that I have no sound in flash (youtube) as well as in vlc. Well, it seems like I need to configure my .asoundrc with the proper card id. Here is a nice command which allows you to enum your devices:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC1200 Analog [ALC1200 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC1200 Digital [ALC1200 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: default [Microsoft LifeChat LX-3000 ], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

In my case I am going to use 3 as I am going to use Microsoft USB headphones to listen music. It might be different in your case. So, create file ~/.asoundrc with the following content:

pcm.!default {
	type hw
	card 3
}

ctl.!default {
	type hw
	card 3
}

Save the file and try to check if you have sound.

Smart Auto Replier reborn

I hate throwing away good things. Lately I was doing backup of my hard drive and I noticed a bunch of code I wrote in 2004 known as Smart Auto Replier plugin for Miranda. To my surprise it was quite big amount of code and it was pity to let it just fade away.

Given the fact that many things have changed in the last 8 years, and the code from 2004 looks just awful for me, I decided to boost it with some interesting idea and base it on top of ugly existing code :) . I said to myself, that when doing auto replying, people would most likely need some level of flexibility, so that they will be able to make different conditions based on different input data. The best way to implement this is to implement a programming language inside SAR. However, I have just a 30 minutes of free time per normal day, so re-implementing a wheel is not the best way for me.

This is how I decided to hook-in Lua programming language into SAR. Lua is fast and well-known and can provide a huge level of customization to SAR. User will be able to set different conditions as well as write/read to files, and with time I will develop more functionality regarding conditions part. So, starting from now, SAR will have basically one script function which will get’s executed when you write a message to a client equipped with SAR:

function this.SAR(this, hUser, szMessage, szUser, szProtocol)
    this:SendMessage(hUser, "Here is my autoreply!")
end

As you can see, the function this.SAR accepts a few parameters: this, hUser, szMessage, szUser, szProtocol. These parameters are actually indicating the input to function, so you can set different conditions which will let you to auto reply in a smart way. For example, let’s assume that you want to auto reply only to a user named “Sad”. In this way, your SAR function should look like this:

function this.SAR(this, hUser, szMessage, szUser, szProtocol)
    if szUser == "Sad"
    then
        this:SendMessage(hUser, "you are user Sad")
    else
        this:SendMessage(hUser, "you are not user Sad you are: ")
        this:SendMessage(hUser, szUser)
    end
end

Now, assume you want to reply only if user is writing you from ICQ protocol. This is easy with Lua: you can combine code as a blocks:

function this.SAR(this, hUser, szMessage, szUser, szProtocol)
    if szUser == "Sad"
    then
        this:SendMessage(hUser, "you are user Sad")
    else
        this:SendMessage(hUser, "you are not user Sad you are: ")
        this:SendMessage(hUser, szUser)
    end

    index = string.find(szProtocol, "ICQ")
    if index == nil
    then
        this:SendMessage(hUser, "you are not writing from ICQ protocol")
    else
        this:SendMessage(hUser, "you are writing via ICQ protocol")
    end
end

The best way to master SAR is to check the documentation for Lua: http://www.lua.org/docs.html. I agree that it may be not very user friendly to start from reading the docs for Lua, but on the other hand, I am trying to cover basic things which already may work out for newbies and provide them a good start.

Starting from now, SAR will have it’s own official forum where questions should be asked: http://shcherbyna.com/forum/viewforum.php?f=8. Do now hesitate to ask anything, I will try to be responsive. (well, still remember about 30 minutes per day … :) )

Despite that, SAR will have it’s own web-page which will list all configuration options and well-known scripts: http://www.shcherbyna.com/?page_id=1747

GPLing oldish code

Back in 2004 I did a small plugin for Miranda IM messenger which was providing auto replying facility. I uploaded it to Miranda database and since that time it had ~ 40 000 of downloads. Some people were inspired with it and based on it some other plugins: Simple Auto Replier

Recently I came across this code and decided to make it GPL and put in Google Code project. Here it is: http://code.google.com/p/smart-auto-replier/

It was fun to look at my own code which is 8 years old.

KMail: “Signing failed: Bad passphrase” message in Debian 6 Squeeze KDE

I was recently trying to setup automatic signing of messages in KMail and I hit a problem : each time I am sending something, I got the message “Signing failed: Bad passphrase” without any opportunity to enter passphrase for my private key. It looks like this:

 

It seems like you have to specify proper path to pinentry-program in your configuration. Do the following:

1. Find out the exact path to pinentry-gtk-2:

$ whereis pinentry-gtk-2
pinentry-gtk-2: /usr/bin/pinentry-gtk-2 /usr/share/man/man1/pinentry-gtk-2.1.gz

As you can see, in my case the path is /usr/bin/pinentry-gtk-2

2. Edit file ~/.gnupg/gpg.conf by uncommeting # use-agent so it becomes use-agent

3. Create file ~/.gnupg/gpg-agent.conf and put into the path to pinentry-gtk-2. Here is content of my ~/.gnupg/gpg-agent.conf:

$ more ~/.gnupg/gpg-agent.conf
pinentry-program /usr/bin/pinentry-gtk-2

Make sure that you put the proper path (the one from Step 1)

4. Reboot machine and try to send something from KMail. It should work now.

Compiling kext for Intel82566mm under Lion 10.7.2 64-bit

I was recently playing with Intel 82566MM device driver for Mac OS X based on the e1000e open source project and noticed that the driver is really targeted for 10.6 and is unable to compile easily under Lion 10.7.2.

I decided to play a little bit and compile it for Lion 10.7.2 x64 bit. Here it is: modified package which compiles under Lion 10.7.2 x64 with already pre-compiled kext file.

Things mostly changed in Makefile:

1) Added “-arch x86_64 -isysroot ${SYSROOT} -mmacosx-version-min=10.7 -Xlinker -kext”

2) Set proper SDK path and paths for gcc & g++

3) Modified some warnings in Intel82566MM.cpp which end up like errors during build in 10.7.2

Changing background color of iGoogle or Google pages?

I noticed that since the beginning Google is not allowing to change background colour of it’s pages. It is pity, as if you take for example DuckDuckGo you are able to modify the background color easialy: DuckDuckGo Settings page. Moreover, you can easily specify to use always HTTPS, which is not yet the case for Google.

I prefer usually gray colors, as the white color is too bright for my eyes. Background with C4C4C4 seems to be ideal for me, and since I am fun of customization, I guess, I will have to use DuckDuckGo for a while :)

Not Idle Task tool for Linux

Since I am using Debian most of my free time, I decided to re-write Not Idle Task tool for Linux. Voilà:

If you have no idea what the “Not Idle Task” tool does, please consult the following page: http://www.shcherbyna.com/?page_id=1382

This version is tested in Debian 6 x86_64 and Fedora 16 x86_64 and is supposed to work in KDE based distributions. I have some ideas about Windows and Mac OS X support, and I guess I will release versions for these operating systems soon.

This software is GPL, you can find the sources here. You can download binary for x64 version of KDE distributions here.

Have fun!

Happy New Year! (2)

New machine, up-to-date, one week old. Was running happily until BSOD occured :)

BugCheck E0010002, {fffffa800703a000, c, 205, 94e}

Probably caused by : nusb3xhc.sys ( nusb3xhc+14bbc )

Followup: MachineOwner
---------

0: kd> !analyze -v
*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************

Unknown bugcheck code (e0010002)
Unknown bugcheck description
Arguments:
Arg1: fffffa800703a000
Arg2: 000000000000000c
Arg3: 0000000000000205
Arg4: 000000000000094e

Debugging Details:
------------------

CUSTOMER_CRASH_COUNT:  1

DEFAULT_BUCKET_ID:  VISTA_DRIVER_FAULT

BUGCHECK_STR:  0xE0010002

PROCESS_NAME:  System

CURRENT_IRQL:  0

LAST_CONTROL_TRANSFER:  from fffff880064f1bbc to fffff80002c81c40

STACK_TEXT:
fffff880`035c49f8 fffff880`064f1bbc : 00000000`e0010002 fffffa80`0703a000 00000000`0000000c 00000000`00000205 : nt!KeBugCheckEx
fffff880`035c4a00 00000000`e0010002 : fffffa80`0703a000 00000000`0000000c 00000000`00000205 00000000`0000094e : nusb3xhc+0x14bbc
fffff880`035c4a08 fffffa80`0703a000 : 00000000`0000000c 00000000`00000205 00000000`0000094e 00000000`00000000 : 0xe0010002
fffff880`035c4a10 00000000`0000000c : 00000000`00000205 00000000`0000094e 00000000`00000000 00000000`00000000 : 0xfffffa80`0703a000
fffff880`035c4a18 00000000`00000205 : 00000000`0000094e 00000000`00000000 00000000`00000000 fffff880`064dec19 : 0xc
fffff880`035c4a20 00000000`0000094e : 00000000`00000000 00000000`00000000 fffff880`064dec19 fffffa80`00000205 : 0x205
fffff880`035c4a28 00000000`00000000 : 00000000`00000000 fffff880`064dec19 fffffa80`00000205 fffffa80`0703a000 : 0x94e

STACK_COMMAND:  kb

FOLLOWUP_IP:
nusb3xhc+14bbc
fffff880`064f1bbc ??              ???

SYMBOL_STACK_INDEX:  1

SYMBOL_NAME:  nusb3xhc+14bbc

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: nusb3xhc

IMAGE_NAME:  nusb3xhc.sys

DEBUG_FLR_IMAGE_TIMESTAMP:  4da56d4d

FAILURE_BUCKET_ID:  X64_0xE0010002_nusb3xhc+14bbc

BUCKET_ID:  X64_0xE0010002_nusb3xhc+14bbc

Followup: MachineOwner
---------
0: kd> lmv m nusb*
start             end                 module name
fffff880`064dd000 fffff880`06515000   nusb3xhc T (no symbols)
    Loaded symbol image file: nusb3xhc.sys
    Image path: \SystemRoot\system32\drivers\nusb3xhc.sys
    Image name: nusb3xhc.sys
    Timestamp:        Wed Apr 13 11:30:53 2011 (4DA56D4D)
    CheckSum:         000377C3
    ImageSize:        00038000
    Translations:     0000.04b0 0000.04e4 0409.04b0 0409.04e4

I wonder, why do I attract these things? :) I was even trying to keep this machine out of my drivers to make sure my code does not cause problems )))

Happy New Year!

Time is passing very fast, and the new, 2012 Year has just arrived. I wish you all the best in 2012: achievements of your goals, good health, and a very, very positive attitude to life!

A+

Configuring Hamachi autostart under Debian 6 x86_64

I guess most of you know what VPN is and how it may be useful for you. Among different VPN solutions, Hamachi seems to be the most popular and easy to use for home users. You can easially install it in Windows or Mac and create/join VPN network just in a few clicks. Under Linux, however, things are going less smoothly.

First, it is not open source :( However, you can download binaries for Linux for free: http://files.hamachi.cc/linux/ (x86 version only). If by some reason you cannot download files from Hamachi ftp, you can try my blog file storage.

So, download the file hamachi-0.9.9.9-20-lnx.tar.gz to your machine and untar it. Read readme file and perform the installation:

(do this as sudo)

$ sudo apt-get install ia32-libs
$ sudo make install
$ sudo tuncfg

(do this as regular user)

$ hamachi-init
$ hamachi start
$ hamachi login

Now you have a choice. You can either use Hamachi via command line (check README file) or you can download a GUI tool which replicates the UI of a Windows version: hamachi-gui. Download file hamachi-gui_0.9.5-0_i386-gutsy.deb or hamachi-gui_0.9.5-0_amd64-gutsy.deb depending on architecture of your distribution and install it using dpkg -i command, i.e.:

$sudo dpkg -i hamachi-gui_0.9.5-0_amd64-gutsy.deb

Now search “Hamachi” in your program list in section “Internet”. You can do most of the things you can do in Windows version: create networks, join networks, modify your computer name, etc.

However, if you reboot your computer, Hamachi would not autostart. You will have to manually start it via “hamachi start” each time which is quite uncomfortable :) You can solve this problem by editing your /etc/rc.local file and starting there “tuncfg” as a root and “hamachi start” as a regular user:

/sbin/tuncfg
/bin/su - USERNAME -c "hamachi start"
exit 0

Store this in your /etc/rc.local and make sure you set USERNAME to a name of your user, and after reboot everything will be autostarted properly.