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
#!/bin/bash | |
echo -e "\nHost:" | |
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -p 22 ubuntu@$1 \ | |
'uname -a && arch && uptime && sudo touch /home/ubuntu/.hushlogin /root/.hushlogin' | |
echo -e "\nAdding temporary SSH-key for Ubuntu root user..." | |
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -p 22 ubuntu@$1 \ | |
'sudo cat /home/ubuntu/.ssh/authorized_keys | sudo tee /root/.ssh/authorized_keys' | |
echo -e "\nSystem trimming..." |
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
import re | |
with open('5E113D5F383749AEB72703486DD8247B', 'rb') as fp: | |
data = fp.read() | |
filenames = re.findall(rb'\d+\.txt', data) | |
contents = re.findall(rb'(true\|1[^\0]+)', data, re.DOTALL) | |
for name, content in zip(filenames, contents): | |
with open(name.replace(b'.txt', b'.tunic'), 'wb') as fp: |