About Windows

msys2: 

MSYS2 is a software distro and building platform for Windows.
At its core is an independent rewrite of MSYS, 
based on modern Cygwin (POSIX compatibility layer) and 
MinGW-w64 with the aim of better interoperability with native Windows software. 
It provides a bash shell, Autotools, 
revision control systems and the like for building native Windows applications 
using MinGW-w64 toolchains.
It features a package management system to 
provide easy installation of packages, Pacman. 
It brings many powerful features such as dependency resolution 
and simple complete system upgrades, as well as straight-forward package building.

Reference from: MSYS2 installer

This is the download link in TUNA: Index of /msys2/distrib/x86_64/

DHCP failover configure

Reference from: Linux ISC DHCP Server failover under Debian

primary conf:

option domain-name "ggsre.com";
option domain-name-servers 10.160.16.33,10.160.16.34;
ddns-update-style none;
authoritative;
ping-check true;
default-lease-time 86400;
max-lease-time 172800;
log-facility local7;
failover peer "dhcp-failover" {
    primary;
    address 10.160.16.58;
    port 647;
    peer address 10.160.16.59;
    peer port 847;
    max-response-delay 60;
    max-unacked-updates 10;
    load balance max seconds 3;
    mclt 3600;
    split 128;
}
subnet 10.160.72.0 netmask 255.255.252.0 {
    option routers 10.160.72.1;
    pool {
        failover peer "dhcp-failover";
        range 10.160.72.100 10.160.72.250;
    }
    pool {
        failover peer "dhcp-failover";
        range 10.160.73.1 10.160.73.250;
    }
}
subnet 10.160.16.0 netmask 255.255.254.0 {
        option routers 10.160.16.1;
        option domain-name "outnet.com";
        option domain-name-servers 10.160.16.1;
        next-server 10.160.16.2;
        filename "pxelinux.0";
        default-lease-time 600;
    pool {
        failover peer "dhcp-failover";
        range 10.160.16.5 10.160.16.9;
    }
}

secondary.conf:

option domain-name "ggsre.com";
option domain-name-servers 10.160.16.33,10.160.16.34;
ddns-update-style none;
authoritative;
ping-check true;
default-lease-time 86400;
max-lease-time 172800;
log-facility local7;
failover peer "dhcp-failover" {
    secondary;
    address 10.160.16.59;
    port 847;
    peer address 10.160.16.58;
    peer port 647;
    max-response-delay 60;
    max-unacked-updates 10;
    load balance max seconds 3;
    #mclt 3600;
    #split 128;
}
subnet 10.160.72.0 netmask 255.255.252.0 {
    option routers 10.160.72.1;
    pool {
        failover peer "dhcp-failover";
        range 10.160.72.100 10.160.72.250;
    }
    pool {
        failover peer "dhcp-failover";
        range 10.160.73.1 10.160.73.250;
    }
}
subnet 10.160.16.0 netmask 255.255.254.0 {
        option routers 10.160.16.1;
        option domain-name "outnet.com";
        option domain-name-servers 10.160.16.1;
        next-server 10.160.16.2;
        filename "pxelinux.0";
        default-lease-time 600;
    pool {
        failover peer "dhcp-failover";
        range 10.160.16.5 10.160.16.9;
    }
}

The same conf you could use the `include /the/same/conf` command  import that.

The defferent:

diff dhcpd.*
10,14c10,14
<     primary;
<     address 10.160.16.58;
<     port 647;
<     peer address 10.160.16.59;
<     peer port 847;
---
>     secondary;
>     address 10.160.16.59;
>     port 847;
>     peer address 10.160.16.58;
>     peer port 647;
18,19c18,19
<     mclt 3600;
<     split 128;
---
>     #mclt 3600;
>     #split 128;

See more in dhcp.conf offical website DHCP ISC FAILOVER

Ubuntu 16.04 can’t connect the internet by using 802.1x security

Case 1, because of the UI bug in Ubuntu 16.04, you should edit the connection file "/etc/NetworkManager/system-connections/name-of-your-connection" enter your password value in [802-1x] block like this:

[802-1x]
altsubject-matches=
eap=peap;
identity=account
password=password
phase2-altsubject-matches=
phase2-auth=mschapv2

Case 2, because of the USB which is a bootstrap Ubuntu system was inserted in the usb interface, after me reboot the Ubuntu system, the connection always fail. After remove the USB driver, it will work.

Debian9.5 set multiple vlans ip on one NIC in DELL R710

1, If you met this error while restart network: 

Nov 08 11:07:07 debian kernel: bnx2 0000:01:00.0: firmware: failed to load bnx2/bnx2-mips-09-6.2.1b.fw (-2)
Nov 08 11:07:07 debian kernel: bnx2 0000:01:00.0: Direct firmware load for bnx2/bnx2-mips-09-6.2.1b.fw failed with error -2

You need to install the NIC driver: DELL_LAN.iso : mount the iso, 

mount -t iso9660 DELL_LAN.iso /dstdir

and use command `dpkg -i *.deb` install the two deb packages in the iso.

2, Install the `vlan` package or use this deb package vlan_1.9-3.2+b1_amd64.deb which is download from offical website or download from this website vlan_1.9-3.2+b1_amd64.deb .

3, Add such like this configure in the network conf file: "/etc/network/interface"

auto vlan170
iface vlan170 inet static
    vlan-raw-device eno1
    address 10.17.3.249
    netmask 255.255.252.0
    gateway 10.17.0.1

auto vlan174
iface vlan174 inet static
    vlan-raw-device eno1
    address 10.17.7.249
    netmask 255.255.252.0
    gateway 10.17.4.1

and then, restart the networking.

4, Run the cmd `ip r s` will get some route rule like this (these will be generate automatic):

root@debian:~# ip r s
default via 10.17.0.1 dev vlan170 onlink 
10.17.0.0/22 dev vlan170 proto kernel scope link src 10.17.3.249 
10.17.4.0/22 dev vlan174 proto kernel scope link src 10.17.7.249

Finish or you can change the route rule by yourself.

draft

rc.local not run while machine startup, maybe the rc.local file does not have the x(execute) auth

update and save iptables before reboot

unbind mac

svn cleanup less the drive space

https://unix.stackexchange.com/questions/65068/why-ssh-takes-a-long-time-to-connect

make UseDNS no

GSS no

for fast to connect to ssh remote

apache log dir need rx auth

no need to restart

grep '2018-10-26' /var/log/wol_client/wol_client.log|awk '{if($6=="0"){for(i=3;i<8;i++){$i=""}}else{$0=""}if($0!=""){print $0}}'

look rc.local

essential skill crontab all user

rc.local

cron.houly script need +x

apache's execute method file_put_contents need the auth to write, apache run no by root, so chmod 777 the file

python global define to change

cron.houly script need +x

apache's execute method file_put_contents need the auth to write, apache run no by root, so chmod 777 the file

python global define to change

sudo apt-get install curl && curl -L https://bootstrap.saltstack.com -o install_salt.sh && sudo sh install_salt.sh -P

sudo apt-get install curl && curl -L https://bootstrap.saltstack.com -o install_salt.sh && sudo sh install_salt.sh -M

SVN cm error maybe there are some .svn in the subdirectory

Ansible trouble shooting

1, get error below in client "/var/log/auth.log" file after ansible host ran the ping command return fault:

sshd[29378]: Connection closed by 10.17.64.13 [preauth]
10.17.19.250 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: Connection to 10.17.19.250 timed out while waiting to read\r\n",
    "unreachable": true
}

solved:

iptables INPUT policy was DROP, although the ansible host 10.17.64.13 was accept, but the state wasn't be setted, so I should add this policy

"iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT"

solved 2 from bubie liu:

Should use the right user to execute ansible host command