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
root@kimogi-MacBookAir:/home/kimogi# ifconfig eth0 # original mac | |
eth0 Link encap:Ethernet HWaddr bc:f6:85:d7:1a:1a | |
UP BROADCAST MULTICAST MTU:1500 Metric:1 | |
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:1000 | |
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | |
root@kimogi-MacBookAir:/home/kimogi# ifconfig eth0 down | |
root@kimogi-MacBookAir:/home/kimogi# ifconfig eth0 hw ether de:ad:be:ef:00:00 |
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
Adding datacenter | |
syntax: `vipsmart dc add dc-1,192.168.0.99,9610` | |
Tells **local dc** to add **candidate dc** dc-1 to the federation. | |
If **local dc** is not federated yet it will decalre federation consisting | |
of itself and add **candidate dc**. | |
Important assumptions: | |
- **local dc** might not be federated yet, it will create a federation of itself and add **candidate dc** |
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 | |
ip2dec () { | |
local a b c d ip=$@ | |
IFS=. read -r a b c d <<< "$ip" | |
printf '%d\n' "$((a * 256 ** 3 + b * 256 ** 2 + c * 256 + d))" | |
} | |
die () { | |
echo $1 |
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 | |
period=$1 | |
shift | |
pattern=$@ | |
last_timestamp= | |
while :; do | |
line=$(dmesg | grep "$pattern" | tail -n 1) | |
timestamp=$(echo $line | cut -d" " -f1 | sed 's/[]\[]//g') |
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/sh | |
awk '{ | |
split($0, chars, ""); | |
for (i=1; i<=length($0); i++) { | |
if (flagInLine == 0) { printf ("%-5d", i/32); flagInLine=1 } | |
printf("%s%s ", chars[i], chars[i+1]); | |
if ((i+1) % 32 == 0) { flagInLine=0; printf "\n"} | |
i++ | |
} |
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
server { | |
listen 443; | |
server_name localhost; | |
root html; | |
index index.html index.htm; | |
ssl on; | |
ssl_certificate cert.pem; | |
ssl_certificate_key cert.key; |
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
(stas-policy)ubuntu@ip-192-168-99-10:~$ sudo mdkir /etc/wicd_sdk^C | |
(stas-policy)ubuntu@ip-192-168-99-10:~$ sudo su | |
root@ip-192-168-99-10:/home/ubuntu# mkdir /etc/wicd_sdk | |
root@ip-192-168-99-10:/home/ubuntu# mkdir /etc/wicd_sdk/output | |
root@ip-192-168-99-10:/home/ubuntu# chown ubuntu:ubuntu /etc/wicd_sdk/output | |
root@ip-192-168-99-10:/home/ubuntu# exit | |
(stas-policy)ubuntu@ip-192-168-99-10:~$ touch /etc/wicd_sdk/output/token1 | |
(stas-policy)ubuntu@ip-192-168-99-10:~$ sudo chmod 400 /etc/wicd_sdk | |
(stas-policy)ubuntu@ip-192-168-99-10:~$ touch /etc/wicd_sdk/output/token2 | |
touch: cannot touch '/etc/wicd_sdk/output/token2': Permission denied |
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
{ | |
"c1": { | |
"hostname": "netlab-1-0xwl", | |
"interfaces": { | |
"vx1" : { | |
"oip": "192.168.1.2/24", | |
"vid": 1, | |
"remotes": [ | |
"10.240.0.8" | |
] |
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
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
12 | |
31 |
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
# поднимаем сервер | |
# nc -l 9090 & | |
[1] 13126 | |
# ставим дамп | |
# tcpdump -i any port 9090 -A & | |
[2] 13130 | |
# tcpdump: verbose output suppressed, use -v or -vv for full protocol decode | |
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes | |
# клиент посылает данные серверу |