viernes, 30 de abril de 2010

La quakeiza de hoy: Quake Live


La quakeiza de hoy: Quake Live, originalmente cargada por hdaniel.

En vista de que la quake-manía se ha evaporado por los rumbos de la red local habrá que ponerse a jugar quake-live.

miércoles, 28 de abril de 2010

Temperatura en el CIE

Radiación Solar en el CIE

doy2tm.c


#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>

time_t doy2tm(const int year, const int dayofyear, struct tm *tm) {

int leapyear, m, d;

int d_in_m [] = {31,28,31,30,31,30,31,31,30,31,30,31};

memset(tm, 0, sizeof(*tm));

leapyear = (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0));

if( dayofyear < 1 || dayofyear > (leapyear ? 366 : 365) ) {
return (time_t) -1;
}

if(leapyear) { d_in_m[1]=29; }

for(m=0, d=dayofyear;
d>d_in_m[m];
d-=d_in_m[m++]);

tm->tm_mday=d;
tm->tm_mon=m;
tm->tm_year=year - 1900;

return mktime(tm);
}

int main (int argc, char* argv[]) {
struct tm tm;
int y,d;
char str[128];

if (argc != 3) {
fprintf(stderr, "Usage: %s year dayofyear\n", argv[0]);
return EXIT_FAILURE;
}

y = atoi(argv[1]);
d = atoi(argv[2]);

if (doy2tm(y,d,&tm) == -1) {
fputs("doy2tm returned -1\n", stderr);
return EXIT_FAILURE;
}

if (strftime(str, sizeof(str), "%c", &tm) == 0) {
fputs("strftime returned 0\n", stderr);
return EXIT_FAILURE;
}

printf("%d %d => %s\n", y, d, str);
return EXIT_SUCCESS;
}

martes, 27 de abril de 2010

doy2m.pl

#!/usr/bin/perl -wl
#
# doy2m.pl
# day of year 2 month

use Date::Manip;

my ($y,$m,$d,$h,$mn,$s) = Date_NthDayOfYear(2010,69);
print $m;

jueves, 8 de abril de 2010

Por si no se entendió

Por si alguien no entendió el post de Showtime Networks Incorporated:

Case ID: 1024197398
Infringing Work: Dexter
First Found: 4 Mar 2010 00:05:03 EST (GMT-0500)
Last Found: 4 Mar 2010 00:05:03 EST (GMT-0500)
IP Address: 132.248.30.X
IP Port: 51413
Protocol: BitTorrent
Torrent InfoHash: 6B9F76C83C1B73EF852F9BC011698113A4F6966A
Containing files(s): Dexter.S04E02.Remains.to.Be.Seen.HDTV.XviD-FQM.avi.torrent (576,730,440 bytes)

El 3 de marzo del 2010 a las 23:05:03 hora local se encuentra que el equipo con direción de internet 132.248.30.X está corriendo un programa de bittorrent en el puerto de comunicación 51413 el cual contiene el archivo de nombre Dexter.S04E02.Remains.to.Be.Seen.HDTV.XviD-FQM.avi.torrent con un tamaño de 576,730,440 bytes.

Se presume que dicho archivo, en el formato AVI de Microsoft creado con el codificador XviD con la opción FQM, contiene una copia no autorizada del vídeo de la serie de televisión Dexter, Temporada 4, Episodio 2, con título "Remains to be seen", en formato de alta definición.

domingo, 28 de marzo de 2010

sábado, 27 de marzo de 2010

Showtime Networks Incorported

Ayer me notificaron que Showtime Networks Inc. se estaba quejando sobre actividades que presumiblemente violan derechos de propiedad intelectual de terceros en una las computadoras de la red a mi cargo:

Case ID: 1024197398
Infringing Work: Dexter
First Found: 4 Mar 2010 00:05:03 EST (GMT-0500)
Last Found: 4 Mar 2010 00:05:03 EST (GMT-0500)
IP Address: 132.248.30.X
IP Port: 51413
Protocol: BitTorrent
Torrent InfoHash: 6B9F76C83C1B73EF852F9BC011698113A4F6966A
Containing files(s): Dexter.S04E02.Remains.to.Be.Seen.HDTV.XviD-FQM.avi.torrent (576,730,440
bytes)

¡Típico! El asunto ha sido arreglado. Showtime Networks Incorporated puede estar seguro de que en esa computadora en particular no hay ningún archivo de nombre Dexter.S04E02.Remains.to.Be.Seen.HDTV.XviD-FQM.avi.torrent con un tamaño de 576,730,440 bytes :-)

Me pregunto. ¿Cómo le hizo Showtime Networks Incorporated para obtener la información? ¿Será que tiene un sniffer en alguna computadora de nuestra red? ¿Una de esas tantas computadoras infectadas con malware y que están al servicio del mejor postor? ¿Tendrán un sniffer en el backbone de nuestro ISP?

No hace falta ser un genio como Dexter ni tener una hermana como Dee dee para darse cuenta que con una ligera modificación a un cliente bittorrent es posible obtener del tracker la lista de direcciones IP.

Por cierto: no estoy interesado en cereal killers. La última serie decente de showtime que recuerdo haber visto fue Penn & Teller. ¡Y ya no la pasan! ¿Se podrá conseguir por Internet en la tienda de vídeos?

jueves, 25 de marzo de 2010

Los mejores personajes de películas

No tengo idea de cómo llegué aquí. No estaré de acuerdo con todos, pero van mis favoritos:

¿Y tu que opinas?

viernes, 19 de marzo de 2010

filldisk.pl

#!/usr/bin/perl -w
#
# Usage: perl filldisk.pl > /dev/sdc

use Crypt::RC4;
use Crypt::Random qw(makerandom_octet);

my $BSIZE=4096;
my $KSIZE=16;

my $buffer;
my $rc4key=makerandom_octet(Length => $KSIZE, Strength => 1, Uniform=>1);

binmode STDOUT;

my $total=0;
my $wsize=0;

my $alarm=1;

local $SIG{ALRM} = sub { $alarm=1; };

while(1) {
if($alarm) {
print STDERR "\r$total KB";
$buffer=makerandom_octet(Length => $BSIZE, Strength => 0, Uniform=>1);
$alarm = 0;
alarm(1);
}

$buffer = RC4($rc4key, $buffer);
$wsize = syswrite(STDOUT, $buffer, $BSIZE);
last unless $wsize;
$total+=$wsize >> 10;
$rc4key=makerandom_octet(Length => $KSIZE, Strength => 0, Uniform=>1);
}

print STDERR "\n$0: $!\n$total KB written\n";

jueves, 4 de marzo de 2010

d2hms.c

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

double d2hms(const double d, double *h, double *m, double *s)
{ double foo;
foo=modf(d,h);
foo*=60;
foo=modf(foo,m);
foo*=60;
foo=modf(foo,s);
return foo;
}

int main(int argc, char* argv[], char* envp[])
{
double d,h,m,s,c;

if(argc==2) {
d=atof(argv[1]); /* better use strtod */
} else {
printf("Usage:\n%s hora.decimal\n",argv[0]);
return -1;
}

c=d2hms(d,&h,&m,&s);
printf("%f=%.0f:%02.0f:%06.3f\n", d, h, m, s+c);
return 0;
}

---
$ gcc d2hms.c -lm
$ ./a.out 12.345678
12.345678=12:20:44.441