Skip to content

Instantly share code, notes, and snippets.

@sun4lower
sun4lower / FindMy.cnf
Last active March 15, 2018 03:34
Default options are read from the following files in the given order: From https://www.electrictoolbox.com/mysql-my-cnf/
mysql --help | grep "Default options" -A 1
@sun4lower
sun4lower / DockerCli.sh
Created March 6, 2018 15:42
Docker command
# 列举当前本地正在运行的容器
docker container ls
# 列举出所有的容器
docker container ls -a
docker ps -a
# 删除指定ID的Container
docker container rm ContainerID
docker rm ContainerID
@sun4lower
sun4lower / ComposerGlo
Created March 2, 2018 07:56
Composer Installation Globally.
mv composer.phar /usr/local/bin/composer
# 1.Download the installer to the current directory
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# 2.Verify the installer SHA-384
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
# 3.Run the installer
php composer-setup.php
# 4.Remove the installer
php -r "unlink('composer-setup.php');"
@sun4lower
sun4lower / stub_status
Created February 28, 2018 09:04
http_stub_status_module
#http_stub_status_module
location /status {
stub_status;
}
#when we brower /status, the message will show below:
# Active connections: 1
# server accepts handled requests
# 7 7 10
# Reading: 0 Writing: 1 Waiting: 0
@sun4lower
sun4lower / NginxReloadBug
Created February 28, 2018 08:57
nginx: [error] invalid PID number "" in "/var/run/nginx.pid"
pkill -9 nginx
nginx -c /etc/nginx/nginx.conf
nginx -s reload
CREATE USER [IF NOT EXISTS]
user [auth_option] [, user [auth_option]] ...
[REQUIRE {NONE | tls_option [[AND] tls_option] ...}]
[WITH resource_option [resource_option] ...]
[password_option | lock_option] ...
user:
(see Section 6.2.3, “Specifying Account Names”)
auth_option: {
@sun4lower
sun4lower / benchmark-commands.txt
Created September 11, 2017 18:16 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196