L'uso di questo sito
autorizza anche l'uso dei cookie
necessari al suo funzionamento.
(Altre informazioni)

Thursday, December 2, 2010

Centos 5.5 or RHEL 5 on VIrtualbox 3.2.12?

Make yourself a favour and check "Enable I/O APIC" under Settings=>System=>Motherboard, lest the God of Virtual Machines gets angry at you and hangs your machine at installation.

Monday, November 22, 2010

Pidgin: soluzione per omega.contacts.msn.com "invalid certificate chain"

Problema: Pidgin è un client multiprotocollo di instant messaging. Da alcuni giorni (Novembe 2010), il plugin per MSN di pidgin va in errore lamentando una "invalid certificate chain" per omega.contatcts.msn.com.


Origine e soluzione:
Microsoft ha iniziato a firmare i propri certificati, ma (pare) che i loro webserver riferiscano ancora i certificati alle authority intermedie sbagliate. Bisogna scaricare i certificati di microsoft:

e poi installarli in /usr/share/purple/ca-certs (C:\Program Files\Pidgin\ca-certs\ sotto windows)

Wednesday, November 17, 2010

Setting up a PPTP link on a fedora system, without NetworkManager

NetworkManager is a Linux applet (Not really. It is a system daemon, and it is controlled via desktop applets, but still...) It allows you to setup and manage (activate, deactivate and such) network connections. It is mostly OK for desktop usage, and I'd say it is more than OK for wireless connections. I do have some major bones with it, though:


  • It is greedy - it tends to hog all the network connections, included the ones that should not be touched (your main ethernet connection,for instance), and you have pry them from its dead, cold fingers.

  • It screws up - sometimes. When it does, you're on your own without a lifeboat - unless you thought to bring one with you, and this is because....

  • Having been designed by GUI zealots, it has no Command Line Interface (well it does have one, but it sucks more than a tornado) and no visible configuration files - to the best of my knowledge it keeps all its config somewhere inside the user branch of the gconf DB (a configuration system that makes the windows registry seem OK - 'nuff
    said). So it is very hard to tell what is going wrong, where and why.

  • Not only this, but because it is in the user branche, connections are not shared between users, nor can they be system wide (AFAIK)

  • Not only this, but because it is so GUI oriented, there is no clear way to tailor the connection setup/tear down. For instance, on pptp/vpn links it would be nice to set up custom routes. No such luck, kiddo: with NM it's either default route or zilch (there is, truth be said, a check mark that purports to do something different, bu it does not. Or perhaps it would do something with some server side help - but this is the client side, sorry.)



So it is only fair to say that, for server oriented connection management, NetworkManger basically sucks - and I find slightly worrying the talks I read about system-config-network going away. However, what above explains why - setting up a systemwide VPN link for development work - I found it necessary to ascertain that I had a CLI way to set it up, tear it down and debug it. That is the lifeboat I was talking about a few paragraphs ago....

This was tested on FC13, kernel 2.6.34.7-61, ppp-2.4.5-9 , pptp-1.7.2-9, for a standard MSCHAP-V2 Microsoft like tunnel - your mileage will vary, and substantially if your system is much older then mine. Everything is still a little rough around the edges - smoothing it out would require integrating it with ifup-ppp, complete with all the options and stuff. The way it is, it pushes most configuration options to the ppp side (options.pptp and peers/CONNID). And yes, one would need a GUI plugin for system-config-network. You are welcome to write it. At the end, you will be able to control the connection via:


$ ifup CONNID
$ ifdown CONNID


It goes like this (by no design of mine: this is THE WAY networking scripts work in fedora/RH):



  • 'ifup CONNID' reads /etc/sysconfig/network-scripts/ifcfg-CONNID;


  • the variable DEVICETYPE=pptp (inside ifcfg-CONNID) directs ifup to invoke ifup-pptp (an undocumented innard of the RH sysconfig files);


  • ifup-pptp executes "pppd call CONNID", which uses /etc/ppp/peers/CONNID, (which in turn reads /etc/ppp/options.pptp).


  • PPPD starts the ppp process and kicks off ip-up, which (eventually) calls /etc/ppp/ip-up.local. pppd also saves its PID in /var/run/pppx.pid (x is 0,1...)


  • ip-up.local saves the interface name (pppx) inside /var/run/pptp-CONNID.pid (misnomer, but ehi)


  • ifup-pptp waits for the creation of /var/run/pptp-CONNID.pid and uses


  • its contents to try hard (too hard, perhaps: i have a feeling ifup-routes is being called twice, but no harm appear to have been done) to convince to /etc/sysconfig/network-scripts/ifup-routes to install the correct routes for the new interface.


  • ifup-routes reads the route informations /etc/sysconfig/network-scripts/route-CONNID, and uses "ip route add " to do its job.

To get to the goodies, you will need to edit/create the
following files (contents are listed below).


  1. FILE: /etc/ppp/options.pptp. Edit and accept some auth, compression. Most comments below removed: #ALF# means commented out by me)


  2. FILE: /etc/ppp/chap-secrets: edit. Add authentication information user and password, choose CONNID as you wish


  3. FILE: /etc/ppp/peers/CONNID: Create.


  4. FILE: /etc/ppp/ip-up.local: Create.


  5. FILE: /etc/ppp/ip-down.local: Create.


  6. FILE: /etc/sysconfig/network-scripts/ifcfg-CONNID: Create.


  7. FILE: /etc/sysconfig/network-scripts/ifup-pptp: Create, mode
    755 (rwx-rx-rx).


  8. FILE: /etc/sysconfig/network-scripts/ifdown-pptp: Create, mode
    755 (rwx-rx-rx).


  9. FILE: /etc/sysconfig/network-scripts/route-CONNID: Create



FILE: /etc/ppp/options.pptp. Edit and accept some auth, compression.


(Most comments below removed: #ALF# means commented out by me)

 
lock
noauth
refuse-pap
refuse-eap
#ALF#refuse-chap
#ALF#refuse-mschap
#ALF#nobsdcomp
#ALF#nodeflate
#ALF#For debug, comment later.
dump

FILE: /etc/ppp/chap-secrets: edit. Add authentication information (user and password), choose CONNID as you wish




# Secrets for authentication using CHAP
# client server secret IP addresses
####### system-config-network will overwrite this part!!! (begin) ##########
####### system-config-network will overwrite this part!!! (end) ############

username CONNID password *


FILE: /etc/ppp/peers/CONNID: Create.




#vpn.server.com is the server we connect to
pty "pptp vpn.server.com --nolaunchpppd"
lock
nodeflate
file /etc/ppp/options.pptp
require-mppe-128
#As entered in chap-secrets above
name username
remotename CONNID
ipparam CONNID


FILE: /etc/ppp/ip-up.local: Create.



#!/bin/bash
set -x
TRACEFILE=/tmp/ip-up.log
cat /dev/null > ${TRACEFILE}
exec 1>> ${TRACEFILE} 2>> ${TRACEFILE}

LOGGER="/usr/bin/logger -s -t ip-up.local -p "

IFACE=$1
REALDEVICE=$2
SPEED=$3
LOCALIP=$4
REMOTEIP=$5
LOGDEVICE=$6

PIDFILE="/var/run/pptp-$LOGDEVICE.pid"
$LOGGER daemon.info "Creating pidfile: $PIDFILE"
echo $IFACE > $PIDFILE
exit 0

FILE: /etc/ppp/ip-down.local: Create.



#!/bin/bash
set -x
TRACEFILE=/tmp/ip-down.log
cat /dev/null > ${TRACEFILE}
exec 1>> ${TRACEFILE} 2>> ${TRACEFILE}

LOGGER="/usr/bin/logger -s -t ip-down.local -p "


FILE: /etc/sysconfig/network-scripts/ifcfg-CONNID: Create.



NAME="Connessione PPTP a CONNID"
DEVICE=CONNID
DEFROUTE=no
BOOTPROTO=none
DEVICETYPE=pptp
ONBOOT=no
USERCTL=yes
PEERDNS=no
IPV6INIT=no
NM_CONTROLLED=no


FILE: /etc/sysconfig/network-scripts/ifup-pptp: Create, mode 755 (rwx-rx-rx).




#! /bin/bash
LOGGER="/usr/bin/logger -s -t ifup-pptp -p "

. /etc/init.d/functions

cd /etc/sysconfig/network-scripts
. ./network-functions


CONFIG=$1
[ -f "${CONFIG}" ] || CONFIG=ifcfg-${1}
source_config

[ -x /usr/sbin/pppd ] || {
echo $"pppd does not exist or is not executable"
echo $"ifup-ppp for ${DEVICE} exiting"
$LOGGER daemon.info \
$"pppd does not exist or is not executable for ${DEVICE}"
exit 1
}

PEERCONF=/etc/ppp/peers/${DEVNAME}

if [ ! -f ${PEERCONF} ]; then
$LOGGER daemon.info \
$"no configuration file ${PEERCONF} for ${DEVICE}"
exit 1
fi

$LOGGER daemon.notice \
$"calling pppd on ${PEERCONF} config file: pppd call $DEVNAME" \

pppd call $DEVNAME || { $LOGGER daemon.crit "pppd call $DEVNAME failed" ; exit 2 ; }


for nap in 1 2 2 5 10; do
if [[ ! -f /var/run/pptp-${DEVNAME}.pid ]]; then
$LOGGER daemon.info "Waiting for /var/run/pptp-${DEVNAME}.pid"
sleep $nap
else
break
fi
done

if [ -f /var/run/pptp-${DEVNAME}.pid ] ; then
REALDEVICE=$(tail -1 /var/run/pptp-${DEVNAME}.pid)
$LOGGER daemon.info \
$"setting up routes from /var/run/pptp-${DEVNAME}.pid on $REALDEVICE"
/etc/sysconfig/network-scripts/ifup-routes ${REALDEVICE} ${DEVNAME}
else
$LOGGER daemon.info \
$"no file /var/run/pptp-${DEVNAME}.pid cannot setup routes"
fi

exit 0


FILE: /etc/sysconfig/network-scripts/ifdown-pptp: Create, mode 755 (rwx-rx-rx).




#! /bin/bash

cd /etc/sysconfig/network-scripts
. ./network-functions

LOGGER="/usr/bin/logger -s -t ifdown-pptp -p "

CONFIG=$1
source_config


CONFIG=${CONFIG##ifcfg-}
ifile=/var/run/pptp-${DEVICE}.pid

$LOGGER daemon.info "Tearing down pptp link: will look for $ifile"
if [ ! -f $ifile ]; then
$LOGGER daemon.err $"No intfile $ifile, ppp isn't running, or we didn't start it"
exit 1
fi

IFACE=$(cat $ifile)
[ -n "${IFACE}" ] || { $LOGGER daemon.err $"No interface in $ifile"; exit 2 ; }

pfile=/var/run/$IFACE.pid
$LOGGER daemon.info "Tearing down pptp link: will look for $pfile (interface is $IFACE)
"
PID=$(cat $pfile)
[ -n "${PID}" ] || { $LOGGER daemon.err $"No pid in $pfile"; exit 2 ; }

if [ ! -f $ifile ]; then
$LOGGER daemon.err $"No PPP pidfile $pfile, is ppp running?"
exit 3
fi

kill -TERM ${PID} > /dev/null 2>&1
$LOGGER daemon.info $"Waiting for PPPD termination"
[ ! -d /proc/${PID} ] && { $LOGGER daemon.info $"PPTP link torn down"; exit 0; }

$LOGGER daemon.info $"Waiting for PPPD termination"
sleep 2
[ ! -d /proc/${PID} ] && { $LOGGER daemon.info $"PPTP link torn down"; exit 0; }

$LOGGER daemon.info $"Waiting for PPPD termination"
sleep 5
[ ! -d /proc/${PID} ] && { $LOGGER daemon.info $"PPTP link torn down"; exit 0; }

$LOGGER daemon.info $"Waiting for PPPD termination"
sleep 10
[ ! -d /proc/${PID} ] && { $LOGGER daemon.info $"PPTP link torn down"; exit 0; }

# killing ppp-watch twice in a row causes it to send a SIGKILL to pppd pgrp
kill -TERM ${PID} > /dev/null 2>&1
[ ! -d /proc/${PID} ] && { $LOGGER daemon.info $"PPTP link torn down"; exit 0; }

$LOGGER daemon.err $"Problems in terminating PPP."
exit 1


FILE: /etc/sysconfig/network-scripts/route-CONNID: Create




ADDRESS0=192.168.63.0
NETMASK0=255.255.255.0
#this is the P-t-P (remote) address at the end of the PPTP tunnel.
GATEWAY0=10.52.63.1

Thursday, October 14, 2010

Nomen. Omen?

La Gazzetta di Modena di oggi riferisce dell'arresto di un uomo per tentata estorsione ai danni del fratello: i due erano stati soci di una pizzeria (fallita) e l'uomo arrestato, cui il fratello doveva ancora una somma, aveva fatto diverse minacce (anche di morte) per rientrarne in possesso.

L'arrestato si chiama Pio, il fratello Fortunato. Nè Pio, nè Fortunati....

Tuesday, October 12, 2010

Vento e luna


萬古長空    Un' eternità di spazio senza fine:
一朝風月    Un giorno di vento e di luna.    


An eternity of endless space:
A day of wind and moon.


The Golden Age of Zen: Zen Masters of the T'Ang Dynasty

Monday, October 11, 2010

Chi non si può difendere

Tutti gli uomini sono mortali.
Socrate è un uomo.
Quindi Socrate è mortale.

Sono secoli che ce la pigliamo con Socrate. Forse perché a dire certe cose di noi stessi ci vogliono le palle. (O forse perché ai filosofi in fondo piace sparlare dei colleghi. Questa però mi convince meno).


Tuesday, October 5, 2010

Alsa, pulseaudio, KDE & HDA-Intel Realtek ALC887 under Linux

Sue me, but I'm gonna out and say it: sound management under Linux suxx big time and it has done so for the longest time. It's laden with incomprehensible jargon and the most intricate jumble of competing technologies you can think of. Bottom line: lots of times, you have trouble getting audio out of your system.

My problem: FC13 with kde (but other WMs also, so KDE does not really enter into it) does occasionally:

1) switch unrequested from "Internal analog stereo" to HDMI Manhattan whatever
2) Forget entirely the "Internal analog stereo" device (shows up greyed out in multimedia)

Guess what? the "Internal analog stereo" device is the one outputting audio to my headphiones and loudspeakers. There are two hard things here: understanding (better: get a feel for) what's going on and fixing it.

I have (as of now) no general guide but I have found these commands to be of great help in finding out what the problem may be:

pacmd ls
alsamixer
alsaunmute
paman
pavumeter
pavucontrol
yum install pulseaudio-utils
modinfo soundcore

These - paman especially - also help in fixing the "switch device" problem, while:

rmmod snd-hda-intel
modprobe snd-hda-intel

Appear to fix the forgotten device problem.

All for now...

Friday, October 1, 2010

Don Byas, “No such thing as a wrong note!”

Who influenced you?

In the beginning, it was “Hawk” [Coleman Hawkins]. That sound always stayed with me and never got away. In fact, I think I have a bigger sound now than he had. Apart from that, I dug what he was playing. Art Tatum really turned me on. That’s where my style came from … style… I haven’t any style. I just blow, like Art. He didn’t have any style, he just played the piano, and that’s the way I play. We were real close, and he loved me. He used to sit down and talk to me and one day he said, “Don, don’t ever worry about what you’re going to play or where the ideas are going to come from. Just remember there is no such thing as a wrong note.” He said, “What makes a note wrong is when you don’t know where to go after that one. As long as you know how to get to the next note, there’s no such thing as a wrong note. You hit any note you want and it fits in any chord.” And that’s right! There is no such thing as hitting a wrong note. It’s just that when you hit that wrong note, you’ve got to know how to make it right.

That’s when the doors started opening for me music wise. From that time I started practicing and remembering that and all of a sudden I said, “That’s where it is.” There’s no way you can hit a wrong note, as long as you know where to go afterwards. You just keep weaving and there’s no way in the world you can get lost. You hit one. If it’s not right, you hit another. If that’s not right you hit another one, so you just keep hitting. Now who’s going to say you’re wrong? You show me anybody who can prove you’re wrong. As long as you keep going you’re all right, but don’t stop unless you know you’re at a station. If you’re at a station then you stop, take a breath and make it to the next station. Tatum turned me onto that. He was a genius. I had been with Tatum for two years on the West Coast. I came to New York in 1935, and we hung out together every night. It was during that time that he taught me all those things. I came to New York with Eddie Mallory’s band. Mallory’s wife, Ethel Waters, opened up in the Cotton Club, Duke Ellington was playing with his band and so was Eddie Mallory, two big bands.

There was nobody playing what I was playing because I played all that stuff from Tatum. That F-sharp, B-natural, E, A, D, G, C, F, like in rhythm, instead of playing rhythm chords. Everybody was saying what is that? Where did this cat come from? Who is he? There weren’t any horn players following piano players at that time, so I was ahead of everybody.

“Bird” [Charlie Parker] got a lot of things from me. I met Bird when he was about fourteen in Kansas City, so I’ve been knowing him for a long time. Even after Bird got to New York with Jay McShann, we were still real tight, and he used to always come and get me when he wanted to go and jam, which was damn near every night. He would say: “Come on, Don, we’re going to play ’Cherokee’”. That was his favorite tune. What people don’t know is that Bird got a lot of stuff from me, although he was influenced more by “Pres” [Lester Young]. Pres was really his boy. There was another cat, Buster Smith, and somebody else, I forget his name, but those are the cats who influenced Bird. They were all around Kansas City at that time. That was in the early thirties. Bird was a little cat, fourteen years old and blowing! He hadn’t developed then. He didn’t really start blowing till he got to New York; then he stretched out. That man could blow! You listen to the music now and you ask yourself what people are talking about when they compare somebody with Bird? Even “Trane” [John Coltrane] was influenced by him, although he went much further, but Bird was his idol.

Trane was tight. Every time he came to Europe, the first place he would go to, he would ask, “Where is Don Byas?” Always went where I was playing, never said hello. He’d just come in, sneak in. I don’t know how this cat did it. He would sit in the club all night and never move. I wouldn’t know he was there. I’d say to myself, “That looks like Trane sitting back there.” So when the set was over, I would go and ask, “How long have you been here?” He’d say, “I just came in.” Trane was something else. You would never know he was in the joint.

Have you ever felt any kind of protest in music?

I’m protesting. If you listen you will notice I’m always trying to make my sound stronger and more brutal than ever. I shake the walls in joints I play in. I’m always trying to sound brutal without losing the beauty, in order to impress people and wake them up. That’s protest, of course it is. I’ve always felt like that. The point is how long will people keep me waiting before they come in. I’m wondering if things will finally come my way before I pop off. Actually right now there aren’t that many cats left that are blowing—me and “Griff” [Johnny Griffin], who else is there? There are a lot of young cats, but I don’t even know them. I’m talking about the ones on the top. My form of protest is to play as hard and strong as I can. In other words, you did this and you did that, so now take this!

Do you feel unrewarded for the contribution you made to our music?

Yes, in a way, but I can’t say I’m angry, because I split at the top of my success, so actually a lot of it is my fault. I can’t get mad at anybody but I can get mad in my music. When I play, I can allow myself to get mad. I split twenty-five years ago. This cat [Calvin Massey, present at the time of the interview] asked me the night before I left, “When are you coming back?’ I said, “When they build a bridge!”

You were one of the first musicians to settle in Europe?


I was the first. I came with Don Redman, after the war. I had a beautiful success and made a lot of money. I’ve just stopped making money during the last three or four years. Things got low. So many cats have come over and are still coming that things have dropped down. There isn’t the demand there was before, so that makes it a little rough. I’m not squawkin’. It’s just that I’m going to try some different things and see if I can’t put a little firecracker under. [Don Byas was expecting to go to Africa with Archie Shepp.] I think it would be nice to change things around a little bit for a while.

I’ve been going in a straight line for so long, it’s not going to hurt me to do that. That tape recorder is on! Yeah you’ve got to be a cross-eyed motherfucker to make it in life.

Paris, November 11, 1969

Tuesday, September 14, 2010

Taking ttyS0 away from xen

On xen machines, (linux-Centos5 Dom0) xen is in the habit of grabbing /dev/ttyS0 for its console, so if you need the serial port for other purposes (a modem, or UPS control) you are royally screwed.

Symptoms:

# modprobe 8250
FATAL: Error inserting 8250
(/lib/modules/2.6.13-15.8-xen/kernel/drivers/serial/8250.ko): Device or
resource busy

# setserial -a /dev/ttyS0
Cannot get serial info: Invalid argument


The trick is finding the right parameters combination in the boot configuration. This is tedious, as it requires a reboot per test, and servers have slow reboot sequences. However, this grub.conf stanza fixed it for me:


title CentOS (2.6.18-194.11.3.el5xen)
kernel /xen.gz-3.2.1 noirqbalance hap dom0_mem=2G dom0_max_vcpus=8 xencons=tty console=vga
module /vmlinuz-2.6.18-194.11.3.el5xen ro root=LABEL=dom0_root console=vga xencons=tty
module /initrd-2.6.18-194.11.3.el5xen.img


I suppose that this should also work:


title CentOS (2.6.18-194.11.3.el5xen)
kernel /xen.gz-3.2.1 noirqbalance hap dom0_mem=2G dom0_max_vcpus=8 xencons=tty
module /vmlinuz-2.6.18-194.11.3.el5xen ro root=LABEL=dom0_root console=vga
module /initrd-2.6.18-194.11.3.el5xen.img


But I really have no inclination to try it now.

Thursday, August 12, 2010

I'm Your Man

If you want a lover
I'll do anything you ask me to
And if you want another kind of love
I'll wear a mask for you
If you want a partner, take my hand, or
If you want to strike me down in anger
Here I stand
I'm your man

If you want a boxer
I will step into the ring for you
And if you want a doctor
I'll examine every inch of you
If you want a driver, climb inside
Or if you want to take me for a ride
You know you can
I'm your man

Ah, the moon's too bright
The chain's too tight
The beast won't go to sleep
I've been running through
These promises to you
That I made and I could not keep

Ah, but a man never got a woman back
Not by begging on his knees
Or I'd crawl to you baby
And I'd fall at your feet
And I'd howl at your beauty
Like a dog in heat
And I'd claw at your heart
And I'd tear at your sheet
I'd say please, please
I'm your man

And if you've got to sleep a moment on the road
I will steer for you
And if you want to work the street alone
I'll disappear for you
If you want a father for your child
Or only want to walk with me a while
Across the sand
I'm your man

If you want a lover
I'll do anything that you ask me to
And if you want another kind of love
I'll wear a mask for you

By Leonard Cohen