start new:
tmux
start new with session name:
tmux new -s myname
| nsqlookup: | |
| image: nsqio/nsq | |
| hostname: nsqlookup | |
| ports: | |
| - "4160:4160" | |
| - "4161:4161" | |
| command: /nsqlookupd | |
| nsq: |
| git init # 初始化本地git仓库(创建新仓库) | |
| git config --global user.name "xxx" # 配置用户名 | |
| git config --global user.email "[email protected]" # 配置邮件 | |
| git config --global color.ui true # git status等命令自动着色 | |
| git config --global color.status auto | |
| git config --global color.diff auto | |
| git config --global color.branch auto | |
| git config --global color.interactive auto | |
| git config --global --unset http.proxy # remove proxy configuration on git | |
| git clone git+ssh://[email protected]/VT.git # clone远程仓库 |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| #!/bin/bash | |
| ### VARIABLES ### \ | |
| [email protected] | |
| SERVER=$(hostname) | |
| MYSQL_CHECK=$(mysql -e "SHOW VARIABLES LIKE '%version%';" || echo 1) | |
| SLAVE_STATUS=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G"|grep -v row) | |
| LAST_ERRNO=$(echo "${SLAVE_STATUS}" | grep "Last_Errno:" | awk '{ print $2 }' ) | |
| SECONDS_BEHIND_MASTER=$(echo "${SLAVE_STATUS}" | grep "Seconds_Behind_Master:" | awk '{ print $2 }' ) | |
| IO_IS_RUNNING=$(echo "${SLAVE_STATUS}" | grep "Slave_IO_Running:" | awk '{ print $2 }' ) |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """launch small http server | |
| """ | |
| import sys | |
| try: | |
| from SimpleHTTPServer import SimpleHTTPRequestHandler | |
| except ImportError: |