Skip to content

Instantly share code, notes, and snippets.

View philipz's full-sized avatar

philipz philipz

View GitHub Profile
@philipz
philipz / gist:7b9490d336d8032247ae
Last active August 29, 2015 14:04
Show Docker images building detail cmd

docker history --no-trunc=true CONTAINER_IMAGE_NAME

@philipz
philipz / gist:8b4e74ed396f99f34b43
Created August 4, 2014 04:24
VI 取代、替换(replace)的使用方法
:s/AAA/BBB
更换当前所在行的第一个AAA为BBB
:s/AAA/BBB/g
更换当前行的所有AAA为BBB
:50,100s/AAA/BBB/g
更换50~100行里所有的AAA为BBB
:%s/AAA/BBB/g
修改当前行及之后全部的AAA为BBB
:1,%s/AAA/BBB/g
更换文件里所有的AAA为BBB
@philipz
philipz / gist:7aa79ecc279c24eb6c67
Last active August 29, 2015 14:05
Ubuntu docker without sudo

Giving non-root access

# Add the docker group if it doesn't already exist.
$ sudo groupadd docker
# Add the connected user "${USER}" to the docker group.
# Change the user name to match your preferred user.
# You may have to logout and log back in again for
# this to take effect.
$ sudo gpasswd -a ${USER} docker

Restart the Docker daemon.

@philipz
philipz / gist:00cf21757516ee0730cd
Last active August 29, 2015 14:05
Mesos on Docker

From https://github.com/redjack/docker-mesos

docker run -d \
-e MESOS_LOG_DIR=/var/log \
-e MESOS_ZK=zk://localhost:2181/mesos \
-p 5050:5050 \
redjack/mesos-master
docker run -d \
-e MESOS_LOG_DIR=/var/log \

-e MESOS_MASTER=zk://172.17.0.2:2181/mesos \

@philipz
philipz / gist:16ba9f451c8b934314d2
Last active August 29, 2015 14:05
Docker Image to Dockerfile script
#!/bin/bash

/usr/bin/docker run -v /var/run/docker.sock:/var/run/docker.sock centurylink/dockerfile-from-image $1 > $2

@philipz
philipz / gist:a99593fd1aa195d577a9
Created August 25, 2014 03:28
About progrium/docker-consul
@philipz
philipz / gist:192e0b2fe1bc65295681
Created August 27, 2014 04:04
Fleetctl submit scaling example

fleetctl submit elasticsearch-discovery@{1,2,3}.service

@philipz
philipz / tmux.md
Created August 27, 2014 04:33 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@philipz
philipz / gist:28fef07d4e74f68a1e24
Last active August 29, 2015 14:05
CoreOS Systemd unit example

From CoreOS Getting Started with systemd

[Unit]
Description=My Advanced Service
After=etcd.service
After=docker.service
 
[Service]
TimeoutStartSec=0

ExecStartPre=-/usr/bin/docker kill apache1