Skip to content

Instantly share code, notes, and snippets.

View transcranial's full-sized avatar

Leon Chen transcranial

View GitHub Profile

Keybase proof

I hereby claim:

  • I am transcranial on github.
  • I am transcranial (https://keybase.io/transcranial) on keybase.
  • I have a public key ASBDcvkHbpfmq_4YYNZ7nh6Gf8vxVo9FWeDYBeuN7edTvAo

To claim this, I am signing this object:

@transcranial
transcranial / gist:dbbaf9cf370ea7eff9f6
Created December 21, 2015 00:56
redirecting ports to 80/443
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
# also add above minus sudo to /etc/rc.local
@transcranial
transcranial / gist:f7b0205175dca6d56377
Created April 15, 2015 21:41
Git SSH within Docker
RUN mkdir -p /root/.ssh
ADD /path/to/id_rsa /root/.ssh/id_rsa
RUN chmod 600 /root/.ssh/id_rsa
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
RUN git clone git@github.com:ORG/REPO.git /var/path/to/repo
@transcranial
transcranial / gist:be0f8f0d80e464f4032e
Last active May 18, 2020 11:11
Remove old unused docker containers and images
#!/usr/bin/env bash
# remove old unused docker containers
docker rm $(docker ps -a | grep -v latest | grep -v CONTAINER | awk '{print $1}')
# remove old unused docker images
docker rmi $(docker images -a | grep '<none>' | awk '{print $3}')
# Delete all stopped containers
docker rm $(docker ps -a -q)