Get IP Address of client without web scripts (like php)

Figured I’d do a quick post about this, I had the need to show my IP address (like https://www.icanhazip.com/ but internal).  I didn’t really feel like adding php to my existing nginx server, so here’s what I did. First) I create a new virtual-host with the internal server-name (or ip) of my nginx server, new document root of “ip” and a Continue reading Get IP Address of client without web scripts (like php)

Helpful Linux Commands

This is mostly for me, but you can use it for you. Fix Permissions, common for WEB find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; Additionally for WordPress. chmod 444 wp-config.php .htaccess Compress folders into tar-gz tar -pczf archive.tgz /folder Change the Hostname properly in centos hostnamectl set-hostname server.example.com Tmux Continue reading Helpful Linux Commands

Exchange 2010/2013 Helpful scripts

This sets your inside/outside and auto-discover URLs to the same address so you can buy a single domain SSL for your exchange server. $FQDN = Read-Host -Prompt ‘mail.example.com’ Get-webservicesVirtualDirectory | Set-webservicesVirtualDirectory –ExternalUrl https://$FQDN/Ews/Exchange.asmx –InternalUrl https://$FQDN/Ews/Exchange.asmx Get-OabVirtualDirectory | Set-OabVirtualDirectory –ExternalUrl https://$FQDN/Oab –InternalUrl https://$FQDN/Oab Get-EcpVirtualDirectory | Set-EcpVirtualDirectory –ExternalUrl https://$FQDN/Ecp –InternalUrl https://$FQDN/Ecp Get-OwaVirtualDirectory | Set-OwaVirtualDirectory –ExternalUrl https://$FQDN/Owa –InternalUrl https://$FQDN/Owa Get-ActiveSyncVirtualDirectory | Set-ActiveSyncVirtualDirectory -ExternalUrl Continue reading Exchange 2010/2013 Helpful scripts

Cut down on Fail2Ban occourances with GeoIP Filtering

Fail2ban is a great way to protect your system but one way to easily cut down on brute-force attempts is to mitigate the area in which users can access those ports. For me, I do not need international calling, so I will be blocking all NON-US Subnets. Specifically for FreePBX (CENTOS) yum install kernel-devel-`uname -r` iptables-devel kernel-headers-`uname -r` rpm -Uvh Continue reading Cut down on Fail2Ban occourances with GeoIP Filtering

US Only VPS (Ubuntu Specific)

This guide worked for me with a few exceptions, I additionally Ran apt-get install xtables-addons-common xtables-addons-dkms xtables-addons-source Once this is done, I change my default-accept policy to US Only accept. iptables -A INPUT -m geoip –src-cc US -j ACCEPT iptables -I INPUT -j DROP iptables-save Simple way to reduce the excessive Fail2Ban occurrences.

qmail outbound email monitor / blacklist prevention script.

Origional Post: Stop-Outbound-SMTP-Automatically-on-Mail-Queue-Size-Alert This is cool, HOWEVER how do you send an email if you just blocked outbound email? I’ve updated the line to directly send via my email server, as long as I am not using port 25, I’m fine (I permit internal relay on my internal IP) echo “Port 25 has been disabled in the firewall for outbound Continue reading qmail outbound email monitor / blacklist prevention script.