Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Laisky committed Nov 18, 2021
1 parent 50667bc commit 1d6d533
Show file tree
Hide file tree
Showing 36 changed files with 107 additions and 110 deletions.
13 changes: 6 additions & 7 deletions docker/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ brew install boot2docker
$ boot2docker init
$ boot2docker start
$ boot2docker shellinit
$ boot2docker ssh "echo $'EXTRA_ARGS=\"--insecure-registry 192.168.1.200:5000\"' | sudo tee -a /var/lib/boot2docker/profile && sudo /etc/init.d/docker restart"
$ boot2docker ssh "echo $'EXTRA_ARGS=\"--insecure-registry 1.1.1.1:5000\"' | sudo tee -a /var/lib/boot2docker/profile && sudo /etc/init.d/docker restart"
```
在 .*shrc 中添加 `eval "$(boot2docker shellinit)”`

Expand All @@ -41,7 +41,7 @@ $ boot2docker ssh "echo $'EXTRA_ARGS=\"--insecure-registry 192.168.1.200:5000\"'

### 配置本地镜像仓库

`/etc/default/docker` 中添加 `DOCKER_OPTS="$DOCKER_OPTS --insecure-registry 192.168.1.200:5000"`
`/etc/default/docker` 中添加 `DOCKER_OPTS="$DOCKER_OPTS --insecure-registry 1.1.1.1:5000"`

### 配置用户组,免得老是打 sudo

Expand All @@ -68,8 +68,8 @@ $ docker-pid <id>
### pull & run

```
$ sudo docker pull 192.168.1.200:5000/qb
$ sudo docker run -i -t -d --name qb 192.168.1.200:5000/qb:latest /bin/bash
$ sudo docker pull 1.1.1.1:5000/qb
$ sudo docker run -i -t -d --name qb 1.1.1.1:5000/qb:latest /bin/bash
$ sudo docker attach qb # 按几下回车
```

Expand All @@ -80,8 +80,8 @@ detach 用 `ctrl+p ctrl+q`
push 前要先改 tag

```
$ sudo docker tag <your_docker_image> 192.168.1.200:5000/<repo_name>:<tag_name>
$ sudo docker push 192.168.1.200:5000/<repo_name>:<tag_name>
$ sudo docker tag <your_docker_image> 1.1.1.1:5000/<repo_name>:<tag_name>
$ sudo docker push 1.1.1.1:5000/<repo_name>:<tag_name>
```

### 常用命令
Expand All @@ -100,4 +100,3 @@ $ sudo docker push 192.168.1.200:5000/<repo_name>:<tag_name>
- `cat <path/to/tar> | sudo docker import - <image_name>` # 导入镜像 tar 包
- export
- `docker export <container_id> > <path/to/tar>` # 导出容器 tar 包

2 changes: 1 addition & 1 deletion docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
docker create -v /tmp:/tmp -v /var/lib/qb:/var/lib/qb --name qb_volume laisky/qb /bin/true

# run qb
docker run -i -t -d --volumes-from qb_volume -p 8000:8000 --add-host "dbhost:173.230.154.73" -e "DBHOST=173.230.154.73" --name qb laisky/qb
docker run -i -t -d --volumes-from qb_volume -p 8000:8000 --add-host "dbhost:1.1.1.1" -e "DBHOST=1.1.1.1" --name qb laisky/qb

# run qb_log
# docker run -i -t --volumes-from qb_volume --name qb_log laisky/qb /bin/bash
2 changes: 1 addition & 1 deletion golang/src/demo/ssl/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ xD7xsZEsYPG8IDIHfH+zEivH7eb8eRbt/Q==
)

const (
addr = "127.0.0.1:24444"
addr = "1.1.1.1:24444"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion golang/src/demo/test_regexp/regexp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BenchmarkRegexp/with_+_unmatched-4 1000000 1430 ns/op 0 B/o
func BenchmarkRegexp(b *testing.B) {
regexp1 := regexp.MustCompile(`^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*`)
regexp2 := regexp.MustCompile(`^((\d{1,3})+\.(\d{1,3})+\.(\d{1,3})+\.(\d{1,3})+).*`)
text1 := `107.21.20.1 - - [07/Dec/2012:18:55:53 -0500] "GET /" 200 2144`
text1 := `1.1.1.1 - - [07/Dec/2012:18:55:53 -0500] "GET /" 200 2144`
text2 := `9.21.2015 non matching text that kind of matches`
b.Run("normal matched", func(b *testing.B) {
for i := 0; i < b.N; i++ {
Expand Down
4 changes: 2 additions & 2 deletions j2se8/APM/docker-compose-czh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ services:
# - 5601:5601
# environment:
# - ELASTICSEARCH_URL=http://elasticsearch:1234/
# # - ELASTICSEARCH_USERNAME=superuser
# # - ELASTICSEARCH_PASSWORD=20180109ElK
# # - ELASTICSEARCH_USERNAME=123
# # - ELASTICSEARCH_PASSWORD=123
# - ELASTICSEARCH_SSL_VERIFY="false"
# - xpack.security.enabled="false"
# depends_on:
Expand Down
8 changes: 4 additions & 4 deletions j2se8/APM/zipkin-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ spring:
# kafka:
# binder:
# autoCreateTopics: false
# brokers: 172.16.6.11,172.16.6.12,172.16.6.13
# zkNodes: 172.16.6.11,172.16.6.12,172.16.6.13
# brokers: 1.1.1.1,1.1.1.1,1.1.1.1
# zkNodes: 1.1.1.1,1.1.1.1,1.1.1.1
# defaultBrokerPort: 9092
# defaultZkPort: 2181
# headers:
Expand All @@ -38,7 +38,7 @@ zipkin:
storage:
type: elasticsearch
elasticsearch:
hosts: ${ES_HOSTS:http://172.16.4.160:8200}
hosts: ${ES_HOSTS:http://1.1.1.1:8200}
index: ${ES_INDEX:zipkin}
index-shards: ${ES_INDEX_SHARDS:2}
index-replicas: ${ES_INDEX_REPLICAS:1}
Expand All @@ -53,6 +53,6 @@ logging:

collector:
kafka:
zookeeper: 172.16.6.11:2181,172.16.6.12:2181,172.16.6.13:2181
zookeeper: 1.1.1.1:2181,1.1.1.1:2181,1.1.1.1:2181
topic: tracingSit
groupId: zipkin
4 changes: 2 additions & 2 deletions j2se8/APM/zipkin-service-2/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ spring:
# kafka:
# binder:
# autoCreateTopics: false
# brokers: 172.16.6.11,172.16.6.12,172.16.6.13
# zkNodes: 172.16.6.11,172.16.6.12,172.16.6.13
# brokers: 1.1.1.1,1.1.1.1,1.1.1.1
# zkNodes: 1.1.1.1,1.1.1.1,1.1.1.1
# defaultBrokerPort: 9092
# defaultZkPort: 2181
# headers:
Expand Down
3 changes: 1 addition & 2 deletions j2se8/APM/zipkin-service-4/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ eureka:
fetchRegistry: true
serviceUrl:
defaultZone: http://eureka:8761/eureka/
# defaultZone: http://172.16.5.22:18761/eureka/

# defaultZone: http://1.1.1.1:18761/eureka/
14 changes: 7 additions & 7 deletions java/APM/docker-compose-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ services:
- TZ=Asia/Shanghai
- reserved_megabytes=256
- "STORAGE_TYPE=elasticsearch"
- "ES_HOSTS=http://172.16.4.160:8200"
- "ES_HOSTS=http://1.1.1.1:8200"
- "ES_INDEX=zipkin"
- "ES_USERNAME=zipkin"
- "ES_PASSWORD=zipkin"
- "ES_USERNAME=123"
- "ES_PASSWORD=123"
- "ES_INDEX_SHARDS=2"
- "LOGGING_PATTERN_CONSOLE=%d{yyyy-MM-dd HH:mm:ss.SSS} | zipkin-server | %p | %t | %C | %L: %m%n"
- "ZIPKIN_LOG_LEVEL=DEBUG"
- "LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_WEB_SERVLET_DISPATCHERSERVLET=DEBUG"
- "LOGGING_LEVEL_ORG_APACHE_KAFKA=debug"
# kafka
- "KAFKA_BOOTSTRAP_SERVERS=172.16.6.11:9092,172.16.6.12:9092,172.16.6.13:9092"
- "KAFKA_BOOTSTRAP_SERVERS=1.1.1.1:9092,1.1.1.1:9092,1.1.1.1:9092"
- "KAFKA_TOPIC=tracingSit"
- "KAFKA_GROUP_ID=zipkin"
- "KAFKA_STREAMS=3"
Expand All @@ -93,10 +93,10 @@ services:
- TZ=Asia/Shanghai
- reserved_megabytes=256
- "STORAGE_TYPE=elasticsearch"
- "ES_HOSTS=http://172.16.4.160:8200"
- "ES_HOSTS=http://1.1.1.1:8200"
- "ES_INDEX=zipkin"
- "ES_USERNAME=zipkin"
- "ES_PASSWORD=zipkin"
- "ES_USERNAME=123"
- "ES_PASSWORD=123"
- "LOGGING_PATTERN_CONSOLE=%d{yyyy-MM-dd HH:mm:ss.SSS} | zipkin-server | %p | %t | %C | %L: %m%n"
- "ZIPKIN_LOG_LEVEL=DEBUG,"
- "LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_WEB_SERVLET_DISPATCHERSERVLET=DEBUG"
Expand Down
4 changes: 2 additions & 2 deletions java/APM/docker-compose-czh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ services:
# - 5601:5601
# environment:
# - ELASTICSEARCH_URL=http://elasticsearch:1234/
# # - ELASTICSEARCH_USERNAME=superuser
# # - ELASTICSEARCH_PASSWORD=20180109ElK
# # - ELASTICSEARCH_USERNAME=123
# # - ELASTICSEARCH_PASSWORD=123
# - ELASTICSEARCH_SSL_VERIFY="false"
# - xpack.security.enabled="false"
# depends_on:
Expand Down
8 changes: 4 additions & 4 deletions java/APM/zipkin-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ spring:
# kafka:
# binder:
# autoCreateTopics: false
# brokers: 172.16.6.11,172.16.6.12,172.16.6.13
# zkNodes: 172.16.6.11,172.16.6.12,172.16.6.13
# brokers: 1.1.1.1,1.1.1.1,1.1.1.1
# zkNodes: 1.1.1.1,1.1.1.1,1.1.1.1
# defaultBrokerPort: 9092
# defaultZkPort: 2181
# headers:
Expand All @@ -38,7 +38,7 @@ zipkin:
storage:
type: elasticsearch
elasticsearch:
hosts: ${ES_HOSTS:http://172.16.4.160:8200}
hosts: ${ES_HOSTS:http://1.1.1.1:8200}
index: ${ES_INDEX:zipkin}
index-shards: ${ES_INDEX_SHARDS:2}
index-replicas: ${ES_INDEX_REPLICAS:1}
Expand All @@ -53,6 +53,6 @@ logging:

collector:
kafka:
zookeeper: 172.16.6.11:2181,172.16.6.12:2181,172.16.6.13:2181
zookeeper: 1.1.1.1:2181,1.1.1.1:2181,1.1.1.1:2181
topic: tracingSit
groupId: zipkin
4 changes: 2 additions & 2 deletions java/APM/zipkin-service-2/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ spring:
# kafka:
# binder:
# autoCreateTopics: false
# brokers: 172.16.6.11,172.16.6.12,172.16.6.13
# zkNodes: 172.16.6.11,172.16.6.12,172.16.6.13
# brokers: 1.1.1.1,1.1.1.1,1.1.1.1
# zkNodes: 1.1.1.1,1.1.1.1,1.1.1.1
# defaultBrokerPort: 9092
# defaultZkPort: 2181
# headers:
Expand Down
3 changes: 1 addition & 2 deletions java/APM/zipkin-service-4/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ eureka:
fetchRegistry: true
serviceUrl:
defaultZone: http://eureka:8761/eureka/
# defaultZone: http://172.16.5.22:18761/eureka/

# defaultZone: http://1.1.1.1:18761/eureka/
4 changes: 2 additions & 2 deletions py2/django/rest/rest/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
'ENGINE': 'django.db.backends.mysql',
'NAME': 'rest',
'USER': 'root',
'PASSWORD': 'devops',
'HOST': '10.32.144.93',
'PASSWORD': '123',
'HOST': '1.1.1.1',
'PORT': '3306',
'CHARSET': 'utf8',
'COLLATION': 'utf8_general_ci',
Expand Down
2 changes: 1 addition & 1 deletion py2/ldap-demo/ldap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"import ldap\n",
"\n",
"\n",
"uri = 'ldap://10.47.12.2260:3268'\n",
"uri = 'ldap://1.1.1.1:3268'\n",
"conn = ldap.initialize(uri)\n",
"# conn.simple_bind_s('darthadmin', '123')\n",
"# conn.simple_bind_s('dds\\\\caizhonghua', '123')"
Expand Down
4 changes: 2 additions & 2 deletions py3/aio_ping_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ async def do_ping(addr):
# ping.close()


# fs = [asyncio.ensure_future(do_ping('172.16.4.85')) for _ in range(100)]
fs = [asyncio.ensure_future(do_ping('127.0.0.1')) for _ in range(500)]
# fs = [asyncio.ensure_future(do_ping('1.1.1.1')) for _ in range(100)]
fs = [asyncio.ensure_future(do_ping('1.1.1.1')) for _ in range(500)]
f = asyncio.wait(fs)


Expand Down
2 changes: 1 addition & 1 deletion py3/aioping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
" print(\"Timed out\")\n",
"\n",
" \n",
"fs = [asyncio.ensure_future(do_ping('127.0.0.1')) for _ in range(5)]\n",
"fs = [asyncio.ensure_future(do_ping('1.1.1.1')) for _ in range(5)]\n",
"f = asyncio.wait(fs)\n",
" \n",
" \n",
Expand Down
4 changes: 2 additions & 2 deletions py3/aioping_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ async def do_ping(host):
print("Timed out")


fs = [asyncio.ensure_future(do_ping('172.16.4.85')) for _ in range(30)]
# fs = [asyncio.ensure_future(do_ping('127.0.0.1')) for _ in range(50)]
fs = [asyncio.ensure_future(do_ping('1.1.1.1')) for _ in range(30)]
# fs = [asyncio.ensure_future(do_ping('1.1.1.1')) for _ in range(50)]
f = asyncio.wait(fs)


Expand Down
2 changes: 1 addition & 1 deletion py3/airflow/unittests.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ default_owner = airflow

[webserver]
base_url = http://localhost:8080
web_server_host = 0.0.0.0
web_server_host = 1.1.1.1
web_server_port = 8080

[email]
Expand Down
2 changes: 1 addition & 1 deletion py3/commandlineutils/argparse_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import textwrap


def parse_command(host='10.32.144.93', port=3306,
def parse_command(host='1.1.1.1', port=3306,
db='messerflow', user='root', passwd='devops'):
parser = argparse.ArgumentParser('Update Messerflow Database.',
formatter_class=argparse.RawTextHelpFormatter # <-- 支持输出多行 help
Expand Down
6 changes: 3 additions & 3 deletions py3/elasticsearch/setup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@
" \"conflicts\": \"proceed\",\n",
" 'source': {\n",
" 'remote': {\n",
" 'host': 'http://172.16.7.41:8200/',\n",
" 'host': 'http://1.1.1.1:8200/',\n",
" 'username': 'superuser',\n",
" 'password': 'xxx',\n",
" }, \n",
Expand Down Expand Up @@ -903,8 +903,8 @@
"# url = api + '_user/delete'\n",
"# url = '{}_user/alter'.format(api)\n",
"data = {\n",
" \"username\": \"zipkin_prod\",\n",
" \"password\": \"zipkin_prod\",\n",
" \"username\": \"123\",\n",
" \"password\": \"123\",\n",
" \"ip_whitelist\": [\"*\"],\n",
" \"get_path\": [\"/\", \"/_\", \"/zipkin_prod:\"],\n",
" \"head_path\": [\"/\", \"/_\", \"/zipkin_prod:\"],\n",
Expand Down
22 changes: 11 additions & 11 deletions py3/fluentd/log.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"metadata": {},
"outputs": [],
"source": [
"sit = {'host': '1.1.5.20', 'port': 24225, 'tag': 'spring.test'}\n",
"uat = {'host': '1.1.5.21', 'port': 24225, 'tag': 'spring.test'}\n",
"perf = {'host': '1.1.5.22', 'port': 24225, 'tag': 'spring.test'}\n",
"pr1 = {'host': '1.1.4.85', 'port': 24225, 'tag': 'spring.test'}\n",
"pr2 = {'host': '1.1.4.86', 'port': 24225, 'tag': 'spring.test'}\n",
"sit = {'host': '1.1.1.1', 'port': 24225, 'tag': 'spring.test'}\n",
"uat = {'host': '1.1.1.1', 'port': 24225, 'tag': 'spring.test'}\n",
"perf = {'host': '1.1.1.1', 'port': 24225, 'tag': 'spring.test'}\n",
"pr1 = {'host': '1.1.1.1', 'port': 24225, 'tag': 'spring.test'}\n",
"pr2 = {'host': '1.1.1.1', 'port': 24225, 'tag': 'spring.test'}\n",
"local = {'host': 'localhost', 'port': 24225, 'tag': 'spring.test'}"
]
},
Expand Down Expand Up @@ -105,7 +105,7 @@
],
"source": [
"# test fluentd\n",
"test = {'host': '172.16.5.20', 'port': 24225, 'tag': 'connector.sit'}\n",
"test = {'host': '1.1.1.1', 'port': 24225, 'tag': 'connector.sit'}\n",
"sender = FluentSender(**test)\n",
"\n",
"msg1 = '2018-09-07 10:55:21.782 | msmqttpush | INFO | http-nio-8080-exec-8 | com.laisky.base.mqttpush.api.rest.MQTTPushControntroller | 120 | {\"message\": \"test\"} '\n",
Expand Down Expand Up @@ -187,12 +187,12 @@
"}\n",
" \n",
"def worker():\n",
"# test = {'host': '172.16.4.85', 'port': 24225, 'tag': 'qingai.prod'}\n",
"# test = {'host': '1.1.1.1', 'port': 24225, 'tag': 'qingai.prod'}\n",
" # test = {'host': 'hbase1.sit.ptcloud.t.home', 'port': 24225, 'tag': 'spring.sit'}\n",
" test = {'host': '127.0.0.1', 'port': 24225, 'tag': \"spring.sit\"}\n",
"# test = {'host': '127.0.0.1', 'port': 24226, 'tag': \"forward-wechat.sit\"}\n",
"# test = {'host': '172.16.5.20', 'port': 24226, 'tag': \"forward-wechat.sit\"}\n",
"# test = {'host': '172.16.5.22', 'port': 24226, 'tag': \"spring.perf\"}\n",
" test = {'host': '1.1.1.1', 'port': 24225, 'tag': \"spring.sit\"}\n",
"# test = {'host': '1.1.1.1', 'port': 24226, 'tag': \"forward-wechat.sit\"}\n",
"# test = {'host': '1.1.1.1', 'port': 24226, 'tag': \"forward-wechat.sit\"}\n",
"# test = {'host': '1.1.1.1', 'port': 24226, 'tag': \"spring.perf\"}\n",
" sender = FluentSender(**test)\n",
" # sender.send({'log': 'hello world', 'host': 'ip'})\n",
" # sender.send({'log': msg1})\n",
Expand Down
2 changes: 1 addition & 1 deletion py3/kafka/oogway.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"data": {
"text/plain": [
"{'bootstrap.servers': '10.213.113.26:9092',\n",
"{'bootstrap.servers': '1.1.1.1:9092',\n",
" 'group.id': 'host-one',\n",
" 'virus_topic': 'antivirus-scan-results'}"
]
Expand Down
4 changes: 2 additions & 2 deletions py3/ldap-demo/ldap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"\n",
"total_entries = 0\n",
"server = Server('ldap://10.47.12.7011:3268')\n",
"server = Server('ldap://1.1.1.1:3268')\n",
"# c = Connection(server, user='darthadmin', password='123')\n",
"c = Connection(server, user='dds\\\\caizhonghua', password='123')\n",
"c.bind()"
Expand Down Expand Up @@ -91,7 +91,7 @@
"metadata": {},
"outputs": [],
"source": [
"cookie = c.result['controls']['1.2.840.113556.1.4.319']['value']['cookie']"
"cookie = c.result['controls']['1.1.1.1.1.4.319']['value']['cookie']"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions py3/paramiko/paramiko.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"source": [
"import paramiko\n",
"\n",
"DEVOPS = '10.32.189.146'\n",
"DOCKER1 = '10.47.12.81'\n",
"DEVOPS = '1.1.1.1'\n",
"DOCKER1 = '1.1.1.1'\n",
"PORT = 58422\n",
"OPS_KEY = r'/Users/laisky/repo/chexiang/devops/ansible/files/ops_rsa'"
]
Expand Down
Loading

0 comments on commit 1d6d533

Please sign in to comment.