Last active
January 28, 2016 16:46
-
-
Save yogendra/4458d45aa1fe1017e2e7 to your computer and use it in GitHub Desktop.
Vagrant scripts
This file contains hidden or 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
$(docker ps -a -q -f status=exited) | xargs -r docker rm -v | |
docker rm -v $(docker ps -a -q -f status=exited) | |
docker rmi $(docker images -f "dangling=true" -q) | |
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes |
This file contains hidden or 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
echo 'DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"' >> /etc/default/docker | |
restart docker |
This file contains hidden or 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
geoip=`curl -s 'http://freegeoip.net/csv/' ` | |
country=`echo $geoip | awk -F, '{ print tolower($2) }'` | |
ip=`echo $geoip | awk -F, '{print $1}'` | |
release=`lsb_release -sc` | |
file="/etc/apt/sources.list" | |
old_file="/etc/apt/sources.list.$(date '+%Y%m%d%H%M%S')" | |
cp -f $file $old_file | |
printf "## Ubuntu Main Repos for $ip | |
deb http://$country.archive.ubuntu.com/ubuntu/ $release main restricted universe multiverse | |
deb-src http://$country.archive.ubuntu.com/ubuntu/ $release main restricted universe multiverse | |
## Ubuntu Update Repos for $ip | |
deb http://$country.archive.ubuntu.com/ubuntu/ $release-security main restricted universe multiverse | |
deb http://$country.archive.ubuntu.com/ubuntu/ $release-updates main restricted universe multiverse | |
deb-src http://$country.archive.ubuntu.com/ubuntu/ $release-security main restricted universe multiverse | |
deb-src http://$country.archive.ubuntu.com/ubuntu/ $release-updates main restricted universe multiverse | |
" > $file |
This file contains hidden or 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
apt-get update | |
apt-get dist-upgrade -u -y -qq | |
apt-get install -qq -y avahi-daemon | |
apt-get autoremove --purge -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment