Denyhosts: Add IP to whitelist

Create a file ‘allowed-hosts’ in the ‘work_dir’ (can be found in the denyhosts.conf file), which is /var/lib/denyhosts on Ubuntu, containing the ip.See the example below:

Read More

Fail2ban: unblock an ip

Find IP Address to Unblock Log in to your server via SSH and type in the following command: iptables -L -n Look for the IP address you want to unblock / unban. Now we must find the jail name this IP address is in. To do so, type the following:…

Read More

Fail2ban: whitelist an ip

First, edit the config file : vi Then, check the line : ignoreip = Add now add all ip you want. Each IP or range IP must be placed here with a space. Ex: 192.168.0.1 192.168.5.0/32 Save. And restart Fail2Ban: service fail2ban restart

Read More

HAProxy: redirect http traffic to https

Within HAProxy it is possible to redirect all http traffic to https.It is sufficient to add the following rule within the frontend section: frontend incoming80 bind 10.1.1.13:80 redirect scheme https if !{ ssl_fc }

Read More

HAProxy: configure transparent proxy

If you configure HAProxy by default, the backends will receive the IP address of the HAProxy as incoming IP address. Some applications (or people) don’t want that. It is possible to configure haproxy as transparent proxy, so that the IP of the client is being used. First of all you…

Read More

Avamar: Query postgresql db

[email protected]:~/>: psql -p 5555 -U viewuser mcdb mcdb=>   Example query:     SELECT * FROM “public”.”v_clients”;     SELECT v_clients.cid, v_clients.client_name, v_clients.client_addr,v_clients.os_type FROM “public”.”v_clients”;        select client_name,status_code,domain FROM v_activities_2 WHERE (status_code=30901 or status_code=30915) and recorded_date_time > current_timestamp – interval ’24 hours’

Read More

Linux: increase inodes on EXT4 file system

If you have a file system with a lot of small files, it it possible that you are running out of inodes.Unfortunately it is not possible to increase the number of inodes on the fly.In order achieve this, you will need to create a new file system, using the N…

Read More

PowerShell: using grep alike command

In Powershell, you can also use a grep like you can do on Linux.In order to search for a string in a file, you can use the following command: If you want to have the output without filename, line number: If If you want to ‘grep’ multiple words, you can…

Read More

ModSecurity: Mod Security rules for wordpress/joomla/drupal

You can use the following mod_security rules for wordpress/joomla/drupal ## Rules for the CWP ## SecRuleRemoveById 910006SecRuleRemoveById 950000SecRuleRemoveById 950001SecRuleRemoveById 950005SecRuleRemoveById 950006SecRuleRemoveById 950117SecRuleRemoveById 950907SecRuleRemoveById 958039SecRuleRemoveById 958051SecRuleRemoveById 958291SecRuleRemoveById 959006SecRuleRemoveById 959151SecRuleRemoveById 960008SecRuleRemoveById 960010 SecRuleRemoveById 960011 SecRuleRemoveById 960012 SecRuleRemoveById 960035 SecRuleRemoveById 960335 SecRuleRemoveById 960904 SecRuleRemoveById 960915 SecRuleRemoveById 970003 SecRuleRemoveById 970015 SecRuleRemoveById 970903 SecRuleRemoveById 973301 SecRuleRemoveById 973302 SecRuleRemoveById 973306 SecRuleRemoveById 973316 SecRuleRemoveById 973330 SecRuleRemoveById 973331 SecRuleRemoveById 973332 SecRuleRemoveById 973334 SecRuleRemoveById 973335 SecRuleRemoveById 973336 SecRuleRemoveById 973344 SecRuleRemoveById…

Read More

SQL-Server: Get Server – Edition – Instance Name with T-SQL

  The following t-sql statement returns the server name, server instance, instance, edition & version of the running SQL-Server.   SELECT SERVERPROPERTY(‘MachineName’) AS [ServerName], SERVERPROPERTY(‘ServerName’) AS [ServerInstanceName], SERVERPROPERTY(‘InstanceName’) AS [Instance], SERVERPROPERTY(‘Edition’) AS [Edition], SERVERPROPERTY(‘ProductVersion’) AS [ProductVersion], Left(@@Version, Charindex(‘-‘, @@version) – 2) As VersionName

Read More

Avamar: spawn after execve errno:8 code 8: Exec format error

When running pre/post scripts, it is possible that you are getting the following error message: 2017-03-20 19:43:43 avtar Info <5916>: Executing run-at-start ‘/usr/local/avamar/etc/scripts/test.sh’2017-03-20 19:43:43 avtar Info <6033>: Begin STDERR from run-at-start:avspawn::spawn after execve errno:8 code 8: Exec format error   In order to resolve that, ensure that you specified the…

Read More

Linux: run commandline internet speed test

There are different possibilities to run internet speed tests from Linux (and Unix based systems) command line. Personally I don’t always want to install extra applications on the servers.Because of that, I use the following command line. The only thing what is needed is wget & python, tools which you…

Read More