[TOC]
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
loads():将json数据转化成dict数据 | |
dumps():将dict数据转化成json数据 | |
load():读取json文件数据,转成dict数据 | |
dump():将dict数据转化成json数据后写入json文件 |
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
package main | |
import ( | |
"fmt" | |
"runtime" | |
"time" | |
) | |
func main() { | |
var array [10]int |
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
mongoimport --host --port --db --collection | |
mongoimport --mode upsert --host dora1 --port 26011 --db boots --collection flavor --file test.json | |
-h,--host :代表远程连接的数据库地址,默认连接本地Mongo数据库; | |
--port:代表远程连接的数据库的端口,默认连接的远程端口27017; | |
-u,--username:代表连接远程数据库的账号,如果设置数据库的认证,需要指定用户账号; | |
-p,--password:代表连接数据库的账号对应的密码; | |
-d,--db:代表连接的数据库; | |
-c,--collection:代表连接数据库中的集合; |
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
安装 fzf | |
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf | |
~/.fzf/install | |
安装 tmux | |
yum install -y tmux |
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
[kubernetes] | |
name=Kubernetes | |
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 | |
enabled=1 | |
gpgcheck=0 |
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
DEVICE=bond0 | |
NAME=bond0 | |
BOOTPROTO=none | |
USERCTL=no | |
ONBOOT=yes | |
BONDING_MASTER=yes | |
IPADDR=10.32.254.11 | |
NETMASK=255.255.255.0 | |
BONDING_OPTS="mode=4 miimon=100 xmit_hash_policy=layer3+4" |
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
def tes(node, inventory): | |
from ansible.parsing.dataloader import DataLoader | |
from ansible.vars.manager import VariableManager | |
from ansible.inventory.manager import InventoryManager | |
from ansible.vars.hostvars import HostVars | |
dl = DataLoader() | |
#dl.load_from_file("vars.yml") | |
im = InventoryManager(loader=dl, sources=[inventory_dir]) | |
vm = VariableManager(loader=dl, inventory=im) |
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
driftfile /var/lib/ntp/drift | |
restrict default nomodify notrap nopeer noquery | |
restrict 127.0.0.1 | |
restrict ::1 | |
# Hosts on local network are less restricted. | |
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap | |
server 135.224.18.20 iburst |
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
# centos7 ansible 2.8.2+ | |
"ansible_distribution": "CentOS", | |
"ansible_distribution_file_parsed": true, | |
"ansible_distribution_file_path": "/etc/redhat-release", | |
"ansible_distribution_file_variety": "RedHat", | |
"ansible_distribution_major_version": "7", | |
"ansible_distribution_release": "Core", | |
"ansible_distribution_version": "7.5 | |
NewerOlder