Archive for December, 2008

disable bluetooth on thinkpads on Fedora

Monday, December 29th, 2008

On Fedora 8 already my bluetooth disable button on my thinkpad was broken somehow. It works fine in grub, but iirc once udev is started, it stops working. Since I nearly never use bluetooth, this does not much harm to me. But since Fedora 9, bluetooth is always enabled during boot and then it sucks, that I am not able to disable it again easily. Talking with an expert about this, he told me, that bluetooth can easily disabled with this command:

echo disable > /proc/acpi/ibm/bluetooth

I was also told, that it is possbible to use acpid to run this command when the key is pressed. Nevertheless I wonder, why this out-of-the box since I buyed the thinkpad working button was broken. Asking on the hal-mailinglist did do get me any reply, so if you know anything helpful, please leave a comment. :-)

make force-tag opt-in

Wednesday, December 17th, 2008

On the FESCo meeting on 2008-09-17 the removal of the force-tag make target was decided. But it was also decided to still allow to change cvs tags using

TAG_OPTS=-F make tag

If you want your force-tag target back, simply add this to your ~/.cvspkgsrc file (the first character of the second line should be a tab character):

force-tag: $(SPECFILE) $(COMMON_DIR)/branches
@$(MAKE) tag TAG_OPTS="-F $(TAG_OPTS)"

To ease your life, you can also download this code from my fedorapeople space.

secure:

ssh fedorapeople.org cat /home/fedora/till/public_html/files/cvspkgsrc-force-tag.gmk >> .cvspkgsrc

insecure:

curl http://till.fedorapeople.org/files/cvspkgsrc-force-tag.gmk >> .cvspkgsrc

Don’t forget to check your .cvspkgsrc afterwards.

cached package review buglists

Saturday, December 13th, 2008

The Package Review SIG created some webpages that cache bugzilla queries of package review requests. The pages are currently updated every hour and are a lot faster to load than doing direct queries at bugzilla. This is not something new, but it would be nice if 719 of you readers would pick up a ticket from the unassigned list and perform a review. ;-)

Here are the lists:

Unassigned Review RequestsReview Requests in progressAccepted Review RequestsRejected Review Requests

rpm addsign with gpg agent

Friday, December 12th, 2008

Unfortunately I am not yet able to use my gpg key to create working signed rpms. But during debugging this I had to sign lots of test rpms nevertheless and enter a new password every time. Luckily during the debugging it became clear how to make rpm use the gpg-agent instead of passing the password via a file descriptor to gpg.

Thanks go to Jeff Johnson for motivating me to do this and telling me, that it is ok to modify %__gpg_sign_cmd. And also to Panu Matilainen for backing this up. I normally have a strong aversion against modifying macros that begin with two underlines, but with this encouragement it is not that bad. ;-)

That’s enough talk, here comes the code:

I added this to my ~/.rpmmacros file:

%__gpg_check_password_cmd /bin/true
%__gpg_sign_cmd %{__gpg} gpg --batch --no-verbose --no-armor --use-agent --no-secmem-warning -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}

Now rpm will still ask for a password, but one can enter anything. If the gpg-agent needs a password to unlock a key, it will just fire up the pinentry command, which will then allow three password entry attempts by default. If entering an empty password for rpm is still too annyoing for you, Aaron Hawley described how to use expect to provide a password to rpm.

come to the 25C3

Friday, December 12th, 2008

Hello fellow Fedorians, I was so happy when I noticed that the 25C3 was added to the Fedora events page, to meet more of you in person. But now I checked who will be there and noticed, that there is only one other one other attendee. I guess you all did not notice, that there is a event page for The Congress, but you know now. :-) So please add yourself now! And don’t forget to join the GPG-keysigning event.

cvs via ssh with automatic control socket support

Thursday, December 11th, 2008

A ticket in the Fedora infrastructure request tracker mentioned, that one can use the control socket support of ssh to improve the speed of cvs accesses to Fedora’s cvs. In the ticket, the reporter started manually a ssh that creates a control socket and then uses it with subsequent ssh commands. These ssh commands then do not need to perform a new tcp and ssh handshake and are therefore much faster.

But there was the problem, that the because of some timeout, the socket got killed after around 30 minutes. This is of course pretty annoying. One solution is to create some traffic via the control socket every now and then to keep it open. But then one has still to open the control socket.

I did a little “investigation” and noticed that the ssh command is passed to cvs via the environment variable CVS_SSH. This makes it pretty easy to write a wrapper to first test, whether a control socket exists and to create one, if it does not. Here is what I came up with:


$ cat ~/.ssh/config
Host cvs.fedoraproject.org
ControlMaster auto
ControlPath ~/.ssh/sockets/controlsocket-%h-%p-%r

$ echo $CVS_RSH
/home/till/bin/fedora-cvs-ssh.sh
$ cat bin/fedora-cvs-ssh.sh
#! /bin/bash

SSH_USER=”${2}”
SSH_SERVER=”${3}”

/usr/bin/test -e ~/.ssh/sockets/controlsocket-${SSH_SERVER}-22-${SSH_USER} || /usr/bin/ssh -f -N -l ${SSH_USER} ${SSH_SERVER} </dev/null >/dev/null 2>/dev/null

exec /usr/bin/ssh “$@”

If you extend the ~/.ssh/config file for other hosts, it should work out of the box for every cvs over ssh access that uses port 22. If you want to use a different port, you have to edit it a little.

vnc viewer with unix domain socket support

Tuesday, December 9th, 2008

qemu has this nice feature to open a vnc server, that listens on a unix domain socket. I failed to find a vnc viewer to support connecting to this on Fedora, but the helpful people in #qemu on freenode pointed me gtk-vnc. It is only a library, but it comes with a python example client. It cannot yet open unix domain sockets, but gtk-vnc supports using a file descriptor, instead of connection to a host.. A simple change made it open a unix domain socket from a path, that is given as the first argument:


--- /usr/share/doc/gtk-vnc-python-0.3.7/gvncviewer.py 2008-09-05 14:32:15.000000000 +0200
+++ gvncviewer.py 2008-12-09 16:16:10.000000000 +0100
@@ -164,7 +190,13 @@
port = "5900"
print "Connecting to %s %s" % (host, port)

-vnc.open_host(host, port)
+import socket
+domain_sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
+domain_sock.connect(sys.argv[1])
+
+
+# vnc.open_host(host, port)
+vnc.open_fd(domain_sock.fileno())
vnc.connect("vnc-pointer-grab", vnc_grab, window)
vnc.connect("vnc-pointer-ungrab", vnc_ungrab, window)