Skip to content

Instantly share code, notes, and snippets.

@gregohardy
Last active October 8, 2016 09:24
Show Gist options
  • Save gregohardy/0b241c380de063b29225caebb6801a10 to your computer and use it in GitHub Desktop.
Save gregohardy/0b241c380de063b29225caebb6801a10 to your computer and use it in GitHub Desktop.
gzip => base64 encoding of long strings => decode => gunzip
#!/bin/bash
BAR=$(printf '#!/bin/bash\ntouch /tmp/ididit\necho \"root:changeme2016\" | chpasswd"' | gzip | openssl base64 -A)
echo $BAR | python -m base64 -d | gunzip
#!/bin/bash
FOO=$(echo '#!/bin/bash\ntouch /tmp/ididit echo\n\"root:changeme2016\" | chpasswd"' | gzip | base64 -w0)
echo $FOO | base64 -d | gunzip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment