I don’t know exacly untile when but the imon lcd support has been merged  into the linux kernel using devinput.

This means that if you want to use the lirc_imon driver you need to blacklist the imon driver shipped with the kernel. You just need to add the following lines in the /etc/modprobe.d/blacklist.conf file:

blacklist rc_imon_pad

blacklist imon

After this you can proceed followingone of the lirc guides related to imon you find on the web.

But if you want to use the new devinput module, which in fact make thinks easier, you just leave the modules as they are and just edit the Hardware.conf file (/etc/lirc/hardware.conf):

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE=”Linux input layer (/dev/input/eventX)”
REMOTE_MODULES=”"
REMOTE_DRIVER=”devinput”
REMOTE_DEVICE=”/dev/input/by-id/usb-15c2_0038-event-if00″
REMOTE_SOCKET=”"
REMOTE_LIRCD_CONF=”devinput/lircd.conf.devinput”
REMOTE_LIRCD_ARGS=”"

#Enable lircd
START_LIRCD=”true”

And in the lirc configuration file /etc/lirc/lircd.conf you should put this line:

#Configuration for the Linux input layer (/dev/input/eventX) remote:
include “/usr/share/lirc/remotes/devinput/lircd.conf.devinput”

This work good on my ubutu 11.10, perhaps you need to adjust some paths if your distro is different.

PLS NOTE Done this way the knob on my antec fusion doesn’t work neigther the blue key on the remote. The kno generates events on a different device: /dev/input/by-id/usb-15c2_0038-event-mouse

So you have to chain two distinct lirc servers togethere:

/usr/sbin/lircd –pidfile=/var/run/lirc/lircd1.pid –output=/var/run/lirc/lircd1 –driver=devinput –device=/dev/input/by-id/usb-15c2_0038-event-mouse –listen/usr/sbin/lircd –output=/var/run/lirc/lircd –driver=devinput –device=/dev/input/by-id/usb-15c2_0038-event-if00 –connect=localhost 8765

This way you find events of both devices on the socket /var/run/lirc/lircd.

Due to a driver bug, which i will investigate, the knob gets temporarly disabled if you press some particular key. For example if you press the yellow tv button the kno will not work anymore, until you press a number button of the remote.

To make the two instances of lirc to startup at boot time i added an upstart script /etc/init/htpc-lirc.conf:

description    ”HTPC lirc daemon”

start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]

script
mkdir /var/run/lirc -p
/usr/sbin/lircd –pidfile=/var/run/lirc/lircd1.pid –output=/var/run/lirc/lircd1 –driver=devinput –device=/dev/input/by-id/usb-15c2_0038-event-mouse –listen
/usr/sbin/lircd –output=/var/run/lirc/lircd –driver=devinput –device=/dev/input/by-id/usb-15c2_0038-event-if00 –connect=localhost:8765
end script

Finally link it init.d

ln -s /lib/init/upstart-job /etc/init.d/htpc-lirc

 

 

 

Il Tribunale del Riesame di Napoli ha annullato l’ordinanza di carcerazione per Gaetano Riina, fratello di Totò, perché il GIP ha copiato il testo dal PM introducendo diversi errori semantici.
Fosse capitato a un comune mortale, avrebbe quantomeno perso l’incarico o il ruolo che ricopre.

Ecco alcune fonti:

Have this issue in php? In /etc/php.ini comment out:
; mbstring.func_overload = 7

I recently upgraded my laptop with a brand new SSD, my first two impressions are: much much faster, much much instable.
Yes that’s right, instable. My first try with SSD is was with a HANA SSD 8G (model: HLSM008G), does’t work on linux. I bought this drive on ebay just to make some tries with an economic disk, and eventually install it for use with mythtv as boot disk. Never do this, never buy HANA if you plan to use it on linux. It simply doesn’t even install you get a kernel panic. As I see now the product has been removed from ebay.

My second try is a OCZ Agility II, installed on my htpc with mythtv. On the same pc i had two 500GB HDD and an optical drive. One of the two HDD’s randomly freezes at boot time with the OCZ installed. That means 2 boot every 3 this HDD could not be mounted. I had to remove it. The second issue with the same OCD Agility where some occasionally errors syncing the journal with consequent remount in ro exactly while watching the clue scene of a film. Googling around i found somebody saying that the journal does not have sense in a SSD. In fact if the system crashes the check time on an SSD is ridiculous, so the benefits are irrelevant. So i removed the journal and the issue seem to be gone.

Meanwhile I bought a second OCZ Vertex II for my laptop, work grate, but for performance reasons I decided to remove the journal from ext4. To do so I needed to mount the disk in ro mode.
Easy:

sodo mount -o remount,ro /dev/sda1

No way!! Even booting the system in maintanace mode mount cannot remount in ro if disk is busy.

So it is some more complicate, this is what I had to do:

  • nano /etc/fstab
  • UUID=… / ext4 ro,errors=remount-ro 0 1
  • reboot
  • After reboot:

  • tune2fs -O ^has_journal /dev/sda1
  • mount -o remount,rw /dev/sda1
  • nano /etc/fstab
  • remove ro option

Linux is always a step behind.

Ok, just to tell the truth this is not a real bug parade, but today I’m struggling with many different bugs. The worst thing is that each time you spend a lot of time trying to figure out what is wrong in your code. So when there is a bug in something like mysql the first step is a review of your own code. After loosing time in trying to find the bug you reach the point where the assertion “my code is correct” is true.

What next? Google and spend some hours googling. Finally in a remote ranked page at position 232 of the google result you find a response of an anonymous developer who answers in the year 2009 to  question posted in year 2005. The solution proposed seems very silly. Absurd. But you are desperate. So you try the solution and…IT WORKS!!!

 

  • Alter table errno:150 [solved]

alter table failure add index FKBF3C318AB88FBECE (idsent),add constraint FKBF3C318AB88FBECE foreign key (idsent) references sent_mail (idsent);

raises an error:  Can’t create table ‘mercurius.#sql-61c_4a’ (errno: 150)
solution:
set foreign_key_checks = 0 ;
alter table failure add index FKBF3C318AB88FBECE (idsent),add constraint FKBF3C318AB88FBECE foreign key (idsent) references sent_mail (idsent);
set foreign_key_checks = 1;
Works!
  • Alter table errno:150 [unsolved]
Same issue as above: alter table QRTZ_JOB_LISTENERS add index FK2E3C7E25EC364202 (JOB_GROUP, JOB_NAME),
add constraint FK2E3C7E25EC364202 foreign key (JOB_GROUP, JOB_NAME) references QRTZ_JOB_DETAILS (JOB_GROUP, JOB_NAME);
raises an error:  Can’t create table ‘mercurius.#sql-61c_4a’ (errno: 150)
same solution as above doesn’t work!
  • Insert and incorrect mysqld_stmt_execute
A standard prepared statement
insert into … values(?,?,?)… raises an exception.
java.lang.RuntimeException: Unable to continue: Error while commiting the transaction
which is caused by a
Caused by: java.sql.BatchUpdateException: Incorrect arguments to mysqld_stmt_execute
adding the parameter useServerPrepStmts=false to the connection works:
jdbc:mysql://localhost:3306/mercurius?useServerPrepStmts=false

Pensavo di usare il titolo “L’importanza di dare importanza a chi non ha importanza” ma poi mi è sembrato un po troppo ripetitivo, carino, ma ripetitivo.

All’università in diverse occasioni mi hanno insegnato che spesso le persone meno influenti sono quelle che posso creare le maggiori difficoltà. Nel corso di sicurezza informatica tra i diversi approcci per violare un sistema era suggerito quello di corrompere il personale interno, il libro di testo suggeriva di corrompere il personale delle pulizie, spesso sottopagato, con libero accesso anche a locali riservati e ai pc lasciati abbandonati di notte.

Il corso di marketing invece individuava i centralinisti e portieri come persona che possono bloccare il contatto con le persone desiderate o se debitamente stimolate agevolare l’incontro con l’obiettivo della strategia commerciale.

A leggere quei passaggi sembrava di vivere in un modo di mata hari, la sensazione che fossero ispirati a James Bond piuttosto che alla realtà non me l’ha mai tolta nessuno.

Devo però ammettere che l’esperienza mi sta dando torto. In diverse occasioni mi è capitato che interi gruppi di lavoro venissero bloccati da persone che non hanno ruolo decisionale e rivestono ruoli chiave.

L’ultimo episodio in ordine cronologico è di un sistemista che lavora nell’area IT di un importante banca. Avrebbe gradito essere coinvolto nel progetto fin dalle fasi iniziali. Con questa frase ha aperto la riunione in cui non avremmo dovuto fornirgli le indicazioni su come metter online l’applicazione.  Errore enorme. No dare a lui le indicazioni senza neppure averlo consultato prima? In tutti i posti dove sono stato il sistemista prende il lavoro e lo pubblica sui server. Lui no, i sui server sono più delicati di quelli di altri e sono più carchi di quelli da altri. Ha chiesto la documentazione tecnica, schermi di progetto, librerie utilizzate, spiegazioni sulle scelte operate. Una settimana di blocco attività per evadere le sue richieste e un’ulteriore settimana di rallentamenti vari. Non dargli importanza ci è costato 2 settimane di ritardo. E nella riunione finale non ha potuto trattenere un sorriso di soddisfazione “Se mi aveste contattato dall’inizio non avremmo avreste avuto tutti questi problemi”. Mava…

Quinti mai sottovalutare le persone coinvolte anche marginalmente, chiunque può sempre mettersi di traverso

Ho sempre pensato che scrivere su un blog sia una grossa perdita di tempo e ho sempre ritenuto che chi scrive su un blog lo fa perché non sa come passare il tempo.

In realtà comunicare bene è importante tanto quanto saper fare le cose bene. Si possono realizzare i migliori prodotti del mondo, ma se nessuno sa che esistono e cosa possono fare nessuno mai li comprerà.

I recently installed a webapp which uses tomcat and jasper on one of my server. Everything worked well until a template used some special chars, I got the ‘?’ chars which indicate the typical encoding issue.

Everything seemed correct, DB in UTF-8, virtual machine started with -Dfile.encoding=UTF-8, application in UTF-8, data files in UTF-8.

After an hour spend in all these checks I tried an “export LANG=it_IT.utf8” in my linux environment. Everything worked well.

Where is the point? Very simple, some jar don’t look in the JVM system properties but look for the native locale in the linux enviroment. This causes portability issues and lost of time in solving stupid problems.

Since the last six months I have an issue with my NetworkManager, sometimes it doesn’t wakup correctly after a standby or suspend.  After some test I found that the problem comes out each time the suspend/standby procedure freezes the system and I have to manually shutdown. To make the NetworkManager the only way is to standby and wakup my laptop.

After several tests I found out what happens and a small workarround.

On my laptop I have an hardware issue with my webcam, the cable which connects the camera to the motherboard throught the monitor is a little bit loose, so sometimes the camera generates an error. This error causes a seg fault in the linux kernel. This seg fault prevents the webcam module to stanby corretly and my laptop freezes during standby cycle. This happens after the NetworkManger has entered the standby cycle in which the network gets disabled.

Now I have to manually power off the laptop, and turning the laptop on again doesn’t run the wakeup cycle,  in the wakup cycle the NetworkManager enables the network again. So my network remains disabled until I run the wakeup cycle.

The first workarround is to standby/wakup the laptop, the second workarround is to run the wakeup command manually:

sudo dbus-send –print-reply –system –dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.wake

I thing this issue comes out each time a suspend/standby isn’t followed by a wakeup (ex: battery runs out) .

Hope this helps others :)

Configurazione generale della rete

Ipotizziamo una rete interna che utilizza gli IP 192.168.6.X. Nella rete interna abbiamo un router al indirizzo 192.168.6.1 e un server DNS per la intranet all’indirizzo 192.168.6.2.

Il server che vogliamo utilizzare per la VPN utilizza l’IP interno 192.168.6.102 ed è visibile dall’esterno su un ip pubblico a cui è assegnata una voce sul DNS pubblico es: vpnserver.mylan.com

Una considerazione prima di procedere. A chi si collega alla rete tramite VPN viene assegnato un IP, occorre quindi prestare attenzione con non vi siano problemi di instradamento o conflitto di IP. Per la VPN scegliamo quindi di usare un set di IP completamente diverso rispetto a quelli della intranet, es 10.8.0.X.

Sul router occore quindi aggiungere una route sul router:

route add 10.8.0.0 192.168.7.102

Configurazioni sul server VPN (vpnserver.mylan.com 192.168.7.102)

modprobe tun
echo "tun" >> /etc/modules
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A INPUT -p udp –dport 1194 -s 10.0.0.0/24 -m state –state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -s 10.0.0.0/24 -j ACCEPT
iptables -A FORWARD -s 10.0.0.0/24 -j ACCEPT
Sul router

Certificati e chiavi

Occore generare una serie di certificati e chiavi. A meno che non abbiate un contratto con un Certification Authority occorre generare una chiave e un certificato ‘self-signed’ anche per la Certification autority.

Certificati CA

mkdir ca
openssl genrsa -out ca/ca.key
openssl req -new -key ca/ca.key -out ca/ca.req
openssl x509 -req -in ca/ca.req -signkey ca/ca.key -out ca/ca.cert
Cerficati Server
mkdir server
openssl genrsa -out server/server.key
openssl req -new -key server/server.key -out server/server.req
openssl x509 -req -in server/server.req -CA ca/ca.cert -CAkey ca/ca.key -CAcreateserial -out server/server.cert
openssl dhparam -out server/dh1024.pem 1024

Certificati client

mkdir client
openssl genrsa -out client/client.key
openssl req -new -key client/client.key -out client/client.req
openssl x509 -req -in client/client.req -CA ca/ca.cert -CAkey ca/ca.key -CAcreateserial -out client/client.cert

Generazione chiavi TSL

openssl genrsa -out server.key
openssl req -new -key server.key -out rich.ser
openssl x509 -req -in rich.ca -signkey server.key –out server.cert
openssl x509 -req -in rich.ser -CA ca.cert -CAkey ca.key -CAcreateserial -out ser.cert
openssl dhparam -out dh.pem 1024
Per ogni client:
openssl genrsa -out client.key
openssl req -new -key client.key -out rich.cli

Server.conf

port 1194
proto udp
dev tun
ca ./ca/ca.cert
cert ./server/server.cert
key ./server/server.key
dh ./server/dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.7.0 255.255.255.0"
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 4
tls-server

Client.conf

client
dev tun
proto udp
remote 89.96.215.134
resolv-retry infinite
nobind
persist-key
persist-tun
ca ./ca/ca.cert
cert ./client/client-luigi.cert
key ./clinet/client-luigi.key
comp-lzo
verb 4
port 1194

Pagina successiva »