This file contains hidden or 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
#log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
# '$status $body_bytes_sent "$http_referer" ' | |
# '"$http_user_agent" "$http_x_forwarded_for"'; | |
import time | |
import sys | |
import os | |
import MySQLdb |
This file contains hidden or 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
# 创建2个ns, 分别用veth连接在ns1和ns2, 接在ovs网桥br1上 | |
# ns1 & ns2 | |
ip netns add ns1 | |
ip netns add ns2 | |
# tap1 & tap2 | |
ip link add tap1 type veth peer name ovs-tap1 | |
ip link add tap2 type veth peer name ovs-tap2 |
This file contains hidden or 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
apt-cache search # ------(package 搜索包) | |
apt-cache show #------(package 获取包的相关信息,如说明、大小、版本等) | |
apt-get install # ------(package 安装包) | |
apt-get install # -----(package --reinstall 重新安装包) | |
apt-get -f install # -----(强制安装, "-f = --fix-missing"当是修复安装吧...) | |
apt-get remove #-----(package 删除包) | |
apt-get remove --purge # ------(package 删除包,包括删除配置文件等) | |
apt-get autoremove --purge # ----(package 删除包及其依赖的软件包+配置文件等(只对6.10有效,强烈推荐)) | |
apt-get update #------更新源 | |
apt-get upgrade #------更新已安装的包 |
This file contains hidden or 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
# create a pv | |
pvcreate /dev/sdb | |
# create a data vg | |
vgcreate data /dev/sdb | |
# create a thin pool | |
lvcreate -L 200G --type thin-pool data/thinpool | |
# extend thin pool to 300G |
This file contains hidden or 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
// Netlink 是内核与用户空间进程通信的一种机制,采用与 UDP socket 非常类似的编程风格。( | |
// 与 UDP 类似,Netlink 通信也有服务器端和客户端。例如,Linux 内核作为服务器端,已经运行在那里。我们则编写 Netlink 客户端,给内核发消息,并获得我们想要的信息。 | |
/* | |
* Display all IPv4 addresses | |
*/ | |
#include <stdio.h> //printf, perror | |
#include <string.h> //memset, strlen | |
#include <stdlib.h> //exit |
This file contains hidden or 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
<domain type='kvm' id='1'> | |
<name>ubuntu-1804-hluo</name> | |
<memory unit='KiB'>4194304</memory> | |
<currentMemory unit='KiB'>4194304</currentMemory> | |
<vcpu>2</vcpu> | |
<cpu mode='host-passthrough'/> | |
<os> | |
<type arch='x86_64'>hvm</type> | |
<boot dev='hd'/> | |
</os> |
This file contains hidden or 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
#!/bin/bash | |
# 创建虚拟交换机: | |
ovs-vsctl add-br br-int | |
# 创建TAP设备: | |
ip tuntap add tap0 mode tap | |
ip tuntap add tap1 mode tap | |
# 将设备连接到虚拟交换机: |
This file contains hidden or 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
# (c) 2007 Chris AtLee <[email protected]> | |
# Licensed under the MIT license: | |
# http://www.opensource.org/licenses/mit-license.php | |
""" | |
PAM module for python | |
Provides an authenticate function that will allow the caller to authenticate | |
a user against the Pluggable Authentication Modules (PAM) on the system. | |
Implemented using ctypes, so no compilation is necessary. |