1 numpy data science

 
a=[0,1,2,3,4,5] 
a[-1]    # last item in the array 
>>> a[-2]  # second last item in array it returns 4
 
a[-2:]   # last two items in the array
 
a[:-2]   # everything except the last two items
a[::-1]    # all items in the array, reversed
a[1::-1]   # the first two items, reversed
a[:-3:-1]  # the last two items, reversed
a[-3::-1]  # everything except the last two items, reversed
 
import numpy as np
array([0, 1, 2, 3, 4]) 
 
 

lacp bonding ubuntu


cat /etc/network/interfaces

# The primary network interface
# Interfaces bonding
auto eth4
iface eth4 inet manual
bond-master bond0

auto eth5
iface eth5 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 10.233.193.23 
netmask 255.255.255.0
gateway 10.233.193.254
dns-nameservers 217.16.102.1
bond-mode 802.3ad
bond-miimon 100
bond-lacp-rate 1
bond-slaves none


# cat /proc/net/bonding/bond0 

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: fast
Min links: 0
Aggregator selection policy (ad_select): stable

Slave Interface: eth5
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: f8:f2:1e:09:18:c1
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0

Slave Interface: eth4
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: f8:f2:1e:09:18:c0
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0

Mode1 Activebackup
DEVICE=bond0
TYPE=Bond
BONDING_MASTER=yes
IPADDR=192.168.99.110
PREFIX=24
ONBOOT=yes
BOOTPROTO=static
BONDING_OPTS="mode=1 miimon=100 fail_over_mac=1"
DEVICE=bond0 TYPE=Bond BONDING_MASTER=yes IPADDR=192.168.99.110 PREFIX=24 ONBOOT=yes BOOTPROTO=static BONDING_OPTS="mode=1 miimon=100 fail_over_mac=1"

multipath ubuntu

# Single Path in multipath (not useful)
root@L0004906:~# cat /etc/multipath.conf | grep -v "#"
defaults {
    polling_interval    10
    selector        "round-robin 0"
    path_grouping_policy    multibus
    prio            const
    path_checker        directio
    failback        immediate
    no_path_retry       1
    features        "0"
}
blacklist {
}
blacklist_exceptions {
}
multipaths {
    multipath {
        alias           mpath0
    }
    multipath {
                wwid                    3600c0ff0001e54bae320f75401000000
                alias                   mpath1
        }
}

#Multiple path in multipath
root@L0004909:~# cat /etc/multipath.conf | grep -v "#"
defaults {
        polling_interval        10
        selector                "round-robin 0"
        path_grouping_policy    multibus
        prio                    const
        path_checker            directio
        failback                immediate
        no_path_retry           1
        features                "0"
}
blacklist {
}
blacklist_exceptions {
}
multipaths {
        multipath {
                alias                   mpath0
        }
        multipath {
                wwid                    3600c0ff0001e44ef1bd1fe5401000000
                alias                   mpath1
        }
    multipath {
                alias                   mpath2
        }
        multipath {
                wwid                    3600c0ff0001e44efd7cefe5401000000
                alias                   mpath3
        }
}
root@L0004909:~# multipath -ll
mpath2 (3600c0ff0001e6fd3d3cefe5401000000) dm-2 HP      ,MSA 2040 SAS   
size=3.3T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  |- 4:0:0:11 sdh 8:112 active ready running
  `- 3:0:0:11 sdd 8:48  active ready running
mpath3 (3600c0ff0001e44efd7cefe5401000000) dm-3 HP      ,MSA 2040 SAS   
size=3.3T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  |- 4:0:0:12 sdi 8:128 active ready running
  `- 3:0:0:12 sde 8:64  active ready running



  /opt/immune/bin/envdo python /opt/immune/installed/idx/apps/NewMerger/util/requester.py --q "|chart count() by device_ip"