« first day (135 days earlier)      last day (4889 days later) » 

11:23 PM
gimmeh-teh-code is a tag???
ok no. Good.
 
bah, I wanted to make, as a code golf, a password generator in Python for tweeting purposes.
I didn't think Python would make it that easy though.
Now I'm 34 chars short from a full tweet. A waste not to use them.
 
what do you have so far?
 
import string as s,random;print ''.join(random.choice(s.letters+s.digits+s.punctuation)for x in range(16))
see? too short, it's a waste! :P
random.sample(s.letters+s.digits+s.punctuation,16) would only be marginally shorter and reduce entropy.
using the as s trick on random saves 0 chars.
 
0 chars? oh because of spaces ...
 
so I tried and made
echo -e "#!/usr/bin/python\nimport string as s,random;print ''.join(random.choice(s.letters+s.digits+s.punctuation)for x in range(16))">pw;chmod +x pw
that's 9 too long :(
 
11:37 PM
check me:
echo -e "#!/usr/bin/python\nimport string as s,random as r;print ''.join(r.sample(s.letters+s.digits+s.punctuation,16)">pw;chmod +x pw;./pw
 
again, random as r doesn't actually save anything :)
 
whatever
that particular post is 139 characters long
 
and I'd have preferred not using random.sample as I said, but it's okay I guess :)
 
and it should execute the file as well
right?
 
well I guess you get to tweet it now :)
 
11:39 PM
echo -e "#!/usr/bin/python\nimport string as s,random as r;print ''.join(r.sample(s.letters+s.digits+s.punctuation,16)">pw;
chmod +x pw;
./pw
oh I don't care, I was helping you figure it out mate
you post it
 
obviously bash gagged when it saw that exclamation point
 
I wouldn't doubt it
 
Hello
 
can you escape it with a \ ?
 
yeah, it worked, there's something wrong though
 
11:41 PM
holy crap stupid markdown, one day you hate spaces, the next you like 'em
did I?
so you need to escape?
crap
 
badp@delta:~/Desktop$ echo -e "#\!/usr/bin/python\nimport string as s,random as r;print ''.join(r.sample(s.letters+s.digits+s.punctuation,16))">pw;chmod +x pw;./pw
./pw: line 2: syntax error near unexpected token `('
./pw: line 2: `import string as s,random as r;print ''.join(r.sample(s.letters+s.digits+s.punctuation,16))'
 
anyways, adding the ) gives you 140
if you need to escape the bang then ...
 
badp@delta:~/Desktop$ cat pw
#\!/usr/bin/python
import string as s,random as r;print ''.join(r.sample(s.letters+s.digits+s.punctuation,16))
rages
 
lmao
try -E
but that shouldn't matter either
 
11:43 PM
badp@delta:~/Desktop$ echo -e "#\x21/usr/bin/python\nimport string as s,random as r;print ''.join(r.sample(s.letters+s.digits+s.punctuation,16))">pw;chmod +x pw;./pw
yp=]ZWA@eVN2D^,~
 
gonna have to do a cat aren't you?
 
looks like there's another Google CR-48 laptop headed for my zip code... maybe mine :)
 
@radp too long by 3
 
by 1
 
echofon says by 3 ???
 
11:44 PM
In [1]: len("""echo -e "#\x21/usr/bin/python\nimport string as s,random as r;print ''.join(r.sample(s.letters+s.digits+s.punctuation,16))">pw;chmod +x pw;./pw")""")
Out[2]: 141
:|
 
is it consuming the \n?
In [1]: len("""echo -e "#\x21/usr/bin/pythonaaimport string as s,random as r;print
''.join(r.sample(s.letters+s.digits+s.punctuation,16))">pw;chmod +x pw;./pw")""")
what does that give?
try this: echo -e $"#!/usr/bin/python\nimport string as s,random as r;print \'\'.join(r.sample(s.letters+s.digits+s.punctuation,16))">p;chmod +x p;./p (I don't have a unixy box handy)
 
I gotta make sure to use my laptop tomorrow.. Chrome 4 Cause :)
 

« first day (135 days earlier)      last day (4889 days later) »