Re: Its nearly Christmas
am 19.12.2007 20:28:12 von Edward Rosten
On Dec 19, 2:11 pm, Grant wrote:
> Can someone suggest a good -
> possible to type a simple message> Christmas message via a command
> line script ?
Well, it uses echo, tr, sed (loads) and xxd. Bonus: the intermediate
language is BrainF*!k (the interpreter has been hacked and won't print
control chars, so I could paste it as text here).
echo '+++++++[>++++++++++<-]>+++++++.<++++++[>++++<-]>.+++++++++++++..
+++++++.[-]<+++++[>++++++<-]>++.<+++++[>+++++++<-]>.<++++++[>+++++++<
-]>-----.++++++++++.---------.++++++++++.+.-------.<+++[>----<-]>.<++
+[>++++++<-]>.[-]<+++[>+++<-]>+.'|tr -d '[:space:]' | sed -e'
s/.*/00{#&}/;:p;/#\[/bf;/#]/bo;s/#\(.\)\(.*\)/\1#\2/;:e;/#}/ !bp;
s/.*{\(.*\)#}.*/\1/;bi;:f;s/\(..\).*/&\1/;
s/\(..\)\(.*\)#\[\(.*\)/\1\2[\1#\3/; h; s/.\(.\).*/\1/;
y/0123456789ABCDEF/123456789ABCDEF0/; x; G; s/\(.\).\(.*\)\n\(.\)/
\1\3\2/;
/^.0/!be; h; s/\(.\).*/\1/; y/0123456789ABCDEF/123456789ABCDEF0/; x;
G;
s/^.\(.*\)\n\(.\)/\2\1/;be;:o;s/^\(.*\)#]\(.*\)\(..\)/\1]\3# \2/;be;:i;
s/.*/#&@!00%/;:m;s/.*#\(.\).*/&\1/;/+$/ba;/-$/bs;/>$/br;/<$/bl;/\.$/
bt;
/,$/bd; /\[$/bw; /]$/bv; :x; s/#\(.\)\(.*\)/\1#\2/;
/[][]#[A-Z0-9][A-Z0-9]/s/#\(..\)\(.*\)/\1#\2/;: y;/#@/!bm;s/.*//;q;:a;
s/.$//; s/.*!\(..\).*/&\1/; h; s/.*\(.\)/\1/;
y/0123456789ABCDEF/123456789ABCDEF0/; x; G; s/.\n\(.\)/\1/; /0$/!bn;
h;
s/.*\(.\)./\1/; y/0123456789ABCDEF/123456789ABCDEF0/; x; G;
s/.\(.\)\n\(.\)/\2\1/; :n; s/!..\(.*\)%\(..\)/!\2\1%/; bx; :s; s/.$//;
s/.*!\(..\).*/&\1/;h;s/.*\(.\)/\1/;y/
123456789ABCDEF0/0123456789ABCDEF/;
x; G; s/.\n\(.\)/\1/; /F$/!bb; h; s/.*\(.\)./\1/;
y/123456789ABCDEF0/0123456789ABCDEF/; x; G; s/.\(.\)\n\(.\)/\2\1/; :b;
s/!..\(.*\)%\(..\)/!\2\1%/; bx; :r; s/.$//; /!..%/s/%/00%/;
s/!\(..\)\(.*\)/\1!\2/;bx;:l;s/.$//;/@!/s/@/@00/;s/\(..\)!\( .*\)/!
\1\2/;
bx; :t; s/.$//; h; s/.*!\(..\).*/\1/;
s/.*/&--01A02B03C04D05E06F07G08H09 --0A\
--0BK0CL0DM0EN0FO10P11Q12R13S14T15U16V'\
'--17W18X19Y1AX1B[--1C\--1D]--1E^--1F_--20 --21!--22"--2'\
'3#--24$--25%--26\&--27'\''--28(--29)--2A*--2B+--2C,--2D---2 E.--2F
\/--300'\
'--311--322--333--344--355--366--377--388--399--3A:--3B;--3C<--3D=--3E>--'\
'3F?--40@--41A--42B--43C--44D--45E--46F--47G--48H--49I--4AJ- -4BK--4CL--4D'\
'M--4EN--4FO--50P--51Q--52R--53S--54T--55U--56V--57W--58X--5 9Y--5AZ--5B[-'\
'-5C\
\--5D]--5E^--5F_--60`--61a--62b--63c--64d--65e--66f--67g--68 h--69i--'\
'6Aj--6Bk--6Cl--6Dm--6En--6Fo--70p--71q--72r--73s--74t--75u- -76v--77w--78'\
'x--79y--7Az--7B{--7C|--7D}--7E~/;s/\(..\).*--\1//;s/\(.\).* /
\1/;p;x;bx;:d;
s/.$//;N;s/!..\(.*\)\n\(..\)/!\2\1/;bx;:w;s/.$//;/!00/!bx;
s/\(.*\)#\[\(..\)\(.*\)]\2\(.*\)/\1[\2\3#]\2\4/;bx;:v;s/.$// ;
s/\(.*\)#]\(..\)\(.*\)/\2\1]\2\3/;s/\(..\)\(.*\)\[\1\(.*\)/
\2#[\1\3/;by;' |
xxd -p | sed -e's/\(..\)../\1/g' | xxd -p -r
-Ed
--
(You can't go wrong with psycho-rats.) (http://mi.eng.cam.ac.uk/
~er258)
/d{def}def/f{/Times findfont s scalefont setfont}d/s{11}d/r{roll}d f 2/
m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0
rmoveto}
for /s 12 d f pop 235 420 translate 0 0 moveto 1 2 scale show
showpage
Re: Its nearly Christmas
am 19.12.2007 20:35:44 von Edward Rosten
On Dec 19, 12:28 pm, Edward Rosten wrote:
> On Dec 19, 2:11 pm, Grant wrote:
Odd, that didn't work when I pasted it back. Try ths:
echo '+++++++[>++++++++++<-]>+++++++.<++++++[>++++<-]>.+++++++++++++..
+++++++.[-]<+++++[>++++++<-]>++.<+++++[>+++++++<-]>.<++++++[>+++++++<
-]>-----.++++++++++.---------.++++++++++.+.-------.<+++[>----<-]>.<++
+[>++++++<-]>.[-]<+++[>+++<-]>+.'|tr -d '[:space:]' | sed -e'
s/.*/00{#&}/;:p;/#\[/bf;/#]/bo;s/#\(.\)\(.*\)/\1#\2/;:e;/#}/ !bp;
s/.*{\(.*\)#}.*/\1/;bi;:f;s/\(..\).*/&\1/;
s/\(..\)\(.*\)#\[\(.*\)/\1\2[\1#\3/; h; s/.\(.\).*/\1/;
y/0123456789ABCDEF/123456789ABCDEF0/; x; G; s/\(.\).\(.*\)\n\(.\)/
\1\3\2/;
/^.0/!be; h; s/\(.\).*/\1/; y/0123456789ABCDEF/123456789ABCDEF0/; x;
G;
s/^.\(.*\)\n\(.\)/\2\1/;be;:o;s/^\(.*\)#]\(.*\)\(..\)/\1]\3# \2/;be;:i;
s/.*/#&@!00%/;:m;s/.*#\(.\).*/&\1/;/+$/ba;/-$/bs;/>$/br;/<$/bl;/\.$/
bt;
/,$/bd; /\[$/bw; /]$/bv; :x; s/#\(.\)\(.*\)/\1#\2/;
/[][]#[A-Z0-9][A-Z0-9]/s/#\(..\)\(.*\)/\1#\2/;: y;/#@/!bm;s/.*//;q;:a;
s/.$//; s/.*!\(..\).*/&\1/; h; s/.*\(.\)/\1/;
y/0123456789ABCDEF/123456789ABCDEF0/; x; G; s/.\n\(.\)/\1/; /0$/!bn;
h;
s/.*\(.\)./\1/; y/0123456789ABCDEF/123456789ABCDEF0/; x; G;
s/.\(.\)\n\(.\)/\2\1/; :n; s/!..\(.*\)%\(..\)/!\2\1%/; bx; :s; s/.$//;
s/.*!\(..\).*/&\1/;h;s/.*\(.\)/\1/;y/
123456789ABCDEF0/0123456789ABCDEF/;
x; G; s/.\n\(.\)/\1/; /F$/!bb; h; s/.*\(.\)./\1/;
y/123456789ABCDEF0/0123456789ABCDEF/; x; G; s/.\(.\)\n\(.\)/\2\1/; :b;
s/!..\(.*\)%\(..\)/!\2\1%/; bx; :r; s/.$//; /!..%/s/%/00%/;
s/!\(..\)\(.*\)/\1!\2/;bx;:l;s/.$//;/@!/s/@/@00/;s/\(..\)!\( .*\)/!
\1\2/;
bx; :t; s/.$//; h; s/.*!\(..\).*/\1/;
s/.*/&--01A02B03C04D05E06F07G08H09 --0A\
--0BK0CL0DM0EN0FO10P11Q12R13S14T15U16V'\
'--17W18X19Y1AX1B[--1C\--1D]--1E^--1F_--20 --21!--22"--2'\
'3#--24$--25%--26\&--27'\''--28(--29)--2A*--2B+--2C,--2D---2 E.--2F
\/--300'\
'--311--322--333--344--355--366--377--388--399--3A:--3B;--3C<--3D=--3E>--'\
'3F?--40@--41A--42B--43C--44D--45E--46F--47G--48H--49I--4AJ- -4BK--4CL--4D'\
'M--4EN--4FO--50P--51Q--52R--53S--54T--55U--56V--57W--58X--5 9Y--5AZ--5B[-'\
'-5C\
\--5D]--5E^--5F_--60`--61a--62b--63c--64d--65e--66f--67g--68 h--69i--'\
'6Aj--6Bk--6Cl--6Dm--6En--6Fo--70p--71q--72r--73s--74t--75u- -76v--77w--78'\
'x--79y--7Az--7B{--7C|--7D}--7E~/;s/\(..\).*--\1//;s/\(.\).* /
\1/;p;x;bx;:d;
s/.$//;N;s/!..\(.*\)\n\(..\)/!\2\1/;bx;:w;s/.$//;/!00/!bx;
s/\(.*\)#\[\(..\)\(.*\)]\2\(.*\)/\1[\2\3#]\2\4/;bx;:v;s/.$// ;
s/\(.*\)#]\(..\)\(.*\)/\2\1]\2\3/;s/\(..\)\(.*\)\[\1\(.*\)/
\2#[\1\3/;by;' |
xxd -p | sed -e's/\(..\)../\1/g' | xxd -p -r
-Ed
--
(You can't go wrong with psycho-rats.) (http://mi.eng.cam.ac.uk/
~er258)
/d{def}def/f{/Times findfont s scalefont setfont}d/s{11}d/r{roll}d f 2/
m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0
rmoveto}
for /s 12 d f pop 235 420 translate 0 0 moveto 1 2 scale show
showpage
Third time lucky.
am 19.12.2007 20:41:13 von Edward Rosten
On Dec 19, 12:35 pm, Edward Rosten wrote:
My fault, I got my line lengths wrong, and it was being wrapped. Not
at 72 chars:
echo '+++++++[>++++++++++<-]>+++++++.<++++++[>++++<-]>.+++++++++++++..
+++++++.[-]<+++++[>++++++<-]>++.<+++++[>+++++++<-]>.<++++++[>+++++++<
-]>-----.++++++++++.---------.++++++++++.+.-------.<+++[>----<-]>.<++
+[>++++++<-]>.[-]<+++[>+++<-]>+.'|tr -d '[:space:]' | sed -e'
s/.*/00{#&}/;:p;/#\[/bf;/#]/bo;s/#\(.\)\(.*\)/\1#\2/;:e;/#}/ !bp;
s/.*{\(.*\)#}.*/\1/;bi;:f;s/\(..\).*/&\1/;
s/\(..\)\(.*\)#\[\(.*\)/\1\2[\1#\3/; h; s/.\(.\).*/\1/;
y/0123456789ABCDEF/123456789ABCDEF0/; x; G; s/\(.\).\(.*\)\n\(.\)/
\1\'\
'3\2/;/^.0/!be; h; s/\(.\).*/\1/; y/0123456789ABCDEF/
123456789ABCDEF0/;
x;G;s/^.\(.*\)\n\(.\)/\2\1/;be;:o;s/^\(.*\)#]\(.*\)\(..\)/\1 ]\3#
\2/;be;
:i;s/.*/#&@!00%/;:m;s/.*#\(.\).*/&\1/;/+$/ba;/-$/bs;/>$/br;/<$/bl;/
\.'\
'$/bt;/,$/bd; /\[$/bw; /]$/bv; :x; s/#\(.\)\(.*\)/\1#\2/;
/[][]#[A-Z0-9][A-Z0-9]/s/#\(..\)\(.*\)/\1#\2/;: y;/#@/!bm;s/.*//;q;:a;
s/.$//; s/.*!\(..\).*/&\1/; h; s/.*\(.\)/\1/;
y/0123456789ABCDEF/123456789ABCDEF0/; x; G; s/.\n\(.\)/\1/; /0$/!bn;
h;
s/.*\(.\)./\1/; y/0123456789ABCDEF/123456789ABCDEF0/; x; G;
s/.\(.\)\n\(.\)/\2\1/; :n; s/!..\(.*\)%\(..\)/!\2\1%/; bx; :s; s/.$//;
s/.*!\(..\).*/&\1/;h;s/.*\(.\)/\1/;y/
123456789ABCDEF0/0123456789ABCDEF/;
x; G; s/.\n\(.\)/\1/; /F$/!bb; h; s/.*\(.\)./\1/;
y/123456789ABCDEF0/0123456789ABCDEF/; x; G; s/.\(.\)\n\(.\)/\2\1/; :b;
s/!..\(.*\)%\(..\)/!\2\1%/; bx; :r; s/.$//; /!..%/s/%/00%/;
s/!\(..\)\(.*\)/\1!\2/;bx;:l;s/.$//;/@!/s/@/@00/;s/\(..\)!\( .*\)/!
\1\2/;
bx; :t; s/.$//; h; s/.*!\(..\).*/\1/;
s/.*/&--01A02B03C04D05E06F07G08H09 --0A\
--0BK0CL0DM0EN0FO10P11Q12R13S14T15U16V--17W18X19Y1AX1B[--1C
\--1D]--1E'\
'^--1F_--20
--21!--22"--2'\3#--24$--25%--26\&--27'\''--28(--29)--2A*-'\
'-2B+--2C,--2D---2E.--2F
\/--300--311--322--333--344--355--366--377--3'\
'88--399--3A:--3B;--3C<--3D=--3E>--3F?--40@--41A--42B--43C--44D--45E-'\
'-46F--47G--48H--49I--4AJ--4BK--4CL--4DM--4EN--4FO--50P--51Q --52R--53'\
'S--54T--55U--56V--57W--58X--59Y--5AZ--5B[--5C\
\--5D]--5E^--5F_--60`-'\
'-61a--62b--63c--64d--65e--66f--67g--68h--69i--6Aj--6Bk--6Cl --6Dm--6E'\
'n--6Fo--70p--71q--72r--73s--74t--75u--76v--77w--78x--79y--7 Az--7B{--'\
'7C|--7D}--7E~/;s/\(..\).*--\1//;s/\(.\).*/\1/;p;x;bx;:d;s/.
$//;N;s/!'\
'..\(.*\)\n\(..\)/!\2\1/;bx;:w;s/.$//;/!00/!bx;s/\(.*\)#\[\( ..\)\(.*
\'\
')]\2\(.*\)/\1[\2\3#]\2\4/;bx;:v;s/.$//;s/\(.*\)#]\(..\)\(.* \)/
\2\1]\'\
'2\3/;s/\(..\)\(.*\)\[\1\(.*\)/\2#[\1\3/;by;' | xxd -p |
sed -e's/\(..\)../\1/g' | xxd -p -r
-Ed
----
(You can't go wrong with psycho-rats.) (http://mi.eng.cam.ac.uk/
~er258)
/d{def}def/f{/Times findfont s scalefont setfont}d/s{11}d/r{roll}d f 2/
m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0
rmoveto}
for /s 12 d f pop 235 420 translate 0 0 moveto 1 2 scale show
showpage
Its nearly Christmas
am 19.12.2007 22:11:44 von grant
Can someone suggest a good -
possible to type a simple message> Christmas message via a command
line script ?
Re: Its nearly Christmas
am 20.12.2007 01:59:16 von Edward Rosten
On Dec 19, 2:11 pm, Grant wrote:
> Can someone suggest a good -
> possible to type a simple message> Christmas message via a command
> line script ?
OK, this is getting really quite annoying. Google gorups insists on
wrapping my lines at less than 72 chars in many cases, and so I've
tried encoding the file so that the group can see it. Unfortunately,
some NNTP server keeps on blocking my message, because it thinks it is
binary. Maybe that's because of the huge blob of characters below.
Well, anyway, take the block of characters and put them in a file.
xxd -d -r file | zcat > newfile
should give you the script which I tried to post before. Either that
or you can just take the code below and paste it in to a shell.
echo '
1f8b08008f 7469470203 95966b5bdb 3618863fcf bfc25e0017 a82cc9c7d8
caba384e42 bbb6f4bcd2 da66232414 360a694221 19b0dfbe47 f2a149e0ba
d6fac32de9 b5f41e25cb a3c3e373dd dc2e9ef4d1 76fdb4485e 8dacd6e26b
f9c2da5e7c 2c4bab7a29 c95b4baa0a 35d6b2b0d0 d15a31dad2 2025f25950
6f91ea5914 d662a52455 ab2a9dda92 edca232553 ce58e6cdc5 442743dd4c
a3e9f8e070 14e5a67ea3 4f47439d8c 4c6d4aad2d cad87563e3 968a682c68
234be9e008 6d4e07e762 8af1032bdb 04b6b24d9a f1466663de 08ef6fa931
180ba5e0ba 78ddb885ae 8c53313811 d111d6428c b5106e48a9 5609cad959
5a6bcdec54 aa76a8d08f 850e95ca68 a94d9b53c6 6dc7f5fca0 19c69da4db
ebd39531c3 c299d077e4 da6269a13a 3b532369c1 cc34d391ce d37d8bc1f5
51696ad192 fe5d96b499 d84170fbab 366c15fa48 44326dfb65 9079394905
0e2379e6a8 14629e169d 0895fec646 db606c1d79 fdac048dca 279536babd
4607078212 3453411fa1 9908da4273 2a6866c9b8 d0bf10f421 9aa1d06996
a273854e8e f652e8d14c c6795f1d35 9ae669de48 63f2919130 af5a5accbe
5b767d8eba b791bcc24f 4ac517111d a83db08681 2cdc96b15c f4b29e5b55
1d7eb89cd6 b71a424ad9 1acc9f49b5 5aadd6fa81 e2157ab56a 8b2d174f8f
cea449c32a 4bbb5e96cd 90af511f7d 80d5d154b9 2503d6ee09 f8582c873b
bfebc41d37 e596ba37da be8c76b09c 44abcae277 e85dc8e27d d10e6404ff
13eda48e56 9753d7b139 d6a9daad72 edca3631d4 d69e89e854 948b68dbc0
8a366d3324 bffa0018e5 02439e7c28 52862ebe19 3a5edd4ae5 e743e69810
c663667798 9330b7cbbc 1ef3fb2cd8 61cdc72cfc 092fe34c03 3b4f59f28c
759fb3de2e ebbfe0ec25 e7afb8fd9a 3b6fb8fb96 7befb8ff3b 213c78cf9b
7b3cfcc0e3 3dde492148 32a09b033d 79aef6d1e9 ff4188cd74 801b80fd33
60e210a371 d7006f1df0 33f8650766 669a689b0f 80701388b7 88d443ecce
3646c943a0 8b6fb7ddc3 07ddee6794 1087318073 c0b601c701 5c17f03cc0
f7812000a4 9e66139d30 04e208e808 206901dd5f 801eee05a7 ff2b212e6b
033c06ec0e e024800bc3 aed72bfc71 fd3e46c10e d07c0c844f 80f837a0f3
14489e01dd e7406f17e8 bf20c4632f 01fe0ab05f 03ca9f37e8 b86f01ef1d
2053ea05ef 81e61e107e 00e28f804c ad9764c8ad 2773ebf590 574fe6d567
7f16fef8fc 00237b0038 87803b04bc 11e01f01c1 27a0790c84 2740fc17d0
f91b484e81 ee6740d5eb 0c9dfe3921 011b03fc0b 604f00670a b81780f715
f02f81e00a 68ce80700e c4ff009d6b a2fc09921b 8cbab740ef 5fba709111
829d580aea 8d391633b5 e787d59edf 45c7907aac c52ba23e5a c509b9aa4f
08befd38e5 b3426b7d31 56c74aead9 ccb1ae3a63 29fa4e434a dc42d365a5
a956902f1f 4b5b5e3b52 8f2d6fd8e5 5b18b6783d af21079832 980bf98f30
9be11f618c 8e56fe2dd4 8950dfa04f 0b73c844fb 0f131e0b7 45b090000'|
tr -d [:space:] | xxd -p -r | zcat | bash
Of course that's not quite so interesting and it involves running
arbitray and quite clearly obfuscated code from some random guy (me)
on
the internet which is generally considered a bad idea. If you examine
the contents after the zcat you will see that the script contains
echo,
tr, xxd and sed, which can't do too much damage between them. So now
I've written a lof of waffly, useless filler in the hope that the
filter
will not think that I'm posting a binary message because there is more
or at least a comparable amount of normal text compared to the binary
data.
-Ed
--
(You can't go wrong with psycho-rats.) (http://mi.eng.cam.ac.uk/
~er258)
/d{def}def/f{/Times findfont s scalefont setfont}d/s{11}d/r{roll}d f 2/
m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0
rmoveto}
Re: Its nearly Christmas
am 20.12.2007 02:12:46 von DM McGowan II
On Wed, 19 Dec 2007 16:59:16 -0800, Edward Rosten wrote:
> OK, this is getting really quite annoying. Google gorups insists on
> wrapping my lines at less than 72 chars in many cases, and so I've tried
> encoding the file so that the group can see it. Unfortunately, some NNTP
> server keeps on blocking my message, because it thinks it is binary.
It might have been easier to simply split the longer lines with
continuation / characters.
--
Climate Change may be raising the sea levels, but the gene pool
seems to be drying up.
Re: Its nearly Christmas
am 20.12.2007 06:15:38 von Edward Rosten
On Dec 19, 6:12 pm, DaveG wrote:
> On Wed, 19 Dec 2007 16:59:16 -0800, Edward Rosten wrote:
> > OK, this is getting really quite annoying. Google gorups insists on
> > wrapping my lines at less than 72 chars in many cases, and so I've tried
> > encoding the file so that the group can see it. Unfortunately, some NNTP
> > server keeps on blocking my message, because it thinks it is binary.
>
> It might have been easier to simply split the longer lines with
> continuation / characters.
That's true. I don't know what width google wraps at. It is less than
72. In the ned, I just got bored and posted the compressed hexdumped
version. As a bonus, it increases the number of commands, just as the
original poster wanted.
-Ed
--
(You can't go wrong with psycho-rats.)(http://mi.eng.cam.ac.uk/~er258)
/d{def}def/f{/Times s selectfont}d/s{11}d/r{roll}d f 2/m{moveto}d -1 r
230 350 m 0 1 179{1 index show 88 rotate 4 mul 0 rmoveto}for/s 12 d f
pop 235 420 translate 0 0 moveto 1 2 scale show showpage