Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install the latest static tmate and start a session
TMATE_FILE=$($(command -v python3 || command -v python) <<EOC
import requests
r = requests.get(
'https://api.github.com/repos/tmate-io/tmate/releases/latest'
)
releases = r.json()
amd64_releases = [
i for i in releases['assets']
if 'amd64' in i['name'] and not 'dbg' in i['name']
][0]
r = requests.get(amd64_releases['browser_download_url'], allow_redirects=True)
with open(amd64_releases['name'], 'wb') as f:
f.write(r.content)
print(amd64_releases['name'])
EOC
)
tar xf ${TMATE_FILE}
sudo cp $(basename -s '.tar.xz' ${TMATE_FILE})/tmate /usr/local/bin/
echo "tmate-io has been installed. To use tmate, execute the tmate command normally."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment