Skip to content

Instantly share code, notes, and snippets.

View PoplarYang's full-sized avatar
🦖
Focusing

PoplarYang

🦖
Focusing
View GitHub Profile
@PoplarYang
PoplarYang / 站点.md
Last active August 15, 2020 17:05
记录一些常用站点
loads():将json数据转化成dict数据
dumps():将dict数据转化成json数据
load():读取json文件数据,转成dict数据
dump():将dict数据转化成json数据后写入json文件
@PoplarYang
PoplarYang / goroutine.go
Last active May 7, 2020 15:47
goroutine和channel
package main
import (
"fmt"
"runtime"
"time"
)
func main() {
var array [10]int
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:代表连接数据库中的集合;
安装 fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
安装 tmux
yum install -y tmux
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
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"
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)
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
# 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