En la máquina que tiene el archivo:
cat ARCHIVO | gzip --fast | netcat -l -p PUERTO
En la máquina a la que queremos enviarlo:
netcat HOST PUERTO | gunzip > ARCHIVO
Blog de programación y diseño de software
cat ARCHIVO | gzip --fast | netcat -l -p PUERTO
netcat HOST PUERTO | gunzip > ARCHIVO
#!/usr/bin/python
from math import sqrt
def esPrimo(n):
root=int(sqrt(n));
for i in range(2,root+1):
if n%i==0:
return False;
return True;
def generadorPrimos(n):
for i in filter(esPrimo, range(2,n+1)):
yield i
for i in generadorPrimos(100):
print i;
#!/usr/bin/python
from math import sqrt
import random
def generadorAleatorios(a,b,n):
for i in range(0,n):
yield random.randint(a, b);
for i in generadorAleatorios(1,100,10):
print i;
#!/usr/bin/python
from math import sqrt
import random
def generadorIPs(n):
for i in range(0,n):
a=random.randint(0,255);
b=random.randint(0,255);
c=random.randint(0,255);
d=random.randint(0,255);
yield str(a)+"."+str(b)+"."+str(c)+"."+str(d);
for i in generadorIPs(10):
print i;
#include<stdio.h>
#define PENDRIVE "/dev/sdb1"
#define BUFFERSIZE 4096
int main(){
int i, j, leido, nBytes;
FILE *fichero;
int buffer[BUFFERSIZE];
fichero=fopen(PENDRIVE, "rw+");
//Hallar el tamanio del fichero
fseek(fichero, 0, SEEK_END);
nBytes=ftell(fichero);
fseek(fichero, 0, SEEK_SET);
//Leer,escribir y encriptar el fichero/dispositivo
for(i=0;i<nBytes;i+=BUFFERSIZE){
leido=fread(buffer, 1, BUFFERSIZE, fichero);
fseek(fichero, -leido, SEEK_CUR);
for(j=0;j<leido;j++) buffer[j]=buffer[j]^0x12345678;
fwrite(buffer, leido, 1, fichero);
if(i%(BUFFERSIZE*1000)==0){
printf("%.1f%\n",(i*100.0)/nBytes);
}
}
fclose(fichero);
}
<script type="text/javascript" src="jquery.js"></script>
$(document).ready(inicializar);
<html>
<title>Titulillo</title>
<h1>Prueba</h1>
<body>
<input type="button" id="boton1" value="click">
<input type="button" id="boton2" value="click">
<input type="button" id="boton3" value="click">
<input type="button" id="boton4" value="click">
<input type="button" id="boton5" value="click">
<input type="button" id="boton6" value="click">
<input type="text" id="text1" value="click">
</body></html>
function inicializar(){
$("input").click(BotonClick);
$("input").hover(
function() { $(this).addClass("blanco"); $(this).removeClass("rojo");},
function() { $(this).addClass("rojo"); $(this).removeClass("blanco"); }
);
}<style>
.blanco{
background-color:#ffffff;
}
.rojo{
background-color:#ff0000;
}
</style>
function BotonClick(){
$(this).hide();
}Introduzca su nombre:
<form action="index.php" method="get">
<input name="nombre" type="text">
<input value="Enviar" type="submit">
</form>
Introduzca su nombre:
<form action="index.php" name="formulario" method="GET">
<input type="text" name="nombre">
<a href=javascript:document["formulario"].submit();>Enviar</a>
</form>
Introduzca su nombre:
<form action="index.php" name="formulario" method="GET">
<input type="text" name="nombre">
<a href=# onclick=javascript:document["formulario"].submit();>Enviar</a>
</form>
Introduzca su nombre:
<form action="index.php" name="formulario" method="GET">
<input type="text" name="nombre">
</form>
<a href=# onclick=javascript:document["formulario"].submit();>Enviar</a>
#!/usr/bin/perl
use Digest::MD5 qw(md5 md5_hex md5_base64);
$hash1=md5("pass");
$hash2=md5_hex("pass");
$hash3=md5_base64("pass");
print $hash1 . "\n";
print $hash2 . "\n";
print $hash3 . "\n";
#include <stdio.h>
int main(){
char cadena[1024];
printf("Introduce el pass: ");
scanf("%s", cadena);
if(!strcmp(cadena, "esteeselpass")) printf("Correcto\n");
else printf("Incorrecto\n");
}
objdump -d prueba > prueba.asm
8048472: e8 d9 fe ff ff call 8048350
8048477: 8d 85 f0 fb ff ff lea 0xfffffbf0(%ebp),%eax
804847d: 89 85 e0 fb ff ff mov %eax,0xfffffbe0(%ebp)
8048483: c7 85 dc fb ff ff e3 movl $0x80485e3,0xfffffbdc(%ebp)
804848a: 85 04 08
804848d: c7 85 d8 fb ff ff 0d movl $0xd,0xfffffbd8(%ebp)
8048494: 00 00 00
8048497: fc cld
8048498: 8b b5 e0 fb ff ff mov 0xfffffbe0(%ebp),%esi
804849e: 8b bd dc fb ff ff mov 0xfffffbdc(%ebp),%edi
80484a4: 8b 8d d8 fb ff ff mov 0xfffffbd8(%ebp),%ecx
80484aa: f3 a6 repz cmpsb %es:(%edi),%ds:(%esi)
80484ac: 0f 97 c2 seta %dl
80484af: 0f 92 c0 setb %al
80484b2: 89 d1 mov %edx,%ecx
80484b4: 28 c1 sub %al,%cl
80484b6: 89 c8 mov %ecx,%eax
80484b8: 0f be c0 movsbl %al,%eax
80484bb: 85 c0 test %eax,%eax
80484bd: 75 0e jne 80484cd
80484bf: c7 04 24 f0 85 04 08 movl $0x80485f0,(%esp)
80484c6: e8 b5 fe ff ff call 8048380
80484cb: eb 0c jmp 80484d9
80484cd: c7 04 24 f9 85 04 08 movl $0x80485f9,(%esp)
80484d4: e8 a7 fe ff ff call 8048380
gdb prueba
80484aa: f3 a6 repz cmpsb %es:(%edi),%ds:(%esi)
break *0x80484aa
run
info registers
x/s 0x80485e3
x/s 0xbf86a3d8
80484bb: 85 c0 test %eax,%eax
80484bd: 75 0e jne 80484cd
info registers
set $eax=0