eval `docker-machine env your-vm`docker rmi $(docker images | grep "^<none>" | awk '{print $3}' | tr '\n' ' ')| # Call virtualenvwrapper's "workon" if .venv exists. This is modified from-- | |
| # http://justinlilly.com/python/virtualenv_wrapper_helper.html | |
| # and https://gist.github.com/cjerdonek/7583644 | |
| has_virtualenv() { | |
| if [ -e .venv ]; then | |
| ENV_NAME=`cat .venv` | |
| workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME" | |
| elif [ $CD_VIRTUAL_ENV ]; then | |
| deactivate && unset CD_VIRTUAL_ENV | |
| fi |
| # Put into .bashrc, source .bashrc, (max. 1000 requests per day) | |
| # Example: | |
| # $ ip2geo 8.8.8.8 | |
| # { | |
| # "ip": "8.8.8.8", | |
| # "hostname": "google-public-dns-a.google.com", | |
| # "city": "Mountain View", | |
| # "region": "California", | |
| # "country": "US", | |
| # "loc": "37.3860,-122.0838", |
| #!/bin/bash -e | |
| # To unset cluster config in ~/.kube/config | |
| if [ -z "$1" ] | |
| then | |
| echo "Usage: unset-kube-cluster.sh [cluster-name]" | |
| exit | |
| fi | |
| cluster_name=$1 |
| #!/bin/bash | |
| # Install docker | |
| apt-get update | |
| apt-get install -y apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| add-apt-repository \ | |
| "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
| $(lsb_release -cs) \ | |
| stable" | |
| apt-get update |
I hereby claim:
To claim this, I am signing this object:
| version: '3' | |
| services: | |
| app: | |
| image: ghost:alpine | |
| ports: | |
| - 8080:2368 | |
| volumes: | |
| - ./blog/content:/var/lib/ghost/content |
$ sudo netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
find . -name "*staging*" | xargs -I % sh -c 'find % -name log -mtime +30 -exec truncate -s 0 {} \;'
Reference: http://www.vionblog.com/linux-delete-files-older-than-x-days/