Skip to content

Instantly share code, notes, and snippets.

@jepler
Created July 8, 2017 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jepler/f86255a6e054d9b6ca540d0c7afe136b to your computer and use it in GitHub Desktop.
Save jepler/f86255a6e054d9b6ca540d0c7afe136b to your computer and use it in GitHub Desktop.
#!/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