MAL - Memória Auxiliar do Lutieri

Terça-feira, Julho 07, 2009

Monitoring keyboard and mouse events

For some unknown reason the key combination ctrl+alt+f1 through f6 are not working, as well as ctrl+alt+backspace.

I'm still working on that but for now I have found some interesting ways to capture keyboard and mouse events:

For keyboard and mouse you can use a small app called xev. After installed just call xev from a terminal, a new blank window will pop up where you can test you mouse and the pressed keys will show up on the terminal.

If you have a touchpad synclient -m 1 can be useful to you.

I'm going to come back here to finish this post as soon as I figure out what's wrong with those key combinations.

Marcadores:

Quarta-feira, Junho 24, 2009

ReRead Partition table

I'm playing around with fdisk and other tools and seems like fdisk tries to reread the partition table after a write command, but it can fail. Although, you can try:

blockdev --rereadpt /dev/hda


It might work if there is no other mounted partitions from that disk.

Marcadores:

Terça-feira, Junho 23, 2009

Frame buffer modes

I'm always wondering my options for the "vga" setting at the grub command line. Here is:



Color depth | 640x480 800x600 1024x768 1280x1024
-----------------+-------------------------------------
256 (8bit)| 769 771 773 775
32000 (15bit)| 784 787 790 793
65000 (16bit)| 785 788 791 794
16.7 Mill.(24bit)| 786 789 792 795


The vga= setting only effects the frame buffer, not X (unless you're using the fbdev driver in X). This'll mean that your console will display at this resolution.

Source: http://www.mepis.org/node/2992#comment-10710

Marcadores: ,

Segunda-feira, Abril 20, 2009

Baixando videos do ClicRBS

Jah tive que fazer isso no passado, hoje um amigo precisou fazer de novo. Toda vez perco 10 minutos pra descobrir como fazer. Resolvi colocar aqui pra nao esquecer mais.

Basicamente voce acessa a URL

http://mediacenter.clicrbs.com.br/templates/RequestUrlPlayer.aspx?contentId=YYYYY&channel=XXX


e troca o YYYYY e XXX pelos valores corretos que provalvelmente vao estar contidos no codigo fonte da pagina que tah mostrando o video.

A URL acima retorna um XML contento o endereco do .flv
Ai usa o vlc pra baixar e converter o baixa o arquivo e converte de algum jeito.

Abraco DDD

Marcadores:

Scrolling and Tapping stop working on xorg 1.5

I just updated from Xorg 1.3 to 1.5 and some functions on my touch pad are gone.

First of all, Xorg 1.5 depends on HAL to access the input devices but I decided to keep the old-fashion way(input devices sections on xorg.conf). So, first thing to do is disable HAL support on xorg.conf.


Section "ServerFlags"
option "AutoAddDevices" "false"
EndSection


Second of all, here is the configuration that I'm using to work both, scrolling and tapping clicks:


Section "InputDevice"
Identifier "Mouse0"
# Driver "mouse"
# Option "Protocol" "auto"
# Option "Device" "/dev/input/mice"
# Option "ZAxisMapping" "4 5 6 7"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizEdgeScroll" "1"
Option "SHMConfig" "on"
Option "Resolution" "1600"
Option "rightedge" "5000"

#Enable Tapping
Option "TapButton1" "1"
Option "TapButton2" "2"

#Enable Scroll
Option "VertEdgeScroll" "1"

EndSection


Marcadores: ,

Case-insensitive search on man pages

Open /etc/env.d/70less.

Change from:

LESS="-R -M --shift 5"


To:

LESS="-I -R -M --shift 5"


Also make sure that /etc/env.d/00basic is setting LESS as the pager.

PAGER="/usr/bin/less"


The above instructions works for Gentoo.
If your distro doesn't have /etc/env.d/ you can add those lines to /etc/profile.

Marcadores: ,

Quarta-feira, Março 18, 2009

LDAP not starting up

I was having problems starting slapd. So, at first I tried to run slapd manually with the a high debug level as follow:

#/usr/local/libexec/slapd -u ldap -g ldap -d 5000 -4 -f /usr/local/etc/openldap/slapd.conf
@(#) $OpenLDAP: slapd 2.4.15 (Mar 16 2009 12:17:43) $
root@adhara.csit.parkland.edu:/usr/ports/net/openldap24-server/work/openldap-2.4.15/servers/slapd
slapd stopped.
connections_destroy: nothing to destroy.
#

I got nothing, seems that everything was right. But I knew wasn't, otherwise it will run.

So, I decided to test the config file:

# /usr/local/libexec/slapd -Tt
/usr/local/etc/openldap/schema/phamm.schema: line 148 objectclass: ObjectClass not found: "inetOrgPerson"
slaptest: bad configuration file!
#

This time I was able to see what was wrong.
The phamm.schema requires inetOrgPerson schema. So I had to include inetOrgPerson schem as well.
BTW inetOrgPerson requires cosine schema, so...

Marcadores:

Segunda-feira, Março 16, 2009

service script on FreeBSD e Gentoo[updated]

Se tem uma coisa que eu simpatizo no CentOS, Red Hat e outros dessa ninhada eh um binario ou script chamada service. No FreeBSD pra reinicar, parar, iniciar, etc os servicos, o caminho pode ser longo como: /usr/loca/etc/rc.d/dovecot start

Jah no CentOS e amigos: service dovecot start

Isso se torna muito mais pratico, ainda mais quando se tah implementando algum servico que pode exigir reinicar varias vezes. Sendo assim resolvi montar minha versao do script. Simples, beeem simples mas funcional:

#!/bin/sh

LOCAL_SC='/usr/local/etc/rc.d/'
SYS_SC='/etc/rc.d/'


if [ $# -lt 2 ]
then
echo "USE:"
echo "$0 servicename start|restart|stop"
exit 3
fi

#Most of start/stop commands I issued are in LOCAL_SC
if [ -x $LOCAL_SC$1 ]
then
$LOCAL_SC$1 $2
exit 0
else
#Look in the system scripts
if [ -x $SYS_SC$1 ]
then
$SYS_SC$1 $2
exit 0
fi
fi

echo "$1 - not found"
exit 3


Criado em /usr/loca/sbin/service

[update]
Versao para Gentoo

#!/bin/sh

SYS_SC='/etc/init.d/'


if [ $# -lt 2 ]
then
echo "USE:"
echo "$0 servicename start|restart|stop"
exit 3
fi

#Most of start/stop commands I issued are in LOCAL_SC
#Look in the system scripts
if [ -x $SYS_SC$1 ]
then
$SYS_SC$1 $2
exit 0
fi

echo "$1 - not found"
exit 3

Marcadores: ,

STARTTLS vira XXXXXXXA no Postfix







InternetLAN
$ telnet adhara.csit.parkland.edu 25
Trying 216.125.253.20...
Connected to adhara.csit.parkland.edu.
Escape character is '^]'.
220 *********************
EHLO ASD
250-adhara.csit.parkland.edu
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-XXXXXXXA
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
$ telnet adhara.csit.parkland.edu 25
Trying 216.125.253.20...
Connected to adhara.csit.parkland.edu.
Escape character is '^]'.
220 adhara.csit.parkland.edu ESMTP Postfix
EHLO ASD
250-adhara.csit.parkland.edu
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Implementando TLS no Postfix me fez sofrer por algumas horas.

Basicamente quando conecto na mesma rede que o servidor de e-mail estah eu vejo o comando STARTTLS disponivel. Quando conecto a partir de QUALQUER host na internet(testei usando maquinas espalhadas pelo mundo) ao inves de STARTLS vejo XXXXXXXA. E caso o cliente na internet tente enviar o comando STARTTLS mesmo nao o vendo corretamente o comando chega como XXXXXXA no servidor. Que por sua vez vai reclamar dizendo que tal comando nao existe.

Capturei pacotes nas duas pontas da conexao e conclui que sim, pacote eh enviado corretamente pelo postfix e no meio do caminho alguem o modifica. Desabilitei o firewall neste servidor de e-mail, habilitei scrub com varias opcoes diferentes e nada resolveu.

O mais estranho eh que lah de vez em quando uma conexao a partir da internet vai receber STARTTLS corretamente.

Isso tudo significa que meus clientes NUNCA vao conseguir utilizar TLS com o meu servidor.

Pesquisando e pesquisando me parece que eh um bug com um cisco PIX no meio do caminho. Nao tenho acesso a outros equipamentos na rede onde o servidor estah alocado, logo nao tenho como consertar. Mas desconfio que seje o default gateway daquela rede um cisco PIX. Tentei detectar o OS do gateway mas nao consegui. Mas deve ser ele o culpado :/

Econtrei uma extensa discussao aqui:
http://www.archivum.info/postfix-users@postfix.org/2008-06/msg01168.html

Marcadores:

Sábado, Fevereiro 21, 2009

Projeto de final de semana

Windows 3.11









Windows 95









Chat with Lutieri G. B.

Subscribe in a reader