Finally I'm on holiday, (Friday was my last working day). If someone is asking where I am, the right answer is:
Somewhere in the "Milky Way".
See you on 13rd of August.
Somewhere in the "Milky Way".
#!/bin/bash
###################################
#
# Wed Jul 11 11:38:54 CEST 2007
#
# This script is used to generate
# network traffic statistics
#
# Author: Davide Restivo (xgutter@yahoo.it)
#
# Released under GPLv2
#
####################################
E_BAD_ARGS=65
# The default interface
INTF="eth0"
# Default output filename
TMP_FILE=`tempfile`
FILE_OUT="netmon-`basename $TMP_FILE`.out"
# Default delay measurement
TICK="1"
# Usage
function usage () {
echo "Please invoke this script with zero or three arguments."
echo ""
echo "Example:"
echo " $0"
echo ""
echo "where:"
echo "defaults to eth0"
echo "is automatically generated"
echo "is equal to 1 second"
}
# Let's check command line arguments
if [ $# -eq 0 ]
then
:
elif [ $# -eq 3 ]
then
# Setting parameters
INTF=$1
FILE_OUT=$2
TICK=$3
else
usage
exit $E_BAD_ARGS
fi
################
##### MAIN #####
################
echo "Seconds - Byte sent - Byte received" >> $FILE_OUT
SECONDS_COUNTER="0"
while true;
do
INITIAL_BYTE_SENT=`ifconfig eth0 |grep bytes|cut -d":" -f3|cut -d" " -f1`
INITIAL_BYTE_RECEIVED=`ifconfig eth0 |grep bytes|cut -d":" -f2|cut -d" " -f1`
sleep $TICK
BYTE_SENT=$((`ifconfig eth0 |grep bytes|cut -d":" -f3|cut -d" " -f1` - $INITIAL_BYTE_SENT ))
BYTE_RECEIVED=$((`ifconfig eth0 |grep bytes|cut -d":" -f2|cut -d" " -f1` - $INITIAL_BYTE_RECEIVED ))
TEMP_SECONDS_COUNTER=$(($SECONDS_COUNTER + $TICK))
SECONDS_COUNTER=$TEMP_SECONDS_COUNTER
echo "$SECONDS_COUNTER $BYTE_SENT $BYTE_RECEIVED" >> $FILE_OUT
done
Le case restano, i culi cascano...
unknown Apache 2.0.59 (Oric Dragon32) 89.107.41.30
unknown Apache 2.0.59 (ZX Spectrum 48k (Rubber Keys)) 89.107.41.3
unknown Apache 2.0.59 (Commodore C64) 89.107.41.30
unknown Apache 2.0.59 (CBM PET) 89.107.41.30
unknown Apache 2.0.59 (MSX Toshiba HX-10) 89.107.41.30
unknown Apache 2.0.59 (Commodore C64) 89.107.41.30
unknown Apache 2.0.59 (ZX Spectrum 48k (Rubber Keys)) 89.107.41.30
unknown Apache 2.0.59 (CRAY) 89.107.41.30
unknown Apache 2.0.59 (ZX Spectrum 48k (Rubber Keys)) 89.107.41.30
unknown Apache 2.0.59 (MSX Toshiba HX-10) 89.107.41.30
This is a filesystem client based on the SSH File Transfer Protocol. Since most SSH servers already support this protocol it is very easy to set up: i.e. on the server side there's nothing to do. On the client side mounting the filesystem is as easy as logging into the server with ssh.
The idea of sshfs was taken from the SSHFS filesystem distributed with LUFS, which I found very useful. There were some limitations of that codebase, so I rewrote it. Features of this implementation are:
* Based on FUSE (the best userspace filesystem framework for linux ;-)
* Multithreading: more than one request can be on it's way to the server
* Allowing large reads (max 64k)
* Caching directory contents
# emerge -av sys-fs/sshfs-fuse
# sshfs user1@192.168.177.172:/home/user1 temp_dir
fusermount -u temp_dir
Sarebbe illogico assumere che tutte le condizioni rimangano stabili.
-- Spock, "The Enterprise Incident" (TOS), data astrale 5027.3
Doh!
what's the difference between chattr and chmod? SomeLamer: man chattr > 1; man chmod > 2; diff -u 1 2 | less
-- Seen on #linux on irc