Monday 31 January 2011

Componentes para efectos en Chile

Si necesitas esa pieza en particular para ese efecto que estás trabajando y Casa Royal o San Diego no te lo dan, y no quieres pagar miles por un integrado a RS Chile, tu solución es Kowka.

La mejor experiencia de compra, pides online, pasas a retirar o te despachan, venden los mejores componentes.

Una tienda especializada en electrónica de efectos de guitarra.

Nada que hacer, Kowka la lleva.

www.kowka.cl

How to know the block size of a file system

dumpe2fs /dev/sda1 | grep "Block size"

The output is expresed in bytes:


dumpe2fs 1.39 (29-May-2006)
Block size:               4096

Thursday 20 January 2011

Use linux host as gateway

#Enable the ip forward
sysctl -w net.ipv4.ip_forward=1

#Let iptables do the magic :)
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Using the distro DVD as repo in Red Hat

Firt, mount the distro DVD or ISO.

Create a file /etc/yum.repos.d/dvd.repo.

Open the .discinfo in the root of the DVD or ISO and copy the code of the first line.

Open /etc/yum.repos.d/dvd.repo and fill it as follow:

[dvd]
mediaid=1170972069.396645*
name=DVD for RHEL5
baseurl=file:///path/to/media/Server
enabled=1
gpgcheck=0

Replace the mediaid value with the code copied from the .discinfo file.

Then, use yum with --noplugins

:)

Wednesday 19 January 2011

"Procrastination" Tales Of Mere Existence

Other nice and simple one-liner!

If you want to delete n days old files, you can use a one-liner like this:

find /directory -type f -mtime +n -exec rm -f {} \; 

Or -type d for deleting directories, etc.

Tuesday 18 January 2011

Simple FTP upload script

Using lftp (or other ftp cli client) yo can make a easy upload to a ftp server. Just create a text file with the ftp commands you want to execute, and use like this (using lftp) :

lftp  -uuser,pass  server < text_file_with_commands

Simple!