Skip to content

Instantly share code, notes, and snippets.

View arahayrabedian's full-sized avatar

Ara Hayrabedian arahayrabedian

View GitHub Profile
@arahayrabedian
arahayrabedian / setup_dockercompose_ubuntu_x86-64.sh
Last active July 16, 2023 08:18
Get docker-compose (plus docker) set up and ready to go on a fresh ubuntu machine. I've done this far too often manually to test simple things on a fresh machine, so yeah. scriptify!
#!/bin/sh
# follows my interpretation of the set up guide available at
# https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository
# assumes ubuntu 16-ish and above.
set -e
# update
sudo apt-get update -y
alias gs="git status"
alias dc="docker-compose"
alias clearpyc="find . -name \"*.pyc\" -exec rm -rf {} \;"
alias cleandockerimages='docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}")'
alias flushdns="sudo kill -HUP $(pgrep dnsmasq)"
# not sure if the latter works - see jpetazzo/squid-in-a-can for details
alias squidinacan="docker run -v ~/.squidinacan/:/var/squid3/cache -d --net host jpetazzo/squid-in-a-can && sudo iptables -t nat -A PREROUTING -p tcp --dpo$
alias killsquidinacan="sudo iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to 3129 -w"