<commit_before>#
# The aim of this memo is to have in one place some useful commands about network
#	by Erwan 'Labynocle' <NAME>


# run a distant tcpdump and watch locally the result in a wireshark (via ssh)
#	given by a colleague
ssh $USER@$HOST sudo tcpdump -pni $INTERFACE -s0 -w - port $PORT  | wireshark -k -i -

# find remote MAC addresses
arp-scan 192.168.200.0/24

# scan with ping his network
nmap -sP A.B.C.*
# check open port on a node
nmap -sS A.B.C.D

# some info about the TCP connections
netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c

# monitor ping on eth0
tcpdump -pni eth0 icmp

# curl to know your public IP
curl ipecho.net/plain

# find an IP according to the MAC address
fping -c 1 -g -q 10.0.0.0/16
arp -n | grep -i "AA:BB:11:DD:22:44"<commit_msg>commands_memo : about_network - extract IP of a given interface<commit_after>#
# The aim of this memo is to have in one place some useful commands about network
#	by Erwan 'Labynocle' <NAME>


# run a distant tcpdump and watch locally the result in a wireshark (via ssh)
#	given by a colleague
ssh $USER@$HOST sudo tcpdump -pni $INTERFACE -s0 -w - port $PORT  | wireshark -k -i -

# find remote MAC addresses
arp-scan 192.168.200.0/24

# scan with ping his network
nmap -sP A.B.C.*
# check open port on a node
nmap -sS A.B.C.D

# some info about the TCP connections
netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c

# monitor ping on eth0
tcpdump -pni eth0 icmp

# curl to know your public IP
curl ipecho.net/plain

# find an IP according to the MAC address
fping -c 1 -g -q 10.0.0.0/16
arp -n | grep -i "AA:BB:11:DD:22:44"

# basic one liner to extract the IP of a given interface
#	from http://stackoverflow.com/questions/21336126/linux-bash-script-to-extract-ip-address
/sbin/ifconfig eth0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'
{'fraction_non_alphanumeric': 0.10873146622734761, 'fraction_numerical': 0.03898956617243273, 'mean_word_length': 3.3588516746411483, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3721761', 'n_tokens_mistral': 728, 'n_tokens_neox': 661, 'n_words': 271}