<commit_before>#!/usr/bin/env bash
#Ritten by: walshie4
#Maintained at https://github.com/walshie4/Geeklets
#Created on 2/3/2014
#Network Interface Config
INTERFACE='en0' #run ifconfig and look for the interface with a status marked 'active'
#End Config

response=`netstat -i -b | grep $INTERFACE`
in=$((`echo $response | cut -f7 -d ' '` / 1024)) #divided by number of bytes per megabyte
out=$((`echo $response | cut -f10 -d ' '` / 1024))
in2=$((`echo $response | cut -f7 -d ' '` / 1024)) #divided by number of bytes per megabyte
out2=$((`echo $response | cut -f10 -d ' '` / 1024))
inMB=$(($in / 1024))
outMB=$(($out / 1024))
echo "TX:$outMB MBs  RX:$inMB MBs"
sleep 1
diffIn=$(($in2 - $in))
diffOut=$(($out2 - $out))
echo "TX:$diffOut KB/s  RX:$diffIn KB/s"<commit_msg>Added color, fixed issue with per second data polling method.<commit_after>#!/usr/bin/env bash
#Ritten by: walshie4
#Maintained at https://github.com/walshie4/Geeklets
#Created on 2/3/2014

#UI COLORS
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
RESET=$(tput sgr0)
#END UI COLORS

#Network Interface Config
INTERFACE='en0' #run ifconfig and look for the interface with a status marked 'active'
#End Config

response=`netstat -ib | grep $INTERFACE`
in=$((`echo $response | cut -f7 -d ' '`)) #divided by number of bytes per megabyte
out=$((`echo $response | cut -f10 -d ' '`))
sleep 1
response=`netstat -ib | grep $INTERFACE` 
in2=$((`echo $response | cut -f7 -d ' '`)) #divided by number of bytes per megabyte
out2=$((`echo $response | cut -f10 -d ' '`))
inMB=$(($in / 1048576))
outMB=$(($out / 1048576))
echo "TX:$RED$outMB$RESET MBs  RX:$GREEN$inMB$RESET MBs"
diffIn=$((($in2 - $in) / 1024))
diffOut=$((($out2 - $out) / 1024))
echo "TX:$RED$diffOut$RESET MBs/s  RX:$GREEN$diffIn$RESET MBs/s"
{'fraction_non_alphanumeric': 0.1824900511654349, 'fraction_numerical': 0.05059693007390563, 'mean_word_length': 4.587301587301587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1307295', 'n_tokens_mistral': 753, 'n_tokens_neox': 671, 'n_words': 206}