viernes 9 de enero de 2009

tips en el uso de acpi en slackware

Veamos para no enfatizar mucho en la historia ni en conocimientos previos les dejare unas referencias y luego puedan continuar con lo que se hará a continuación

ACPI

Después de haber comprendido lo que es y para que funciona, entonces se va a lo principal y configuracion del mismo para una arquitectura x86 con amd y soporte a cpufreq respectivamente este se utilizaria para las laptop, entonces para ello se necesita saber la ruta donde se encuentran los archivos de configuracion, en algunas distribuciones ya vienen previamente configuradas pero como en slackware no viene asi entonces habra que configurar para hacer una buena utilizacion de acuerdo a varios eventos, por ejemplo:

  • Incrementar/decrementar el brillo de la pantalla.
  • Si se esta conectado ala corriente electrica.
  • Etc.
Ahora los archivos de configuración que en si son script's, se encuentran en la siguiente ruta
/etc/acpi , bien ahora listando los archivos:

# ls /etc/acpi
acpi_handler.sh events
el archivo a configurar es acpi_handler.sh para los diferentes eventos y este es el archivo de configuración que tengo yo:


#!/bin/sh
# Default acpi script that takes an entry for all actions
IFS=${IFS}/
set $@
case "$1" in
button)
case "$2" in
power) /sbin/init 0
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
ac_adapter)
case "$2" in
ADP1) /etc/acpi/events/ac_adapter.sh
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
battery)
case "$2" in
BAT0)
case "$4" in
00000000) #echo "offline" >/dev/tty5
;;
00000001) #echo "online" >/dev/tty5
;;
esac
;;
CPU0)
;;
*) logger "ACPI action $2 is not defined" ;;
esac
;;
video)
case "$2" in
LCD)
;;
*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac

Existe un evento en donde se desconecta de la corriente y deja funcionando a la bateria entonces ese evento en este script manda llamar a este archivo /etc/acpi/events/ac_adapter.sh que tambien se le debe de agregar unas pequeñas reglas de script en bash las cuales yo agrege son:


#!/bin/sh
#script to handle AC plug and unplug events
# find out if adapter is plugged in or not
if [ "`sed -e "s/.[^ ]* *//" /proc/acpi/ac_adapter/ADP1/state`" = "on-line" ]
then
logger "ACPI: AC adapter is on-line, setting hdparm values"
hdparm -B 240 /dev/sda
hdparm -S 241 /dev/sda
echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
else
logger "ACPI: AC adapter is off-line, setting hdparm values"
hdparm -B 180 /dev/sda
hdparm -S 60 /dev/sda
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq scaling_governor
fi
Que funciona para cuando se desconecte de la corriente pondra en modo bajo demanda para reducir la carga del procesador y hace sea mas duradera la pila y con hdparm pone al disco duro a menos carga de trabajo y asi mismo tener la misma finalidad, y cuando se conecte a la corriente electrica se pondra en modo performance que pondra el procesador a todo su potencial y asi mismo la carga de trabajo del disco duro.

Una pequeña aclaración este ultimo script fue sacado de alguna web pero realmente no me acuerdo de donde :s

martes 14 de octubre de 2008

Como hacer mas rapido el boot 'eo ala hora de Iniciar nuestro Slackware

Bueno como lo acabo de hacer, y tal vez muchos usuarios de slackware ya lo han hecho pero no lo han publicado, se puede comentar mucho pero sere breve como siempre.

la solucion de hacer posible esto de una manera sencilla es editando el archivo /etc/rc.d/rc.M mandando algunos script o conocidos como demonios iniciarlos background y como es posible hacer esto? bueno en bash hay un caracter que se utiliza de esta manera:

sh script.sh &

y directamente lo mandara a ejecucion background y te mostrara el prompt para seguir realizando tareas, se puede realizar en cualquier terminal..

bueno entonces estos son los archivos y los pegare ya editados por si quieren utilizarlos....


#!/bin/sh
#
# rc.M This file is executed by init(8) when the system is being
# initialized for one of the "multi user" run levels (i.e.
# levels 1 through 6). It usually does mounting of file
# systems et al.
#
# Version: @(#)/etc/rc.d/rc.M 2.23 Wed Feb 26 19:20:58 PST 2003
#
# Author: Fred N. van Kempen,
# Heavily modified by Patrick Volkerding
#

# Tell the viewers what's going to happen.
echo "Going multiuser..."

# Update all the shared library links:
if [ -x /sbin/ldconfig ]; then
echo "Updating shared library links: /sbin/ldconfig &"
/sbin/ldconfig &
fi

# Screen blanks after 15 minutes idle time, and powers down in one hour
# if the kernel supports APM or ACPI power management:
/bin/setterm -blank 15 -powersave powerdown -powerdown 60

# Set the hostname.
if [ -r /etc/HOSTNAME ]; then
/bin/hostname $(cat /etc/HOSTNAME | cut -f1 -d .)
else
# fall back on this old default:
echo "darkstar.example.net" > /etc/HOSTNAME
/bin/hostname darkstar
fi

# Save the contents of 'dmesg':
/bin/dmesg -s 65536 > /var/log/dmesg

# Initialize PCMCIA devices:
#
# NOTE: This used to be started near the top of rc.S so that PCMCIA devices
# could be fsck'ed along with the other drives. This had some unfortunate
# side effects, however, since root isn't yet read-write, and /var might not
# even be mounted the .pid files can't be correctly written in /var/run and
# the pcmcia system can't be correctly shut down. If you want some PCMCIA
# partition to be mounted at boot (or when the card is inserted) then add
# the appropriate lines to /etc/pcmcia/scsi.opts.
#
# Note that the stuff in /etc/pcmcia/ is only for 2.4.x kernels using
# 16-bit PCMCIA cards (not 32-bit Cardbus cards!). For example, with a
# wireless card you might need to set options in /etc/pcmcia OR in
# /etc/rc.d/rc.wireless.conf, or even in /etc/rc.d/rc.inet1.conf (with
# extra options if needed for the encryption key, ESSID, etc.)
#
# Hopefully this situation will be unified in the future, but for now
# that's how it is...
#
if [ -x /etc/rc.d/rc.pcmcia ]; then
. /etc/rc.d/rc.pcmcia start &
# The cards might need a little extra time here to initialize.
#sleep 5
fi

# Start the system logger.
if [ -x /etc/rc.d/rc.syslog -a -x /usr/sbin/syslogd -a -d /var/log ]; then
. /etc/rc.d/rc.syslog start &
fi

# Update the X font indexes:
if [ -x /usr/bin/fc-cache ]; then
echo "Updating X font indexes: /usr/bin/fc-cache -f &"
/usr/bin/fc-cache -f &
fi

# If we are returning from single-user mode we will need to restart
# udevd on systems that use udev:
if grep -wq sysfs /proc/mounts && grep -wq tmpfs /proc/filesystems ; then
if ! grep -wq nohotplug /proc/cmdline ; then
if [ -x /etc/rc.d/rc.udev ]; then
/bin/sh /etc/rc.d/rc.udev start &
fi
fi
fi

# Initialize the networking hardware.
if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1 &
fi

# Look for additional USB/SCSI/IEEE1394/etc devices on multiple LUNs:
if [ -x /etc/rc.d/rc.scanluns ]; then
. /etc/rc.d/rc.scanluns &
fi

# Start networking daemons:
if [ -x /etc/rc.d/rc.inet2 ]; then
. /etc/rc.d/rc.inet2 &
fi

# Mount any additional filesystem types that haven't already been mounted:
mount -a -v 2> /dev/null | grep -v "already mounted"

# Start the Network Time Protocol daemon:
if [ -x /etc/rc.d/rc.ntpd ]; then
sh /etc/rc.d/rc.ntpd start &
fi

# Remove stale locks and junk files (must be done after mount -a!)
/bin/rm -f /var/lock/* /var/spool/uucp/LCK..* /tmp/.X*lock /tmp/core /core 2> /dev/null

# Remove stale hunt sockets so the game can start.
if [ -r /tmp/hunt -o -r /tmp/hunt.stats ]; then
echo "Removing your stale hunt sockets from /tmp."
/bin/rm -f /tmp/hunt*
fi

# Ensure basic filesystem permissions sanity.
chmod 755 / 2> /dev/null
chmod 1777 /tmp /var/tmp

# Start APM or ACPI daemon.
# If APM is enabled in the kernel, start apmd:
if [ -e /proc/apm ]; then
if [ -x /usr/sbin/apmd ]; then
echo "Starting APM daemon: /usr/sbin/apmd"
/usr/sbin/apmd
fi
elif [ -x /etc/rc.d/rc.acpid ]; then # otherwise, start acpid:
. /etc/rc.d/rc.acpid start &
fi

# Update any existing icon cache files:
if find /usr/share/icons 2> /dev/null | grep -q icon-theme.cache ; then
for theme_dir in /usr/share/icons/* ; do
if [ -r ${theme_dir}/icon-theme.cache ]; then
echo "Updating icon-theme.cache in ${theme_dir}..."
/usr/bin/gtk-update-icon-cache -t -f ${theme_dir} 1> /dev/null 2> /dev/null &
fi
done
# This would be a large file and probably shouldn't be there, but if it is
# then it must be kept updated, too:
if [ -r /usr/share/icons/icon-theme.cache ]; then
echo "Updating icon-theme.cache in /usr/share/icons..."
/usr/bin/gtk-update-icon-cache -t -f /usr/share/icons 1> /dev/null 2> /dev/null &
fi
fi

# Update mime database:
if [ -x /usr/bin/update-mime-database -a -d /usr/share/mime ]; then
echo "Updating MIME database: /usr/bin/update-mime-database /usr/share/mime &"
/usr/bin/update-mime-database /usr/share/mime &
fi

# Start D-Bus:
if [ -x /etc/rc.d/rc.messagebus ]; then
sh /etc/rc.d/rc.messagebus start
fi

# Start HAL:
if [ -x /etc/rc.d/rc.hald ]; then
sh /etc/rc.d/rc.hald start &
fi

# Start Bluetooth:
if [ -x /etc/rc.d/rc.bluetooth ]; then
sh /etc/rc.d/rc.bluetooth start &
fi

# SCIM and other GTK+ input methods like this file kept updated:
if [ -x /usr/bin/gtk-query-immodules-2.0 ]; then
echo "Updating gtk.immodules: gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules"
/usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules 2> /dev/null &
fi

# Start dnsmasq, a simple DHCP/DNS server:
if [ -x /etc/rc.d/rc.dnsmasq ]; then
/etc/rc.d/rc.dnsmasq start &
fi

# Start the print spooling system. This will usually be LPRng (lpd) or CUPS.
if [ -x /etc/rc.d/rc.cups ]; then
# If HPLIP (HP's complete print/scan/fax system) is installed,
# then it should be run first:
if [ -x /etc/rc.d/rc.hplip ]; then
# Start HPLIP:
/etc/rc.d/rc.hplip start &
fi
# Start CUPS:
/etc/rc.d/rc.cups start &
elif [ -x /etc/rc.d/rc.lprng ]; then
# Start LPRng (lpd):
. /etc/rc.d/rc.lprng start &
fi

# Start netatalk. (a file/print server for Macs using Appletalk)
if [ -x /etc/rc.d/rc.atalk ]; then
/etc/rc.d/rc.atalk &
fi

# Start smartd, which monitors the status of S.M.A.R.T. compatible
# hard drives and reports any problems. Note some devices (which aren't
# smart, I guess ;) will hang if probed by smartd, so it's commented out
# by default.
#if [ -x /usr/sbin/smartd ]; then
# /usr/sbin/smartd
#fi

# If we're using udev, make /dev/cdrom and any other optical drive symlinks
# if some udev rule hasn't made them already:
if grep -wq sysfs /proc/mounts && grep -wq tmpfs /proc/filesystems; then
if ! grep -wq nohotplug /proc/cmdline ; then
if [ -x /lib/udev/rc.optical-symlinks -a -x /etc/rc.d/rc.udev ]; then
/bin/sh /lib/udev/rc.optical-symlinks
fi
fi
fi

# Monitor the UPS with genpowerd.
# To use this, uncomment this section and edit your settings in
# /etc/genpowerd.conf (serial device, UPS type, etc). For more information,
# see "man genpowerd" or the extensive documentation in the
# /usr/doc/genpower-1.0.3 directory.
# You'll also need to configure a similar block in /etc/rc.d/rc.6 if you want
# support for stopping the UPS's inverter after the machine halts.
#if [ -x /sbin/genpowerd ]; then
# echo "Starting genpowerd daemon..."
# /sbin/genpowerd
#fi

# Turn on process accounting. To enable process accounting, make sure the
# option for BSD process accounting is enabled in your kernel, and then
# create the file /var/log/pacct (touch /var/log/pacct). By default, process
# accounting is not enabled (since /var/log/pacct does not exist). This is
# because the log file can get VERY large.
if [ -x /sbin/accton -a -r /var/log/pacct ]; then
/sbin/accton /var/log/pacct
chmod 640 /var/log/pacct
echo "Process accounting turned on."
fi

# Start crond (Dillon's crond):
# If you want cron to actually log activity to /var/log/cron, then change
# -l10 to -l8 to increase the logging level.
if [ -x /usr/sbin/crond ]; then
/usr/sbin/crond -l10 >>/var/log/cron 2>&1
fi

# Start atd (manages jobs scheduled with 'at'):
if [ -x /usr/sbin/atd ]; then
/usr/sbin/atd -b 15 -l 1
fi

# Slackware-Mini-Quota-HOWTO:
# To really activate quotas, you'll need to add 'usrquota' and/or 'grpquota' to
# the appropriate partitions as listed in /etc/fstab. Here's an example:
#
# /dev/hda2 /home ext3 defaults,usrquota 1 1
#
# You'll then need to setup initial quota files at the top of the partitions
# to support quota, like this:
# touch /home/aquota.user /home/aquota.group
# chmod 600 /home/aquota.user /home/aquota.group
#
# Then, reboot to activate the system.
# To edit user quotas, use 'edquota'. See 'man edquota'. Also, the
# official Quota Mini-HOWTO has lots of useful information. That can be found
# here: /usr/doc/Linux-HOWTOs/Quota

# Check quotas and then turn quota system on:
if grep -q quota /etc/fstab ; then
if [ -x /sbin/quotacheck ]; then
echo "Checking filesystem quotas: /sbin/quotacheck -avugm"
/sbin/quotacheck -avugm
fi
if [ -x /sbin/quotaon ]; then
echo "Activating filesystem quotas: /sbin/quotaon -avug"
/sbin/quotaon -avug
fi
fi

# Start the SASL authentication server. This provides SASL
# authentication services for sendmail:
if [ -x /etc/rc.d/rc.saslauthd ]; then
. /etc/rc.d/rc.saslauthd start &
fi

# Start the sendmail daemon:
if [ -x /etc/rc.d/rc.sendmail ]; then
. /etc/rc.d/rc.sendmail start &
fi

# Load ALSA (sound) defaults:
if [ -x /etc/rc.d/rc.alsa ]; then
. /etc/rc.d/rc.alsa &
fi

# Load a custom screen font if the user has an rc.font script.
if [ -x /etc/rc.d/rc.font ]; then
. /etc/rc.d/rc.font &
fi

# Load a custom keymap if the user has an rc.keymap script.
if [ -x /etc/rc.d/rc.keymap ]; then
. /etc/rc.d/rc.keymap &
fi

# Start the MySQL database:
if [ -x /etc/rc.d/rc.mysqld ]; then
. /etc/rc.d/rc.mysqld start &
fi

# Start Apache web server:
if [ -x /etc/rc.d/rc.httpd ]; then
. /etc/rc.d/rc.httpd start &
fi

# Start OpenLDAP:
if [ -x /etc/rc.d/rc.openldap ]; then
. /etc/rc.d/rc.openldap start &
fi

# Start Samba (a file/print server for Win95/NT machines).
# Samba can be started in /etc/inetd.conf instead.
if [ -x /etc/rc.d/rc.samba ]; then
. /etc/rc.d/rc.samba start &
fi

# Start the GPM mouse server:
if [ -x /etc/rc.d/rc.gpm ]; then
. /etc/rc.d/rc.gpm start &
fi

# If there are SystemV init scripts for this runlevel, run them.
if [ -x /etc/rc.d/rc.sysvinit ]; then
. /etc/rc.d/rc.sysvinit
fi

# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
. /etc/rc.d/rc.local &
fi

# All done.

lunes 13 de octubre de 2008

Yo soy PC y uso linux

la idea es clara aqui esta el video...


Integrar kaffeine y kget con firefox

Bien ahora hablare sobre como integrar kaffeine con firefox y tambien kget.

comenzando por kaffeine es primeramente tenerlo instalado previamente al igual que firefox eso es mas que obvio, ahora solo toca instalar un pequeño software no es otra cosa mas que un plugin pero no es necesario instalarlo en el sistema simplemente compilarlo en tu usuario si tus deseos solo es usarlo propiamente, entonces se baja el kaffeine-mozilla de esta url despues toca descomprimirlo.

tar -xvjf kaffeine-mozilla.*

despues toca compilarlo con lo siguiente:

./compile --prefix=/home/$USER/.mozilla

make && make install

y listo con esto lo tenemos instalado
ahora solo basta con reiniciar y probar :)


para integrar el kget en firefox, como se sabe kget es un gestor de descargas si te gusta hacer descargas directas, entonces solo hace falta instalar el plugin flashgot y reiniciar firefox , despues de haber esho irse alas preferencias de flashgot y seleccionar kget.

y listo :)

sábado 4 de octubre de 2008

Conectate a una comunidad que crece

Sí necesitas ayuda en algun problema que tienes, en tu distribución, con todo lo relacionado, te puedes conectar a esta red mediante algun cliente de IRC o via web chat que despues se proporcionara.

Sobre linux el canal es: #linux

Sobre php el canal es: #php

irc.redcoatza.com

Microfonos integrados

Para aquellos que utilizan KDE y no les funciona el microfono integrado que tengan lo mas común es tratar de recompilar el kernel o bien querer actualizar alsa .

Bien ahora no se trata de eso ni de buscar una solución dificil, tal vez si se pueda hacer una actualizacion de alsa pero ahora no es necesario.. simplemente si tu tarjeta de sonido usa el modulo snd_hda_intel entonces solo basta ir a Centro de control > Sonidos y multimedia > Sistema de sonido despues de estar alli entrar en la pestaña de Hardware y marcar en donde dice Full duplex con esto ya tendran funcionando su microfono integrado, ahora solo falta hacer la prueba de por medio.

Abran KRec y empiezen a grabar :)

viernes 8 de agosto de 2008

Crea tus propios SlackBuild's

crea tus propios SlackBuilds mediante un formulario sin la necesidad de hacer algo mas simple y eficiente via web.

aqui les dejo el enlace

AST