Skip to content

Instantly share code, notes, and snippets.

Avatar
😃
Enjoy Coding

Hongmeng Wang hongmengwang

😃
Enjoy Coding
View GitHub Profile
@hongmengwang
hongmengwang / my.sublime3
Last active Dec 17, 2021 — forked from tucq88/Sublime Text 3 | Eclipse - Shortcuts
macOS Eclipse shortcuts key bindings for Sublime Text 3
View my.sublime3
[
{ "keys": ["super+shift+w"], "command": "close_all" },
{ "keys": ["super+shift+s"], "command": "save_all" },
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
{ "keys": ["super+alt+j"], "command": "join_lines" },
{ "keys": ["super+alt+down"], "command": "duplicate_line" },
{ "keys": ["shift+super+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
View defauly.yaml
apiVersion: install.istio.io/v1alpha2
kind: IstioControlPlane
spec:
hub: docker.io/istio
tag: 1.4.3
defaultNamespace: istio-system
# Traffic management feature
trafficManagement:
enabled: true
View values.yaml
image:
# This chart is compatible with different images, please choose one
repository: datadog/agent # Agent6
# repository: datadog/dogstatsd # Standalone DogStatsD6
tag: latest # Use 6.3.2-jmx to enable jmx fetch collection
pullPolicy: Always
## It is possible to specify docker registry credentials
## See https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
# pullSecrets:
# - name: regsecret
View install_mesos_marathon_zookeeper.md

Compute Engine: n1-standard-1 (1 vCPU, 3.75 GB, Intel Ivy Bridge, asia-east1-a region)

OS: CentOS 7

  • 10.140.0.1 master
  • 10.140.0.2 slave1
  • 10.140.0.3 slave2
  • 10.140.0.4 slave3

Prepare

@hongmengwang
hongmengwang / docker-cleanup-resources.md
Created Jan 24, 2018 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@hongmengwang
hongmengwang / blog-compose.yml
Created Jan 22, 2018
Deploy apps with docker swarm
View blog-compose.yml
version: "3"
services:
mysql:
image: "mysql:5.7"
environment:
MYSQL_ROOT_PASSWORD: "xxx"
MYSQL_DATABASE: "xxx"
MYSQL_USER: "xxx"
MYSQL_PASSWORD: "xxx"
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
@hongmengwang
hongmengwang / proxy_aliyun_to_aws.md
Created Jan 22, 2018
proxy Aliyun's domain to AWS's server
View proxy_aliyun_to_aws.md

I registed my domain "wanghongmeng.com" on Aliyun, and applied free EC2 server for one year on AWS.

After building my blog on AWS, I set A parse to the server's IP of AWS.

But yesterday I received email from Aliyun which said that my server was not in Aliyun after they checking, it was not allowed, I have to miggrate my blog server to Aliyun, otherwise they will undo my authority number.

After thinking about this, for saving money(Aliyun is not free for one year), I solved it by the way below:

1.Set A parse to my friend's server ip which was bought in Aliyun.
@hongmengwang
hongmengwang / add_host_check.md
Last active Mar 18, 2018
prevent web site being mirrored
View add_host_check.md

I thought something before, when I check nginx's log, I found a wired hostname.

After checking, I think out website was mirrored.

I think they parsed their domain by CNAME to our domain, and we don't do any host check at that time.

To prevent being mirrored again, I add host check configuration in nginx.conf

set $flag 0;
@hongmengwang
hongmengwang / replace_yum_on_centos6.md
Created Jan 22, 2018
replace yum repository on redhat6
View replace_yum_on_centos6.md

1. delete yum repo on redhat6

rpm -aq | grep yum|xargs rpm -e --nodeps

2. download centos's rpm packages

wget http://mirror.centos.org/centos/6.0/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirror.centos.org/centos/6.0/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirror.centos.org/centos/6.0/os/i386/Packages/yum-3.2.29-69.el6.centos.noarch.rpm
wget http://mirror.centos.org/centos/6.0/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
@hongmengwang
hongmengwang / blog-todo.md
Last active Mar 18, 2018
test task to do
View blog-todo.md

Task list of Hongmeng Wang blog

  • Apply domain
  • Apply server
  • Apply https certificate
  • Build blog with docker-compose/wordpress
  • Write post
  • Continous