Arquivar

Posts Etiquetados ‘arch’

Autenticação Facial no Linux

Bom, para quem não tem idéia do que é Reconhecimento facial, é recomendável usar a Wikipedia… afinal, o objetivo aqui é instalar e configurar, APENAS.

Autenticação facial é interessante, pois aumenta ainda mais a sua preguiça, afinal, você nem sua senha não precisa digitar mais :)

Mas vamos ao que interessa.

Você vai precisar do pam-face-authentication, que pode ser obtido neste link: http://pam-face-authentication.googlecode.com/files/pam-face-authentication-0.3.tar.gz

Mas primeeiro (/O Máscara), as dependências são: libx11, opencv, pam e qt4.5.

Se você tem alguem ambiente gráfico qualquer instalado, creio eu você não precisa se preocupar com a libx11.

Quanto ao PAM, você pode baixá-lo aqui: http://www.kernel.org/pub/linux/libs/pam/library/ , ou usar os pacotes da sua distro.

Instale-o antes do pam-face-authentication, logicamente.

Depois instale o QT4.5, o qual você com certeza irá encontrar pacotes pré-compilados para sua distro preferida.

Logo em seguida, instale o openCV, podendo efetuar o download aqui: http://sourceforge.net/projects/opencvlibrary/ , ou instalando os pacotes da sua distro.

Agora sim, vamos ao pam-face-authentication.

Você pode instá-lo usando o método trivial ./configure, make, make install, ou, como os anteriores, usando pacotes pré-compilados.

(PS.: Arch users, usem o AUR ;) )

Agora vamos à configuração.

Primeiro, vamos te apresentar ao pam-face-authentication..

Execute o qt-facetrainer

Clique em next, capture (faça várias caras, vá em vários tipos de luz diferentes, etc..), next novamente, finish (me senti winuser novamente .-. ).

Faça isso com seu usuário, e com o root.

Agora, como root, vá até /etc/pam.d/


Está vendo todos esses arquivos?

Então, é simples, edite quais você quer autenticação facial, adicionando a linha

“auth sufficient pam_face_authenticate.so”

logo após o “%PAM-1.0”

Um exemplo prático. O su:

#%PAM-1.0

auth sufficient pam_face_authentication.so enableX #Essa linha fui eu que adicionei ;)

auth sufficient pam_rootok.so

# Uncomment the following line to implicitly trust users in the “wheel” group.

#auth sufficient pam_wheel.so trust use_uid

# Uncomment the following line to require a user to be in the “wheel” group.

#auth required pam_wheel.so use_uid

auth required pam_unix.so

account required pam_unix.so

session required pam_unix.so

Faça isso com todas as autenticações que achar interessante/necessário…

feito isso, tente rodar “su” em um terminal :D

Legal né?

Vídeo da funcionalidade:


Dicas:

  • Sempre que ele não te reconhecer, aguarde um tempo, após algumas tentativas, será requisitada sua senha. Então, abra o qt-facetrainer, e capture sua face novamente. A luminosidade faz toda a diferença.

  • No GDM 2.28, não funciona, nem perca seu tempo.

  • Se você usa KDM, existe o kdm-plugin-pam-face-authentication, que eu não testei, mas creio que seja bem funcional.

O mais legal, é que se você deixar compilando algo com o yaourt por exemplo, na hora de instalar, só dá uma piscada no led da webcam, você nem vê… preguiça MASTER! IEAHIUEAIAEUHIUEA

[]’s

Emesene 1.5.1

Recentemente anunciei aqui o emenene 1.5 awesome, pois bem, agora estou anunciando o 1.5.1 awesome bugfix edition.

As novidades (copiado de: http://forum.emesene.org/index.php/topic,2418.0.html )

Bugs fixed/ New features:

* Smoother and bugfree login (and reconnect)
* Removed deprecated statuses (brb, lunch, phone) since WLM doesn’t use them anymore
* Last timestamp in status bar (optional)
* Even more layout options and a new theme (gnome-colors)
* Fixed focus problems in conversations
* Fixed problems with notifications
* Fixed sending message errors when talking to WLM users
* Fixed problems managing contacts (thanks pablo, and for those wandering: unfortunately we don’t support Federated Contacts)
* Fixed broken plugins, (re)added a bit more (Facebook, Encrypt, mail checkers, dbus, old notifications: thank their authors!)
* Various fixes here and there
* Tons of new languages supported

The fun doesn’t stop here, you can check the Community for further informations or cooperate with the emesene team in any way you can:

* New features
* Translations
* Plugins
* Bug reports/fixes
* Themes
* Support to other users
* Spreading the word

Você pode fazer o Download clicando aqui ou, para arch (click) e slackware (click), usar os packages que eu empacotei.

Caso alguém queira as versões pra windows, pode pegar as empacotadas pelo braytac:

Installer:
http://www.4shared.com/file/142440182/994fce45/emesene-install.html

Portable:
http://www.4shared.com/file/142443503/332d73e9/emesene-portable.html

Installer (more themes):
http://www.4shared.com/file/142430935/58ec0f85/emesene-install.html

Portable (more themes):
http://www.4shared.com/file/142452329/609fca12/emesene-portable.html

ou acompanhar o link no próprio fórum do emesene.

[]’s

Personalizando o GDM 2.28

Essa é uma dica rápida, para quem instalou o novo Ubuntu (9.10), atualizou o gnome do Arch Linux.. enfim, para qualquer um que esteja usando o novo Gerenciador de Login do Gnome, e notou que não tem a tela de escolha de tema, como havia nas versões anteriores..

Pois bem, o jeito é mudar o tema GTK do GDM, faça assim:

gksudo -u gdm dbus-launch gnome-appearance-properties

Escolha tema, fontes, ícones, etc..

Efetue logoff e confira sua nova aparência :D

[]’s

Arch Linux: GStreamer x Amarok

Quem fez update geral do sistema nos dias 26 e 27 de Agosto de 2009, e notou que o GStreamer sofreu update, e o amarok parou de funcionar…

Mas a solução é simples, muito simples.

# pacman -Sy phonon-xine

Vá nas configurações do sistema > Multimidia > Infraestrutura e escolha o xine como preferido…

Faça logoff, e tudo deve estar funcionando novamente.

Piece of cake.

Acelerando o Boot do Arch Linux com o finit-arc

Não é novidade minha mania de tentar deixar o boot sempre mais rápido.. quem acompanha o blog(alguém faz isso mesmo??) sabe que eu vivo fazendo isso, e já testei diversas distribuições…
mas enfim, chegou a vez do arch linux, que está me acompanhando a aproximadamente 3 meses :D

Faça por sua conta em risco.

Vamos lá:
1º – Baixe e instale esse pacote do aur:

http://aur.archlinux.org/packages.php?ID=25159

2º – Faça um backup do seu rc.sysinit

#mv /etc/rc.sysinit /etc/rc.sysinit.bkp

3º – Crie o novo rc.sysinit com o seguinte conteúdo (edite de acordo com os comentários):

#!/bin/bash
#
# /etc/rc.sysinit
#
. /etc/rc.conf
. /etc/rc.d/functions
echo ” “
printhl “Arch Linux – Speedup boot”
printsep
#**************************** WARNING ******************************
# If you’re using initramfs for your kernel, uncomment steps 5 and 17
# To improve boot speed it’s recommendend to make a static kernel
# without modules and without initramfs.
#
# MAKE STEP 2
# Type in a term from root: ls -l /dev | grep sda
# you’ll receive the list of /dev/sda devices
# make your /dev/sda devices in step 2 like the example
#*******************************************************************
# STEP 1 – mount /proc, /sys and our RAM /dev
/bin/mount -n -t ramfs none /dev
/bin/mount -n -t proc none /proc
/bin/mount -n -t sysfs none /sys
# STEP 2 – make static sda nodes for start udevadm –settle in background
/bin/mknod /dev/sda b 8 0
/bin/mknod /dev/sda1 b 8 1
/bin/mknod /dev/sda2 b 8 2
/bin/mknod /dev/sda3 b 8 3
/bin/mknod /dev/sda4 b 8 4
#…5…6..etc..(from your fdisk -l)
# STEP 3 – copy static device nodes to /dev
/bin/cp -a /lib/udev/devices/* /dev/
# STEP 4 – enable rtc access
/sbin/modprobe rtc-cmos >/dev/null 2>&1
if [ -n "$RTC_MAJOR" ]; then
/bin/mkdir /dev/misc/
/bin/mknod /dev/misc/rtc0 c $RTC_MAJOR 0
/bin/ln -s /dev/misc/rtc0 /dev/rtc
fi
# STEP 5 – Load modules from the MODULES array defined in rc.conf
#if ! [ "$load_modules" = "off" ]; then
# if [ -f /proc/modules ]; then
# stat_busy “Loading Modules”
# for mod in “${MODULES[@]}”; do
# if [ "$mod" = "${mod#!}" ]; then
# /sbin/modprobe $mod
# fi
# done
# stat_done
# fi
# if [ -d /proc/acpi ]; then
# stat_busy “Loading standard ACPI modules”
# ACPI_MODULES=”ac battery button fan processor thermal”
# k=”$(echo $BLACKLIST ${MOD_BLACKLIST[@]} | /bin/sed ’s|-|_|g’)”
# j=”$(echo ${MODULES[@]} | /bin/sed ’s|-|_|g’)”
# #add disabled MODULES (!) to blacklist – much requested feature
# for m in ${j}; do
# [ "$m" != "${m#!}" ] && k=”${k} ${m#!}”
# done
# # add disablemodules= from commandline to blacklist
# k=”${k} $(echo ${disablemodules} | /bin/sed ’s|-|_|g’ | /bin/sed ’s|,| |g’)”
# for n in ${ACPI_MODULES}; do
# if ! echo ${k} | /bin/grep “\” 2>&1 >/dev/null; then
# /sbin/modprobe $n > /dev/null 2>&1
# fi
# done
# stat_done
# fi
#fi
# STEP 6 – set hardware clock for fs check
{
HWCLOCK_PARAMS=”–hctosys”
if [ "$HARDWARECLOCK" = "UTC" ]; then
HWCLOCK_PARAMS=”$HWCLOCK_PARAMS –utc”
else
HWCLOCK_PARAMS=”$HWCLOCK_PARAMS –localtime”
fi
if [ "$USEDIRECTISA" = "yes" -o "$USEDIRECTISA" = "YES" ]; then
HWCLOCK_PARAMS=”$HWCLOCK_PARAMS –directisa”
fi
if [ -f /etc/localtime ]; then
/sbin/hwclock $HWCLOCK_PARAMS –noadjfile
fi
} &
echo > /proc/sys/kernel/hotplug
# STEP 7 – start udevadm trigger and udevd in background
{
if [ -x /sbin/udevadm -a -d /sys/block ]; then
stat_busy “Starting UDev Daemon”
/sbin/udevd –daemon &
/sbin/udevadm trigger &
stat_done
else
status “Using static /dev filesystem” true
fi
} &
# STEP 8 – start udevadm settle in background
/sbin/udevadm settle &
# STEP 9 – make lo interface
{
if [ -d /sys/class/net/lo ]; then
stat_busy “Bringing up loopback interface”
/sbin/ifconfig lo 127.0.0.1 up
if [ $? -ne 0 ]; then
stat_fail
else
stat_done
fi
fi
} &
# STEP 10 – mounting root read-only
status “Mounting Root Read-only” /bin/mount -n -o remount,ro / &
# STEP 11 – filesystem check
FORCEFSCK=
[ -f /forcefsck ] && FORCEFSCK=”– -f”
NETFS=”nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk”
fsck_reboot() {
echo “Automatic reboot in progress…”
/bin/umount -a
/bin/mount -n -o remount,ro /
/sbin/reboot -f
exit 0
}
if [ -x /sbin/fsck ]; then
stat_busy “Checking Filesystems”
FSCK_OUT=/dev/stdout
FSCK_ERR=/dev/null
/sbin/fsck -A -T -C -a -t $NETFS $FORCEFSCK >$FSCK_OUT 2>$FSCK_ERR
fsckret=$?
if [ ${fsckret} -gt 1 ]; then
stat_fail
fi
if [ $((${fsckret}&2)) -eq 2 ]; then
echo
echo “********************** REBOOT REQUIRED *********************”
echo “* *”
echo “* The system will be rebooted automatically in 15 seconds. *”
echo “* *”
echo “************************************************************”
echo
/bin/sleep 15
fsck_reboot
fi
if [ ${fsckret} -gt 1 -a ${fsckret} -ne 32 ]; then
echo
echo “***************** FILESYSTEM CHECK FAILED ****************”
echo “* *”
echo “* Please repair manually and reboot. Note that the root *”
echo “* file system is currently mounted read-only. To remount *”
echo “* it read-write type: mount -n -o remount,rw / *”
echo “* When you exit the maintenance shell the system will *”
echo “* reboot automatically. *”
echo “* *”
echo “************************************************************”
echo
/sbin/sulogin -p
fsck_reboot
fi
stat_done
fi
# STEP 12 – remount root and mount local file system
stat_busy “Mounting Local Filesystems”
/bin/mount -n -o remount,rw /
/bin/rm -f /etc/mtab*
/bin/mount -o remount,rw /
if [ -e /proc/mounts ]; then
/bin/grep -e “/proc ” -e “/sys ” -e “/dev ” /proc/mounts >> /etc/mtab
fi
/bin/mount -a -t $NETFS
stat_done
# STEP 13 – activating swap partition
status “Activating Swap” /sbin/swapon -a &
# STEP 14 – set urandom
{
RANDOM_SEED=/var/lib/misc/random-seed
if [ -f $RANDOM_SEED ]; then
stat_busy “Initializing Random Seed”
/bin/cat $RANDOM_SEED > /dev/urandom
stat_done
fi
} &
# STEP 15 – removing temp files
stat_busy “Removing Leftover Files”
/bin/rm -f /etc/nologin &>/dev/null
/bin/rm -f /etc/shutdownpid &>/dev/null
/bin/rm -f /var/lock/* &>/dev/null
/bin/rm -rf /tmp/* /tmp/.* &>/dev/null
/bin/rm -f /forcefsck &>/dev/null
(cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f — {} \; )
: > /var/run/utmp
/bin/chmod 0664 /var/run/utmp
/bin/mkdir /tmp/.ICE-unix && /bin/chmod 1777 /tmp/.ICE-unix
/bin/mkdir /tmp/.X11-unix && /bin/chmod 1777 /tmp/.X11-unix
stat_done
# STEP 16 – set rc.conf hostname
if [ "$HOSTNAME" != "" ]; then
status “Setting Hostname: $HOSTNAME” /bin/hostname $HOSTNAME &
fi
# STEP 17 – load modules depends
#status “Updating Module Dependencies” /sbin/depmod -A &
# STEP 18 – set lang
{
: >/etc/profile.d/locale.sh
/bin/chmod 755 /etc/profile.d/locale.sh
[ -z "$LOCALE" ] && LOCALE=”it_IT@euro”
stat_busy “Setting Locale: $LOCALE”
echo “export LANG=$LOCALE” >>/etc/profile.d/locale.sh
stat_done
} &
# STEP 19 – Save our dmesg output from this boot
if [ -f /var/log/dmesg.log ]; then
/bin/rm /var/log/dmesg.log &
fi
/bin/dmesg > /var/log/dmesg.log &

4º – Altere o /boot/grub/menu.lst

#(0) Arch Linux
title Arch Linux SpeedBoot
kernel /boot/vmlinuz26 root=/dev/sda2 ro vga=791 splash resume=/dev/sda1 init=/sbin/finit-arc
initrd /boot/kernel26.img
Obs.: O finit-arc não suporta os UUID’s para as partições, faça à moda antiga, /dev/etc..

5º – Alere o /etc/fstab
Faça um backup por via das dúvidas, embora nem seja tão necessário assim.. mas enfim, é só tirar os UUID’s e por o caminho completo (/dev/etc), pelo motivo explicado anteriormente :)

6º – Configure o /etc/finittab

#Command that you want execute after boot
#uncomment it for X login
#you must set YOURUSERNAME
#level:/bin/su YOURUSERNAME -l -c “/bin/bash –login -c xinit >/dev/null 2>&1″
#level:/usr/sbin/gdm –nodaemon
#level:/usr/bin/xdm -nodaemon
#level:/usr/bin/kdm -nodaemon
#level:/usr/bin/slim

Esse tá muito simples, é só ler :P

7º – Crie o /usr/sbin/services.sh

#!/bin/sh
#Starts udev events
/sbin/udevd –daemon &>/dev/null &
/sbin/udevadm trigger &>/dev/null &
/sbin/udevadm settle &>/dev/null &
#Make swap (not for ssd)
/sbin/swapon -a &
#Starting background daemons
/etc/rc.d/syslog-ng start &>/dev/null &
/etc/rc.d/hal start &>/dev/null &
/etc/rc.d/laptop-mode start &>/dev/null &
/etc/rc.d/alsa start &>/dev/null &

Vá adicionando os seus daemons no mesmo estilo dos anteriores.. easy easy ;)
Feito isso, é só reiniciar :P
Aqui funcionou perfeitamente.. ainda não medi o tempo.. mas tenho certeza absoluta que tá bem pequeno.. eahiuheaiuheaiu
tópico no fórum:  http://forum.archlinux-br.org/viewtopic.php?pid=13065#p13065
abraço