Get all host information in a single string
uname -a Linux my-hostname.com 3.13.0-68-generic #111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Get kernel name
uname -s Linux
Get network node name
uname -n my-hostname.com
Get kernel version
uname -r 3.19.0-33-generic
Get 16/32/64 bit hardware platform
uname -i x86_64
Download Linux_UFRII_PrinterDriver file and extract to folder
tar -xf Linux_UFRII_PrinterDriver_V310_uk_EN.tar.gz
Turn off your printer and install packages from 32 or /64-bit_Driver/Debian wirh dpkg command.
dpkg -i cndrvcups-common_3.40-1_amd64.deb cndrvcups-ufr2-uk_3.10-1_amd64.deb
Turn on printer and wait while computer finds your printer itself
If you get a “device is busy”message while scaning, go to your Canon MFU device, press Copy button and choose “remote scaner” item and try again.
Configuration file /etc/fail2ban/jail.conf has predifined sections for most used services such as: ssh, mysql, asterisk, apache, pure-ftpd etc.
In the top of the file there is a default section for default items values.
[DEFAULT] # exclude IP adresses from ban list ignoreip = 127.0.0.1/8 192.168.0.0/16 # ban time in seconds bantime = 600 # log fie range records for scanning in seconds findtime = 600 # maximum retries before ban maxretry = 5 # comma delimited ports or iptables-allports banaction = iptables-multiport # tcp or udp protocol = tcp
Each section has name and its items. Lets look for ssh service section.
[ssh] # true or false enabled = true # port number or name described in /etc/services port = ssh # filter name is a file name in a directory /etc/fail2ban/filter.d filter = sshd # file to parse logpath = /var/log/auth.log # retries before ban maxretry = 6 # or use your own action # action = iptables-multiport[name="sshd", port="22", protocol="tcp"]
Files with ban rules located in directory /etc/fail2ban/filter.d and have *.conf extension. Rules in configuration file are regular expression strings delimited with CR (new line).
failregex = ^%(__prefix_line)s(?:error: PAM: )?[aA]uthentication (?:failure|error) for .* from <HOST>( via \S+)?\s*$ ^%(__prefix_line)s(?:error: PAM: )?User not known to the underlying authentication module for .* from <HOST>\s*$ ......
To check rules in log file use fail2ban-regex command. The result is count of rules match. For more verbose use option -v.
fail2ban-regex /var/log/auth.log /etc/fail2ban/filter.d/sshd.conf
Check iptables for your rules
iptables -S | grep fail2ban
If everething is ok wait for a while (findtime), and see ban statistic via command
fail2ban-client status ssh
All fail2ban activity stored in fail2ban.log file. Default verbose level is 3 and can be set in range 1-4. More detailed is 4 – DEBUG
fail2ban-client set loglevel 4
In current version (0.8.11-1) there is no increasing exponential time ban. It would be good to ban IP for the first try for a 1 hour, second try for 1 day, third try for 1 week etc. There is a trick to write new rule controlling fail2ban.log file itself.
Create file /etc/fail2ban/filter.d/fail2ban.conf
[Definition] # Count all bans in the logfile failregex = fail2ban.actions: WARNING \[(.*)\] Ban <HOST> # Ignore our own bans, to keep our counts exact. ignoreregex = fail2ban.actions: WARNING \[fail2ban\] Ban <HOST>
Add to file /etc/fail2ban/jail.conf following section
[fail2ban] enabled = true filter = fail2ban logpath = /var/log/fail2ban.log maxRetry = 5 findtime = 36000 bantime = 360000 action = iptables-allports[name=fail2ban, protocol="all"]
It means when 5 bans occuers within last 10 hours host will be blocked for a 100 hours.
To allow other users to mount davfs file system you need reconfigure davfs2. Run dpkg-reconfigure and answer YES.
Add users to davfs2 group. Replace UserXX with proper value. Each user will be able to moun media into own home directory
usermod -aG davfs2 UserXX
To make permanent mount point in /mnt/MyDavFS directory, first create it with mkdir command
mkdir -p /mnt/MyDavFS
Add mount point,user name, password to secret file /etc/davfs2/secrets
/mnt/MyDavFS UserXX PasswXX
Add following line to file /etc/fstab
http://YourHostName/ScriptName /mnt/MyDavFS davfs user,auto,rw 0 0
Show all buffer
Show CPU frequency
dmesg | egrep -i --color 'MHz'
Show memory info
dmesg | grep -i available |egrep -i --color 'Memory'
Show video card information
dmesg | egrep -i --color 'vga|agp|3d|2d'
Show network card information
dmesg | egrep -i --color 'eth|wlan'
Show webcam information
dmesg | egrep -i --color 'UVC|WebCam|Video'
Clear the ring buffer
To clear apt-cacher-ng cache run following script as a root user
# get root privileges sudo su # stop service service apt-cacher-ng stop # remove cache directory rm -rf /var/cache/apt-cacher-ng/ # start service service apt-cacher-ng start