Skip to content

Instantly share code, notes, and snippets.

@berezovskyi
Created January 7, 2014 16:15
Show Gist options
  • Save berezovskyi/8301728 to your computer and use it in GitHub Desktop.
Save berezovskyi/8301728 to your computer and use it in GitHub Desktop.
Will output contents of a file installing all the packages previously installed by hand.
#!/usr/bin/env bash
echo -e '#!/usr/bin/env bash\n'
echo -n 'sudo apt-get install -y '
gzip -dc /var/log/apt/history.log*.gz | tee -a /var/log/apt/history.log | grep "Commandline: apt-get install" | sed 's/Commandline: apt-get install -y --force-yes//' |sed 's/Commandline: apt-get install -y//' | sed 's/Commandline: apt-get install//' | xargs echo $1
@berezovskyi
Copy link
Author

Sample output:

#!/usr/bin/env bash

sudo apt-get install -y nginx uwsgi uwsgi-plugin-python supervisor nmon php5-fpm subversion tree make xsltproc po4a mc python-mysqldb python-markdown php5-curl libapache2-mod-rpaf unzip daemontools openjdk-7-jdk build-essential python-dev uwsgi-plugin-python git libjpeg-dev jp2a python-scipy ipython sysstat openvpn nginx-full uwsgi-plugin-python python-pip memcached gcc le xclip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment