16
Aug

Cum inteleg unii sa faca reduceri…

Written by Znuff. Posted in Romanian

Enough said.

15
Aug

Better cmd.exe terminal and ANSI color codes support

Written by Znuff. Posted in Why Do I Have To Have A Category?

If you’ve got an Android phone and you know what ADB is and you are using a Windows machine primarily, chances are you’ve been annoyed by stuff like this in the past:
cmd.exe - ansi control codes

Tags: , , , , ,

05
Aug

Extending Upside-Down-Ternet

Written by Znuff. Posted in Why Do I Have To Have A Category?

I was sick of people freeloading on my WiFi and I didn’t want to password protect it (for various reasons I’m too lazy to explain).

So I remembered about Upside-Down-Ternet and I extended it a bit with 23 more annoyances:

  • In addition of Flipping the images, I also grey-scaled them
  • I replaced ALL .swf files on webpages with a kitten meow sound that you can see (or hear) here: Kitten Meow Sound (right click to save as).
  • I redirect ALL YouTube (mobile and desktop) video requests to a video called “Dramatic Cat” 

For the initial set-up I followed the fine How-To at the Ubuntu Community Website. And here is my modified script:

UPDATE: I added YouTube video redirection, too!

#!/usr/bin/perl
$|=1;
$count = 0;
$pid = $$;
while (<>) {
        chomp $_;
        if (/(.*\.jpg)/i) {
                $url = $1;
                system("/usr/bin/wget", "-q", "-O","/var/www/images/$pid-$count.jpg", $url);
                system("/usr/bin/mogrify", "-flip", "-modulate", "100,0", "/var/www/images/$pid-$count.jpg");
                print "http://127.0.0.1/images/$pid-$count.jpg\n";
        }
        elsif (/(.*\.gif)/i) {
                $url = $1;
                system("/usr/bin/wget", "-q", "-O","/var/www/images/$pid-$count.gif", $url);
                system("/usr/bin/mogrify", "-flip", "-modulate", "100,0", "/var/www/images/$pid-$count.gif");
                print "http://127.0.0.1/images/$pid-$count.gif\n";
 
        }
        elsif (/(.*\.png)/i) {
                $url = $1;
                system("/usr/bin/wget", "-q", "-O","/var/www/images/$pid-$count.png", $url);
                system("/usr/bin/mogrify", "-flip", "-modulate", "100,0", "/var/www/images/$pid-$count.png");
                print "http://127.0.0.1/images/$pid-$count.png\n";
 
        }
        elsif (/(.*\.swf)/i) {
               print "http://127.0.0.1/meow.swf\n";
        }
        elsif (/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?videoplayback.*id=/i) {
               print "http://127.0.0.1/dramatic_cat.mp4\n";
        }
        else {
                print "$_\n";;
        }
        $count++;
}

Here is how it looks on an Android phone:

a picture of the result of the script