Post.py

A post-installation script written in Python for Debian systems.

I wrote this script to ease the pain of setting up my operating system each time I format my drive and re-install my operating system.

Some of the tools I am installing you probably won’t need, remember this is a script I wrote to ease MY pain. Feel free to modify the script to fit your needs. I highly recommend leaving the security portion as I have automated the steps for installing the Bitmask client, a process that is difficult for new users.

You can copy and paste into a text file in your home folder and make it executable.

Open your the terminal and enter

 chmod +x ./post.py 

Then run it.

 ./post.py 

- Don’t forget to add bitmask to your start-up applications!

import subprocess
import os

# Run Updates & Upgrades

def Mackeral():
    ##Run initial updates
    subprocess.call('sudo apt-get update', shell=True)
    ## GIMP
    subprocess.call('sudo apt-get install gimp -y', shell=True)
    ## LibreOffice
    subprocess.call('sudo apt-get install libreoffice -y', shell=True)
    ## Icedove
    subprocess.call('sudo apt-get install icedove -y', shell=True)
    ## VLC
    subprocess.call('sudo apt-get install vlc -y', shell=True)
    ## Geany
    subprocess.call('sudo apt-get install geany -y', shell=True)
    ## Gparted
    subprocess.call('sudo apt-get install gparted -y',shell=True) 
    ## Unetbootin
    subprocess.call('sudo apt-get install unetbootin -y', shell=True)
    ## Terminator
    subprocess.call('sudo apt-get install terminator -y,', shell=True)
    ## Security
    ## GUFW
    subprocess.call('sudo apt-get install gufw -y', shell=True)
    ## enable the firewall
    subprocess.call('ufw enable', shell=True)
    ## Bitmask
    ## add repository to apt sources
    with open('/etc/apt/sources.list.d/bitmask.list', 'w') as f:
        f.write('deb http://deb.bitmask.net/debian wheezy main')
    # get apt keys
    subprocess.call('sudo wget -O- https://dl.bitmask.net/apt.key | apt-key add -', shell=True)
    # get update
    subprocess.call('sudo apt-get update', shell=True)
    # install bitmask
    subprocess.call('sudo apt-get install bitmask leap-keyring -y', shell=True)
    ## Keepassx
    subprocess.call('sudo apt-get install keepassx -y', shell=True)
    ## Metadata Anonymization Tool
    subprocess.call('sudo apt-get install mat -y', shell=True)
    ## Now run update
    subprocess.call('sudo apt-get update', shell=True)
    ## And upgrade (but not dist-upgrade)
    subprocess.call('sudo apt-get upgrade -y', shell=True)
    ## That's it!
    print "That seeemed to have worked!"
    
    
    


Mackeral()



def main():
    return 0

if __name__ == '__main__':
    main()