Created
July 8, 2017 02:05
-
-
Save jepler/f86255a6e054d9b6ca540d0c7afe136b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import tarfile | |
script = '''\ | |
#!/bin/sh | |
exec sh -c 'dd bs=512 skip=1 if="$0" | tar xvf -' "$0" | |
''' | |
t = tarfile.TarInfo(name=script) | |
t.type = 'g' | |
sys.stdout.write(t.tobuf()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment