Why python? Speed. He wants to really rack up some cost. Of course the bash could nearly be sped up like so.
while true
cp file_name /dev/null && ((COUNTER++)) &
done
Problem, doing multiple actions concurrently means a subshell which means that variable isn't really counting.
Let's use some node cause that's easier to do async than bash in one process.
var async = require('async');
var fs = require('fs');
var exec = require('child_process').exec;
var count=0;
var rate=0;
var lastrate=0;
function cp(cb) {
//We are going to use cp to utilize the kernel's sendfile module and get cpu heavy stuff out of our control process.
exec('cp ourfile /dev/null',function () {
++count;
++rate;
cb();
});
}
function noop(){}
var timer = setInterval(function grow() {
if(rate<lastrate) {
//We are no longer speeding up.
clearInterval(timer);
}
else {
lastrate=rate;
rate=0;
async.forever(cp,noop);
}
},2000);
setInterval(function printCount() {
console.log('Count:',count);
},10000);
Also, on an unrelated note what does this article have to do with conspiracy? Is /v/conspiracy just an ironically better version of /v/news?
view the rest of the comments →
WhiteRonin ago
["The Kopimashin does make real copies of the track, but they are sent to /dev/null, which means that they are not permanently stored."]
Does a file really exist if you haven't visually seen its output or heard it through speakers?
Here's art!The Kopimashin does make real copies of the track, but they are sent to /dev/null, which means that they are not permanently stored.
Here's art
Oh fuck! I'm gonna get sued for copy right infringement!
Why Python? He could have probably done it in Bash and saved a lot in memory!
To protect your self just:
Only 1 copy has ever existed :p
luckyguy ago
Why python? Speed. He wants to really rack up some cost. Of course the bash could nearly be sped up like so.
Problem, doing multiple actions concurrently means a subshell which means that variable isn't really counting.
Let's use some node cause that's easier to do async than bash in one process.
Also, on an unrelated note what does this article have to do with conspiracy? Is /v/conspiracy just an ironically better version of /v/news?
WhiteRonin ago
Awesome :-)
But is this art?