Skip to content

Commit 1036164

Browse files
committed
Track Upside-Down-Ternet rewrite script
1 parent 8839c6f commit 1036164

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

collect.sh

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ cp /etc/hosts .
2525
cp /etc/dnsmasq.d/dhcp.conf .
2626
cp /etc/default/ifplugd .
2727
cp /etc/default/hostapd .
28+
cp /usr/local/bin/flip.pl .

flip.pl

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/perl
2+
3+
# Adapted from http://www.ex-parrot.com/~pete/upside-down-ternet.html
4+
5+
$|=1;
6+
$count = 0;
7+
$pid = $$;
8+
while (<>) {
9+
chomp $_;
10+
if ($_ =~ /(.*\.jpg)/i) {
11+
$url = $1;
12+
system("/usr/bin/wget", "-q", "-O", "/var/tmp/upsidedownternet/$pid-$count.jpg", "$url");
13+
system("/usr/bin/mogrify", "-flip", "/var/tmp/upsidedownternet/$pid-$count.jpg");
14+
print "http://127.0.0.1/images/$pid-$count.jpg\n";
15+
}
16+
elsif ($_ =~ /(.*\.gif)/i) {
17+
$url = $1;
18+
system("/usr/bin/wget", "-q", "-O", "/var/tmp/upsidedownternet/$pid-$count.gif", "$url");
19+
system("/usr/bin/mogrify", "-flip", "/var/tmp/upsidedownternet/$pid-$count.gif");

0 commit comments

Comments
 (0)