Posts

Linux systems which use a GUI often have a network manager running, which uses a dnsmasq instance running on a loopback address such as 127.0.0.1 or 127.0.1.1 to cache DNS requests, and adds this entry to /etc/resolv.conf. The dnsmasq service speeds up DNS look-ups and also provides DHCP services

sudo cat /run/resolvconf/resolv.conf
sudo cat /run/dnsmasq/resolv.conf
sudo cat /etc/systemd/resolved.conf

Disable the local DNS cache

/etc/NetworkManager/NetworkManager.conf

#dns=dnsmasq
systemctl restart network-manager
sudo systemctl disable dnsmasq

检查dns

sudo cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.8.3.1
nameserver 114.114.114.114
nameserver 8.8.8.8
nameserver 114.114.114.114

详细说明

安装

kubeadm config images pull --image-repository registry.aliyuncs.com/google_containers
sudo kubeadm init --image-repository registry.aliyuncs.com/google_containers

kubectl apply -f https://docs.projectcalico.org/v3.11/manifests/calico.yaml




kubeadm join 10.8.3.222:6443 --token awon9z.bcw8z \
    --discovery-token-ca-cert-hash sha256:7b90bca7225915f07179fd2ad31820533

安装kubectl curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add - cat <<EOF >/etc/apt/sources.list.d/kubernetes.list deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main EOF apt-get update apt-get install -y kubectl=1.18.3-00 Installing bash completion on Linux kubectl completion bash > ~/.kube/kubectl.bash.inc printf " # Kubectl shell completion source '$HOME/.kube/kubectl.bash.inc' " >> $HOME/.bashrc source $HOME/.bashrc git clone [email protected]:GoogleCloudPlatform/microservices-demo.git cat /etc/docker/daemon.json { "insecure-registries" : ["10.8.5.211"] } microservices-demo/src/shippingservice/Dockerfile RUN go env -w GOPROXY=https://goproxy.cn,direct skaffold run --default-repo=10.

安装

sudo apt install wireguard  wireguard-dkms -y
wget algo/configs/localhost/wireguard/desktop.conf  /etc/wireguard/wg0.conf
sudo wg-quick up wg0

There is a very important difference between the root and the alias directives. This difference exists in the way the path specified in the root or the alias is processed. In case of the root directive, full path is appended to the root including the location part, whereas in case of the alias directive, only the portion of the path NOT including the location part is appended to the alias.

Inline Versus Overlay Virtual Networks In the inline model, every hop between the source and destination is aware of the virtual network the packet belongs to and uses this information to do lookups in the forwarding table. In the overlay network model, only the edges of the network keep track of the virtual networks; the core of the network is unaware of virtual networks. VLAN and VRF are examples of the inline model of virtual networks, whereas MPLS, VXLAN, and other IP-based VPNs are examples of the overlay model.

Isolate represents an isolated instance of the V8 engine. V8 isolates have completely separate states. Objects from one isolate must not be used in other isolates. When V8 is initialized a default isolate is implicitly created and entered. The embedder can create additional isolates and use them in parallel in multiple threads. An isolate can be entered by at most one thread at any given time. The Locker/Unlocker API must be used to synchronize.

Setting Up the Hosted UI with the Amazon Cognito

Unless required by your authorization flow, clear the option Generate client secret. The client secret is used by applications that have a server-side component that can secure the client secret

Lambda Proxy vs Lambda Integration

https://github.com/vaquarkhan/vaquarkhan/wiki/Lambda-Proxy-vs-Lambda-Integration-in-AWS-API-Gateway

PYTHON

https://realpython.com/code-evaluation-with-aws-lambda-and-api-gateway/

JAVA

https://www.baeldung.com/aws-lambda-api-gateway

git clone https://github.com/eugenp/tutorials.git
cd tutorials/aws-lambda
mvn clean package shade:shade
aws s3 cp ./target/aws-lambda-0.1.0-SNAPSHOT.jar s3://wubigo/

从S3上传文件到lambad

  • handler

    com.baeldung.lambda.apigateway.APIDemoHandler::handleRequest
    

NODEJS

https://itnext.io/how-to-build-a-serverless-app-with-s3-and-lambda-in-15-minutes-b14eecd4ea89

函数计算有很多使用场景,今天介绍定时任务调度 例如每周六生成业务报表 事件类别 资源生命周期事件 HTTP请求 消息队列 调度 调度事件 define event rules that self-trigger regularly and configure a target action to do some regular work. So you can define an Amazon Lambda function or AWS Step Functions state machine as scheduled targets. Hence, when this event is triggered at the specified time or interval you defined, your function or state machine is executed. These types of events are called scheduled Amazon CloudWatch Events

PYTHON 镜像

ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443)

$HOME/.config/pip/pip.conf

[global]

trusted-host=mirrors.aliyun.com

index-url=http://mirrors.aliyun.com/pypi/simple/

WINDOWS 10

Python 3.6.8
  File "C:\code\venv3\lib\site-packages\pip\_vendor\distlib\scripts.py", line 383, in _get_launcher
    raise ValueError(msg)
ValueError: Unable to find resource t64.exe in package pip._vendor.distlib
python -m pip uninstall pip
python -m ensurepip
python -m pip install -U pip

python3

  • 改变操作系统的地区为美国

否则报UnicodeDecodeError: ‘gbk’ codec can’t decode

python-3.6.8-amd64

py -3.6 -m pip install virtualenv
py -3.6 -m virtualenv venv3
.\venv3\script\activate
pip install zappa

git clone https://github.com/Miserlou/Zappa.git
cd zappy/example
pip install flask
zappa deploy dev_event
  • 检查状态

    zappa  status dev_api
    

FAQ

  • IllegalLocationConstraintException

    get this error if you're trying to create a bucket with a name that's already been taken
    
    

https://stackoverflow.com/questions/49174673/aws-s3api-create-bucket-bucket-make-exception

--create-bucket-configuration LocationConstraint=eu-west-1

在AWS免费申请一台免费云主机(可选) 利用terraform创建一台云主机 git clone [email protected]:wubigo/iaas.git cd iaas\aws\ec2 .\apply Apply complete! Resources: 2 added, 0 changed, 0 destroyed. Outputs: instance_id = i-069i247af71871dd9 public_ip = 13.113.195.66 ssh [email protected] [email protected]:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal 也可以直接在web控制台根据向导创建 搭建VPN服务器 git clone https://github.com/trailofbits/algo.git sudo apt install -y python3-virtualenv cd algo python3 -m virtualenv --python="$(command -v python3)" .env && source .env/bin/activate && python3 -m pip install -U pip virtualenv && python3 -m pip install -r requirements.

The size of the market for multiparty, multicloud data and code aggregation is enormous and only grows larger as companies capture every last bit of data. Vendia’s serverless-based technology offers benefits such as ease of experimentation, no operational heavy lifting and a pay-as-you-go pricing model, making it both very consumable and highly disruptive

config climc service-config-edit region2 or kubectl describe cm default-region -n onecloud region.conf log_level: debug log_verbose_level: 10 enable_host_health_check: false enable_ssl: false port: 30888 port_v2: 30888 依赖的模块 HTTP web framework github.com/gin-gonic/gin ORM https://github.com/go-gorm/gorm region endpoint climc endpoint-show b0d33d8b370c42418cb3c6e51442c072 +--------------------+----------------------------------+ | Field | Value | +--------------------+----------------------------------+ | can_delete | false | | can_update | true | | created_at | 2020-06-23T03:03:20.000000Z | | deleted | false | | enabled | true | | id | b0d33d8b370c42418cb3c6e51442c072 | | interface | public | | is_emulated | false | | name | compute_v2-public | | public_key_bit_len | 0 | | region_id | region0 | | service_id | fb54a285aa3e4c848298148596011aa1 | | service_name | region2 | | service_type | compute_v2 | | update_version | 0 | | updated_at | 2020-06-23T03:03:20.

系统设置 /etc/yum.conf obsoletes=0 obsoletes=1: 安装k8s 1.15.8会报一个依赖错误 安装ansible sudo yum install epel-release sudo yum install python-pip pip install ansible 安装kubelet(可选) OCADM创建K8S的前提条件是kebelet正常工作 安装kubelet OCBOOT git clone https://github.com/yunionio/ocboot.git cd ocboot ./run.py ./config-allinone.yml allinone.yml mariadb_node: use_local: true hostname: 192.168.137.190 user: root db_user: root db_password: qwe123 primary_master_node: #master_node: use_local: true hostname: 192.168.137.190 user: root db_host: 192.168.137.190 db_user: root db_password: qwe123 onecloud_user: demo onecloud_user_password: [email protected] controlplane_host: 192.168.137.190 controlplane_port: "6443" as_host: true registry_mirrors: - https://lje6zxpk.

最近黑客新网也被墙了,WTF lynx https://news.ycombinator.com/news 1. Generics and Compile-Time in Rust (pingcap.com) 107 points by Bella-Xiang 4 hours ago | hide | 17 comments 2. Adobe to remove Flash Player from web site after December 2020 (adobe.com) 740 points by michaelhoffman 14 hours ago | hide | 412 comments 3. How many of you know that the team is working on something that no-one wants? (iism.org) 255 points by kiyanwang 8 hours ago | hide | 136 comments 4.

FIDO

Fast Identity Online (FIDO)

WebAuthn was officially recognized as a W3C web standard in March 2019. Today, WebAuthn is part of the FIDO Alliance’s FIDO2 specifications and the FIDO Alliance runs certification programs to ensure compliance

虚机网卡地址

配置静态IP

C:\Documents and Settings\All Users\Application Data\VMware\vmnetdhcp.conf

host VMnet8 {
    hardware ethernet 00:0C:29:23:AV:67;
    fixed-address 192.168.137.170;
}

重启VMWARE DHCP服务

net stop vmnetdhcp
net start vmnetdhcp