Wednesday, May 1, 2013

Fix GBIC_SECURITY_CRYPT-4-VN_DATA_CRC_ERROR

This is usually caused by using aftermarket GBIC's.

There are two work arounds (variously supported)
config t
service unsupported-transceiver
or
config t
no errdisable detect cause gbic-invalid
You may need to reload the switch or re-seat the GBIC's to get them working.

Thursday, April 11, 2013

DKIM Key 1024 2048 Bits Causes BIND NAMED Error

By default BIND can only handle 255 characters per line for record length, however it can handle values up to 65,536 characters.

The trick to getting a DKIM key (or any zone record for that matter) to wrap within this limit you do the following:
_domainKey.domain.com. IN  TXT ( "p=part of your key"
                                  "another part of your key"
                                  "last part of your key" )
By wrapping the entire value in brackets we keep it tied to one record and by quoting each line individually it allows us to surpass the line limit.

Common errors with this:
dns_rdata_fromtext: near eol: unbalanced quotes
dns_master_load: label too long
dns_master_load: syntax error
zone: loading master file: ran out of space

Tuesday, April 9, 2013

Show Total Number Of SYN_RECV Connections Using Netstat For SYN Flood DDOS Denial Of Service Detection

netstat -an | grep :80 | grep -i syn | wc -l

Protect Against SYN Flood DDOS/DOS Denial Of Service Attacks

There are a few baseline variables you can set in the Linux kernel to help protect your server against SYN Floods.
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
echo 2048 > /proc/sys/net/ipv4/tcp_max_syn_backlog
echo 3 > /proc/sys/net/ipv4/tcp_synack_retries
To make these persist across reboots, enter the following into /etc/sysctl.conf
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.tcp_synack_retries = 3
It is also recommended you install CSF firewall to help your servers' security. CSF also includes SYN Flood mitigation at the firewall iptables/firewall level.

Find All cPanel Accounts On A Specific IP Address

grep -ir "$ip_address" /var/cpanel/*.accts | awk '{print $1}' | cut -d, -f1

Sortable Output MySQL Show Processlist

This will sort the output by username. Substitute select's and order's as needed.
SELECT id,user,db,command,time,state FROM INFORMATION_SCHEMA.PROCESSLIST order by user;