User Tools

Site Tools


networking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

networking [2018/02/03 17:58] (current)
Line 1: Line 1:
 +**    How to MOVE files in FTP session?**
 +
 +
 +We are used to PUT and GET, we can upload and download files. But how to move a whole directory?
 +
 +Discover new way to handle file routines with ncftp software by Mike Gleason.
 +
 +// install
 +
 +<​code>​
 +sudo apt-get install ncftp
 +</​code>​
 +
 +// open connection
 +// go to local directory where you want files will download, so you don't need to change it later (with lcd command)
 +
 +<​code>​
 +ncftp -u (your-login) (your-host)
 +</​code>​
 +
 +// okay, we want to move a whole directory and delete it after it is done
 +// assuming directory "​2LNX-OG2K"​ is a directory we want to download and delete from remote machine. easy!
 +
 +<​code>​
 +get -R -DD 2LNX-OG2K
 +</​code>​
 +
 +// what do you get?
 +ncftp supports directories,​ shows process, estimated time of arrival/​accomplishment,​ speed in human-readable format, current file name, creates local directories and cleans up remote'​s,​ asks "​overwrite"​ ? and you have and option to answer "yes, please... to all".
 +
 +say "​ye"​s to ncftp !
 +
 +
 +**    How to download specified files from entire website?**
 +
 +
 +
 +Once I had a MIDI nostalgie :-) and downloaded midi files from websites :) with:
 +
 +<​code>​
 +wget -A pdf,jpg -m -p -E -k -K -np http://​site/​path/​
 +</​code>​
 +
 +
 +**    How to install latest Sylpheed?**
 +
 +
 +
 +add repository
 +
 +<​code>​
 +sudo add-apt-repository ppa:​klaus-vormweg/​sylpheed
 +</​code>​
 +
 +update and install
 +
 +<​code>​
 +sudo apt-get update
 +sudo apt-get install sylpheed
 +</​code>​
 +
 + 
 +official webpage of project is http://​sylpheed.sraoss.jp/​en/​
 +
 +
 +**    How to measure network traffic between computer and surveillance camera?**
 +
 +
 +
 +The main task of this project is to measure in kB/s how much one video stream of “Opticam FI8909W” surveillance camera reserves out local network.
 +
 + 
 +
 +I set up camera (ip 192.168.0.124) and my PC-HOME machine is receiving video stream using firefox browser (ip 192.168.0.102). As measurement environment I selected Linux Ubuntu, as I had it installed as second desktop operating system LNX-HOME (ip 192.168.0.119).
 +
 + 
 +
 +I have to figure out speed of data stream from 192.168.0.124 to 192.168.0.119. First, I need a sniffer, that grabs all packets from local network. Secondly, it should filter packets FROM and TO. Thirdly, it should measure amount of packets.
 +
 + 
 +
 +I decided to look for basic linux network tools:
 +
 + 
 +
 +1.      netstat ​                       local use
 +
 + 
 +
 +2.      ss                    local use
 +
 + 
 +
 +3.      iptraf ​             ip traffic monitor, interface statistics, detailed statistics, lan station monitor, filters
 +
 +iptraf can filter packets by mac address, cam’s mac address was easy to find as it is the same as device id :) (000DC5D634D9)
 +
 +from main menu, “lan station monitor”>​”eth0” and waiting
 +in legend row, it mentioned that InRate and OutRate are in kbits/sec.
 +
 + 
 +
 +4.      tcpdump ​       console sniffer
 +
 + 
 +
 +5.      KDE System Guard             with ubuntu need extra 197 Mb of packets
 +KDE desktop?
 +
 + 
 +
 +6.      Gnome System Monitor ​     nice, shows network history in graphical format: received and sent data per second total (all interfaces, bytes/s).
 +
 + 
 +
 +7.      nmap              console port scanner (nmap –v –sT 192.168.0.124)
 +80/tcp open http
 +
 + 
 +
 +8.      lsof                  list open files, connections..
 +
 + 
 +
 +9.      Conky                        console monitoring tools, prints info
 +
 + 
 +
 +10.  vnstat ​            write database and calculates statistics in console, starts with cron
 +create DB with vnstat –u –i eth0, display stats with vnstat –d (daily) etc
 +it has a graphical front-end vnstat-php-frontend
 +
 + 
 +
 +11.  bmon              real-time console network interface monitor tool, nice and simple
 +
 + 
 +
 +12.  mtr                 ​traceroute with ping merged into one tool
 +
 + 
 +
 +13.  bwm-ng ​        ​simple console real-time network speedometer
 +
 + 
 +
 +14.  cbm                color bandwidth meter
 +
 + 
 +
 +15.  dstat               ​console text scrolling statistical print-out. Nice-very-nice
 +
 + 
 +
 +16.  EtherApe ​      ​graphical representation of network. Show list of nodes and protocols. Node “ipcamera_xxx” was discovered and statistics show that outbound average size is 0,130 bytes and inst traffic 520 bps; some misunderstandings with units.
 +
 + 
 +
 +17.  iftop                top –like software shows which devices reserves more bandwidth than others, nice and simple, for camera example it shown. Displays three speed columns with 2, 10, 40 sec. !notice units are bit/s! for bytes/s start program with “iftop –B”. I relaunched program and got:
 +255.255.255.255 <= ipcamera_xxx.local ​     50B 46B 38B,
 +more accurate is the last column for 40s, 38 bytes/s divided by 40 = 0,95 bytes/s WTF?
 +OK. It took me 2 hours to understand these monitors monitors only local processes. I opened cam view in firefox on linux machine and data was as follows:
 +9,17kB 8,27kB 8,54kB >>>​ 8,​54/​40=0,​2135 bytes/sec. transmitted from linux to camera
 +478kB 483kB 481kB >>>​ 481/​40=12,​025 kilobytes/​sec transmitted from camera to linux
 +
 +Answer: 12 kB/s.
 +
 +what has to be proven.
 +
 + 
 +
 +18.  jnettop ​                      ​analog of iftop
 +
 + 
 +
 +19.  nload                          console ASCII graphical up/down streams
 +
 + 
 +
 +20.  speedometer ​             console speed bar chart presenter
 +
 + 
 +
 +21.  wireshark ​                 network sniffer
 +
 +not tested soft:
 +
 + 
 +
 +22.  Nagios ​                                   iso-image
 +
 + 
 +
 +23.  Cacti                          web-based, complex support
 +
 + 
 +
 +24.  bwbar
 +
 + 
 +
 +25.  bandwitdth ​                ​web-based statistics
 +
 + 
 +
 +26.  networkminer ​          ​gatherimages during sniffing process… but this is for another article
 +
 +**    How to remove extra lines in SVN subversion post-commit script hook?**
 +edit:
 +<​code>​
 +sudo nano /​usr/​share/​subversion/​hook-scripts/​mailer/​svn-mailer.py
 +</​code>​
 +
 +**    How to remove message headers in Mailman digest?**
 +
 +main config is loaded is Defaults.py
 +above it mm_cfg.py config loaded
 +edit
 +<​code>​
 +sudo nano /​etc/​mailman/​mm_cfg.py
 +</​code>​
 +with adding in the end:
 + 
 +<​code>​
 +# removing frustrating headers, 2016 06 04 by OG2K
 +#
 +PLAIN_DIGEST_KEEP_HEADERS.remove('​Message'​)
 +PLAIN_DIGEST_KEEP_HEADERS.remove('​Date'​)
 +PLAIN_DIGEST_KEEP_HEADERS.remove('​From'​)
 +PLAIN_DIGEST_KEEP_HEADERS.remove('​To'​)
 +PLAIN_DIGEST_KEEP_HEADERS.remove('​Cc'​)
 +PLAIN_DIGEST_KEEP_HEADERS.remove('​Subject'​)
 +PLAIN_DIGEST_KEEP_HEADERS.remove('​Message-ID'​)
 +PLAIN_DIGEST_KEEP_HEADERS.remove('​Keywords'​)
 +PLAIN_DIGEST_KEEP_HEADERS.remove('​Content-Type'​)
 +</​code>​
 +
 +**    How to set up FTP server in linux?**
 +
 +
 +
 +What for?
 +
 +    to download files from local machine remotely
 +    to upload files to local machine
 +    to act as a hosting to share photos to friends
 +
 + 
 +
 +// install server
 +
 +<​code>​
 +sudo apt-get install vsftpd
 +</​code>​
 +
 +// edit conf file
 +
 +<​code>​
 +sudo nano /​etc/​vsftpd.conf
 +</​code>​
 +
 +# Uncomment this to enable any form of FTP write command.
 +
 +<​code>​
 +write_enable=YES
 +</​code>​
 +
 +// start server
 +
 +<​code>​
 +sudo /​etc/​init.d/​vsftpd restart
 +</​code>​
 +
 +// check
 +
 +<​code>​
 +ftp localhost
 +</​code>​
 +
 +
 +
 +
 +**    How to set up SSH server?**
 +// install server
 +
 +<​code>​
 +sudo apt-get install openssh-server
 +</​code>​
 +
 +// check
 +
 +<​code>​
 +ssh -l (your login) localhost
 +</​code>​
 +
 +// setting up security issues
 +
 +<​code>​
 +sudo nano /​etc/​ssh/​sshd_config
 +</​code>​
 +
 +// root can not login 1)
 +
 +<​code>​
 +PermitRootLogin no
 +</​code>​
 +
 +// logins only for known AND listed users 2) add line at the end of file:
 +
 +<​code>​
 +AllowUsers (your-login)
 +</​code>​
 +
 +// restart server
 +
 +<​code>​
 +sudo /​etc/​init.d/​ssh restart
 +</​code>​
 +
 +// check
 +
 +<​code>​
 +ssh -l (your login) localhost
 +</​code>​
 +
 +**    How to set up junk spam filtering in Sylpheed?**
 +
 +
 +It is necessary to
 +
 +    install bogofilter
 +
 +<​code>​
 +    sudo apt-get install bogofilter*
 +</​code>​
 +
 +     
 +    activate junk mail control in settings.
 +    mark some messages with right-mouse click "not junk", "​junk"​ to start learning process
 +
 +**    How to set up mutt?**
 +
 + ​Useful resources for setting up mutt
 +
 +http://​www.calmar.ws/​mutt/​
 +https://​dev.mutt.org/​trac/​wiki/​MuttGuide/​Folders
 +http://​stackoverflow.com/​questions/​13892183/​list-maildir-with-new-messag...
 +
 +useful resources for setiing up procmail
 +
 +http://​userpages.umbc.edu/​~ian/​procmail.html
 +
 + 
 +
 +there are typos on site:
 +http://​www.elho.net/​mutt/​maildir/​
 + 
 +
 +<​code>​
 +mailboxes `echo -n "+ "; find ~/Maildir -maxdepth 1 -type d -name "​.*"​ -printf "​+'​%f'​ "`
 +</​code>​
 +
 +should be:
 +
 +<​code>​
 +mailboxes `echo -n "+ "; find ~/Mail -maxdepth 1 -type d -name "​*"​ -printf "+%f "`
 +</​code>​
 +
 +works for me
 + 
 +
 +
  
networking.txt · Last modified: 2018/02/03 17:58 (external edit)