-
使用 env 命令来查看 web 容器的环境变量
$ sudo docker run --rm --link redis-test:redis redis env
-
连接名为redis-test的redis container
sudo docker run -it --link redis-test:xxx --rm redis sh -c 'exec redis-cli -h "$XXX_PORT_6379_TCP_ADDR" -p "$XXX_PORT_6379_TCP_PORT"'
-
启动activeMQ
sudo docker run -d -P --name activemq-test -e 'ACTIVEMQ_MIN_MEMORY=128' -e 'ACTIVEMQ_MAX_MEMORY=512' webcenter/activemq
-
进入正在运行的docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./command -yes -no /home/username | |
$# = 3 | |
$* = -yes -no /home/username | |
$@ = array: {"-yes", "-no", "/home/username"} | |
$0 = ./command, $1 = -yes etc. | |
chkconfig --list #列出所有的系统服务 | |
chkconfig --add httpd #增加httpd服务 | |
chkconfig --del httpd #删除httpd服务 | |
chkconfig --level httpd 2345 on #设置httpd在运行级别为2、3、4、5的情况下都是on(开启)的状态 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
__author__ = 'lhcpig' | |
import sys | |
import os | |
gitDir = "/home/git/repositories/test.git" | |
deployLogPath = "/home/lhcpig/deploy.log" | |
tomcatPath = "/this/is/tomcat" | |
workTree = "/home/lhcpig/projectName" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Firefox over VNC | |
# | |
# VERSION 0.1 | |
# DOCKER-VERSION 0.2 | |
from ubuntu:12.04 | |
# make sure the package repository is up to date | |
run echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
run apt-get update |
show variables like'character_set_%';
查看编码set names utf8;
设置编码load data infile "/answer" into table test1 fields terminated by '|';
mysql导入数据update a join b on a.id = b.id set a.columnToUpdate = [something];
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String[] getNullPropertyNames (Object source) { | |
final BeanWrapper src = new BeanWrapperImpl(source); | |
java.beans.PropertyDescriptor[] pds = src.getPropertyDescriptors(); | |
Set<String> emptyNames = new HashSet<String>(); | |
for(java.beans.PropertyDescriptor pd : pds) { | |
Object srcValue = src.getPropertyValue(pd.getName()); | |
if (srcValue == null) emptyNames.add(pd.getName()); | |
} | |
String[] result = new String[emptyNames.size()]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
nohup /usr/bin/java -jar $1 >> $2 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://www.python.org/ftp/python/3.5.0/Python-3.5.0.tar.bz2 -O /var/tmp/Python-3.5.0.tar.bz2 | |
bzip2 -cd /var/tmp/Python-3.5.0.tar.bz2 | tar xvf - | |
cd /var/tmp/Python-3.5.0 | |
./configure | |
yum groupinstall "Development tools" | |
yum install openssl-devel | |
make && make install | |
/usr/local/bin/python3 --version | |
ln -s /usr/local/bin/python3 /usr/bin/python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Beyond Compare 4 | |
Licensed to: ASIO Allsoftinone | |
Quantity: 1 user | |
Serial number: 1822-9597 | |
License type: Pro Edition for Windows | |
--- BEGIN LICENSE KEY --- | |
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ | |
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja | |
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t |