Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created November 3, 2011 08:53
Show Gist options
  • Select an option

  • Save KristianLyng/1336075 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/1336075 to your computer and use it in GitHub Desktop.
root@luke:~# cat foo.c
#include <stdlib.h>
int main(void) {
int i;
long int a;
char *b;
char buff[100010];
int buflen=0;
srandom(time(NULL));
for (i=0;i < 10000000;i++) {
a = random();
b = (char *) &a;
buff[buflen++] = b[0];
buff[buflen++] = b[1];
buff[buflen++] = b[2];
buff[buflen++] = b[3];
if (buflen > 100000){
write(1,buff,buflen);
buflen=0;
}
}
write(1,buff,buflen);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment