LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

fail2ban and persistence

Posted 02-19-2014 at 05:04 PM by Habitual (Spock's Brain)
Updated 03-19-2014 at 10:53 AM by Habitual (rewrite for clarity and ease-of-use)

Wed Feb 19, 2014 - 6:03:59 PM EST
I recently went toe-to-toe with Fail2ban version: 0.8.6-3 on an Ubuntu host.

Task: Stop intrusions into our host for w00tw00t and other stuff.

Preface: Create a copy of /etc/fail2ban/jail.conf to /etc/fail2ban/jail.local and make all your desired changes in /etc/fail2ban/jail.local
Create and edit an /etc/fail2ban/filter.d/w00tw00t.conf file with this content:
Code:
[Definition]
docroot = /var/www/html
...
LQ Veteran
Posted in Uncategorized
Views 859 Comments 0 Habitual is offline
Old

Give a default/non-null value in order to avoid the "unary operator expected" error

Posted 02-19-2014 at 03:00 PM by the dsc (linux-related notes)
Tags bash

Quote:
Originally Posted by cfajohnson
Quote:
i am trying to compare a value with value 50. but i am getting
"[: -lt: unary operator expected"

I am using

if [ $j -lt 50 ]
then
echo "------------"

fi
Make sure that $j expands to a value. Best is to set it explicitly, but you can also give it a default value (0 in this example):


Code:
if [ ${j:-0} -lt 50 ]
http://www.unix.com/302295072-post3.html...
Member
Posted in Uncategorized
Views 1536 Comments 0 the dsc is offline
Old

"Alpha" of an auto-renaming existing files "mv" script/function/alias

Posted 02-18-2014 at 01:02 PM by the dsc (linux-related notes)

Please don't test this on files you don't care to lose/folders you don't care to mess. I just tested once with an explicit (non-variable/"$2") destination, it seems to have worked. I don't have it as an alias or anything, it was just an "one liner" I came up with.

Code:
for on in "$1" ; do nn=$on ; num=1 ; until [ ! -f "$2/$nn" ] ; do nn="$(echo $nn | sed 's| ([0-9]*)||' | sed "s|\.| ($num).|")" ; num=$((num+1)) ; echo $nn ; done
...
Member
Posted in Uncategorized
Views 1002 Comments 0 the dsc is offline
Old

The Ultimate Linux System with kernel 3.13.3 – latest

Posted 02-16-2014 at 05:46 AM by exton (Exton's Blog)
Updated 02-22-2014 at 03:52 AM by exton

NEWS about ExTiX 14 version 140222

1. The ExTiX ISO is now a ISO-hybrid, which means that it can very easily be transferred (copied) to a USB pen drive. You can then even run ExTiX from the USB stick and save all your system changes on the stick. I.e. you will enjoy persistence! I’ve found two scripts which make the installation to USB very simple. The scripts are quite ingenious.
2. Another big improvement is that ExTiX 14 can run from RAM. Use Boot alternative 2 (Copy to RAM...
ExTiX Admin
Views 734 Comments 0 exton is offline
Old

Why use Linux?

Posted 02-15-2014 at 03:33 AM by exton (Exton's Blog)

I found something memorable about Linux on the Internet. I reproduce it here. The author is unknown to me.

: () { : | : & } ; :

We tell people we use Linux because it's secure. Or because it's free, because it's customizable, because it's free (the other meaning), because it has excellent community support...

But all that is just marketing bullshit. We tell that to non-Linuxers because the wouldn't understand the real reason. And when we say those...
ExTiX Admin
Posted in Linux
Views 1514 Comments 3 exton is offline

  



All times are GMT -5. The time now is 06:25 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration