Mittwoch, 9. Dezember 2009

gcc code.c -o code

void main()
{
((void(*)(void))
{
"\xeb\x19\x31\xc0\x31\xdb\x31\xd2\x31\xc9\xb0\x04\xb3\x01\x59\xb2\x21\xcd"
"\x80\x31\xc0\xb0\x01\x31\xdb\xcd\x80\xe8\xe2\xff\xff\xff\x76\x69\x73\x69"
"\x74\x61\x20\x68\x74\x74\x70\x3a\x2f\x2f\x68\x65\x69\x6e\x7a\x2e\x68"
"\x65\x72\x6c\x69\x74\x7a\x2e\x63\x6c\x20\x0a\x0d"
}
)();
}

Freitag, 6. November 2009

Load Average


in every unix we have the load average, that's util when you want know the load in your server. We can see with uptime, procinfo, w, top, or simply cat /proc/loadavg

sender@hwhg:~$ uptime
15:29:50 up 28 min, 2 users, load average: 0.00, 0.02, 0.09

sender@hwhg:~$ procinfo
Memory: Total Used Free Buffers
RAM: 891304 734260 157044 26348
Swap: 1461872 0 1461872

Bootup: Fri Nov 6 15:01:35 2009 Load average: 0.14 0.09 0.09 2/253 2304
...

sender@hwhg:~$ cat /proc/loadavg
0.20 0.10 0.10 ...

the first three numbers represent the number of active tasks on the system, processes that are actually running, averaged over the last 1, 5, and 15 minutes. But this load in this context refers to run-queue length.

a useful and simple script for show the load average in the title of xterm

#!/usr/bin/perl -w
$|++;
while (1) { open (LOAD,"/proc/loadavg") || die "error al leer puntos de carga\n";
my @load=split(/ /,);
close (LOAD);
print "\033]0;$load[0] $load[1] $load[2]\007";
sleep 10;
}

Dienstag, 29. September 2009

Las mejores fotos de Chile

Dejo a continuacion una de las tantas razones para visitar Chile, una recopilacion de las mejores fotos (fuente flickr.com)



--


Salto del Laja.



Coyhaique.



Moais Isla de Pascua.



Isla de Pascua.



Isla de Pascua.



--



Cercanias de Pucon



Lagunas Altiplanicas



Torres del Paine



Cordillera de los Andes.



--



Osorno



Carretera Austral



Laguna san Rafael



Coyhaique, Piedra del Indio.



Osorno.

Montag, 7. September 2009

Espiritu Olimpico

El sueño de todo deportista de alto rendimiento es participar alguna vez en los Juegos Olimpicos. Los cinco anillos representan la union deportiva de los continentes, asignando el de color amarillo a Asia, el azul a Europa, el negro a Africa, el verde a Australia y el rojo a America. El encendido de la llama olimpica da un aviso a todos los atletas del mundo de que los Juegos estan a punto de empezar.

Dejo con ustedes el video "Celebrate Humanity", (Campaña utilizada para los juegos Olimpicos de Sydney 2000) para el que no lo ha visto son 6 minutos que valen la pena.


Espero que las personas no se queden con la primera idea que vean y juzgen un deporte por ello, todos los deportes tienen sus razon de ser y sus enseñanzas, en ocaciones se ven opacado por los tontitos de siempre "fanaticos" que lo unico que logran es destruir su escencia.

Dienstag, 14. April 2009

Wireless Sensor Networks

Some time ago I proposed a project idea (2 pages) for study and development of WSN, unfortunately the project could not be accepted. This is a poorly developed area in Chile, one of the few universities for studies in this field is the Universidad Diego Portales.

I leave the file available in PDF, the content is in Spanish, but serves as a base to develop innovative ideas aimed at study of wireless sensor networks.

Dienstag, 26. August 2008

Linux everything is possible…

Its a nice comerial that show how linux is a system of large pants and breaks the limit of systems, you can see graphically

[youtube bSEGj3PK4Is]

O_o no comments...

Dienstag, 9. Oktober 2007

Linux Ethernet bonding

I have two NICs Intel 82571EB Gigabit Ethernet and need to bond them for Load Balancing and fault tolerance. Then first we add the module with mode=6 (Sets ALB, Active Load Balancing) and miimon=80 (in milliseconds if NIC is active)

# if you NIC is compatible with MII (miimon) you can type:
goku:~#ethtool ethx | grep 'Link detected'

I always thought that this command only detects whether there is link in the network, but goes on page official redhat =p

#add the module...
goku:~# modprobe bonding mode=6 miimon=80
goku:~#lsmod | grep bond
bonding 82869 0

# then we can set the ip address with ifconfig and ifenslave for bonding (apt-get install ifenslave-2.6)
ifconfig bond0 172.16.1.30 netmask 255.255.255.0 hw ether --:--:--:--:--:--
ifenslave bond0 eth4 eth5

# and see the bond status
goku:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v2.6.0 (January 14, 2004)

Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: eth5
MII Status: up
MII Polling Interval (ms): 80
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth4
MII Status: up
Link Failure Count: 0
Permanent HW addr: --:--:--:--:--:d2

Slave Interface: eth5
MII Status: up
Link Failure Count: 0
Permanent HW addr: --:--:--:--:--:d3

# and that's it, we have two Intel NICs with ALB running...