python3学习手册
★json模块 import json dictx = { "k1": "v1", "k2": "vvv2", "k3": {"k3xx": "vdskl", "k3fyy": "fdksj"} } str_json = json.dumps(dictx) # 将字典数据转 为json字符串,默认是一行 str2_json = json 格式化的json字符串,缩进4空格 newdict = json.loads(str_json) # 将json字符 串导入解析为字典数据 with open("data.json", "w", encoding="utf8") as fp: json.dump(dictx, fp, indent=4) # 将字典数据格 式化为json字符串后写入到文件中 式化为json字符串后写入到文件中 with open("data.json", "r", encoding="utf8") as fp: data = json.load(fp) # 读取文件中的json字符串 后生成字典数据(文件中只可有一个json对象) print(data) ★getpass模块 import getpass cusername = getpass.getuser()0 码力 | 213 页 | 3.53 MB | 1 年前3k8s操作手册 2.3
docker # docker info ★配置docker服务使用systemd去管理(以及信任本地镜像仓库) # vi /etc/docker/daemon.json { "data-root": "/docker_data", "registry-mirrors": [ "h�ps://cof-lee.com:5443" ], "insecure-registries": [ "cof-lee 网桥,不修改iptables规则 # cat > /etc/docker/daemon.json <data-root": "/docker_data", "registry-mirrors": [ "h�ps://cof-lee.com:5443" --image-repository="cof- lee.com:5443/k8s" #指定为集群内部的docker镜像源 如果指定使用集群内部的docker镜像仓库,要提前在docker的daemon.json文件 里配置信任此镜像仓库地址! # cat >> /etc/hosts < 0 码力 | 126 页 | 4.33 MB | 1 年前3git 操作手册
'h�ps://gitlab.cof-lee.com' #设置数据存放路径,默认 /var/opt/gitlab/git-data/repositories git_data_dirs({ "default" => { "path" => "/git-data" } }) #设置备份存放路径及备份默认保存时间,默认 /var/opt/gitlab/backups/ gitlab cof-lee.com.crt" nginx['ssl_cer�ficate_key'] = "/etc/gitlab/gitlab.cof-lee.com.key" EOF # mkdir /git-data # mkdir /git-backup #将证书及密钥文件复制到/etc/gitlab目录下 # gitlab-ctl reconfigure #重 tail -f /var/log/gitlab/gitlab-rails/produc�on.log # tail -f /var/log/gitlab/gitlab-rails/produc�on_json.log ★web界面 ★管理员账号登录web界面及修改密码 浏 览 器 登 录 gitlab-ce , 用 户 名 root , 初 始 化 密 码 为/etc/gitla0 码力 | 35 页 | 1.69 MB | 1 年前3postgresql操作手册
sql/13/ 现在想修改为/data_pg/ 目录 ★PG-13版本 # systemctl stop postgresql-13 #先停止服务 # mkdir /data_pg # chown postgres:postgres /data_pg # vi /var/lib/pgsql/13/data/postgresql.conf #pg-13版本,添加或修改以下配 置 data_directory = '/data_pg/data/' # mv /var/lib/pgsql/13/* /data_pg/ #将原数据目录下所有内容移动到新 数据目录下 # vi /usr/lib/systemd/system/postgresql-13.service #pg-13版本,修改systemd服 #pg-13版本,修改systemd服 务文件,指定数据目录 #修改这行:Environment=PGDATA=/var/lib/pgsql/13/data/ 改为新的路径,如 下: Environment=PGDATA=/data_pg/data/ # systemctl daemon-reload # systemctl restart postgresql-13 ★PG-10版本0 码力 | 17 页 | 445.84 KB | 1 年前3The DevOps Handbook
problem-solving. ii. Telemetry – An automated communications process by which measurements and other data are collected at remote points and are subsequently transmitted to receiving equipment for monitoring development. Operations don’t just monitor what’s up or down. ii. Modern Monitoring architecture 1. Data Collection at business logic, application, & environments layer a. Events, logs, & metrics b. Common 1. Authentication/authorization decisions 2. System and data access 3. System and application changes, especially privileged changes 4. Data changes (CRUD) 5. Invalid input, possible malicious injections0 码力 | 8 页 | 24.02 KB | 5 月前3The DevOps Handbook
Operations to improve outcomes 2. Ch. 9 – Create the Foundations of Our Deployment Pipeline a. Enterprise Data Warehouse program by Em Campbell-Pretty - $200M, All streams of work were significantly behind schedule Application code & dependencies 2. Environment scripts & creation tools 3. DB scripts and reference data 4. Containers 5. Automated tests 6. Project artifacts – documentation, procedures, etc. 7. Application Smoke testing our deployments – test connections to supporting services and systems, run sample data/transaction tests, fail deployment if needed 3. Ensure we maintain consistent environments – continually0 码力 | 8 页 | 23.08 KB | 5 月前3The DevOps Handbook
environment and ensuring service levels are met v. Infosec – team responsible for securing systems and data vi. Release Managers – the people responsible for coordinating the production deployment processes PLANNING HORIZONS SHORT i. Act like a startup, strive to generate measurable improvement or actionable data within weeks f. RESERVE 20% OF CYCLES FOR NON-FUNCTIONAL REQUIREMENTS AND REDUCING TECHNICAL DEBT0 码力 | 8 页 | 22.57 KB | 5 月前3The DevOps Handbook
known vulnerabilities and consolidate multiple versions of the same library iii. 2014 Verizon PCI Data Breach Investigation Report – studies over 85K cardholder breaches. 10 vulnerabilities accounted environments with infrastructure-as-code and auto- scaling. Must create alternatives methods of providing the data to show auditors controls are in place and operating. 1. Work closely to identify the evidence needed0 码力 | 9 页 | 25.13 KB | 5 月前3DevOps Meetup
3rd Party Application Installations Route Adds – requires heightened security access Database Data Script Execution Load Balancer Node Disablement OS and Security Patching Requesting access0 码力 | 2 页 | 246.04 KB | 5 月前3Pomodoro Technique
activities. A flow state ensues when one is engaged in self-controlled, goal-related, meaningful actions. Data regarding flow were collected on thousands of individuals, from mountain climbers to chess players0 码力 | 3 页 | 289.16 KB | 5 月前3
共 11 条
- 1
- 2