Author Archives: Randy

Pacemaker / Corosync / DRBD Cheatsheet

Monitor the status: crm_mon Migrate all resources to another node: crm resource migrate rg_main <fqdn_node_name> Take node offline and online (be careful, this sets a ‘prefer’ to the other node to force a transition, which may or may not get removed afterwards): crm node standby crm node online Start and stop all resources (warning, this […]

Exchange 2012 Allow Relay from IP

Enable mail relaying from a specific IP or range of IPs. 1. Exchange Management Console -> Server Configuration -> Hub Transport 2. New Receive Connector * Set remote network to the IP or range you want to allow relay from (default is any IP so watch out here) * “Externally Secured” authentication * “Exchange Servers” […]

Categories: Uncategorized. Comments Off on Exchange 2012 Allow Relay from IP

Increasing max files or folders per directory on Linux EXT filesystem

If a (poorly coded) app reaches the maximum number of files or folders per directory in Linux, you may see errors like this: Error happened when generating Download Link. Please try again or Contact administrator. (ERROR:mkdir) A quick and dirty way to increase the limit (and overall performance of the system) is to add the […]

Categories: Uncategorized. Comments Off on Increasing max files or folders per directory on Linux EXT filesystem

Strong Password Encryption in PHP

Don’t try to reinvent a complex and highly refined wheel, especially when customer data is involved. Please use phpass on any PHP project. (that’s PH-Pass) http://www.openwall.com/phpass/ Good reading for password hashing in general. http://www.openwall.com/articles/PHP-Users-Passwords

Categories: Uncategorized. Comments Off on Strong Password Encryption in PHP

Cpanel Apache Symlink Protection

wget http://layer1.rack911.com/before_apache_make -O /scripts/before_apache_make chmod 700 /scripts/before_apache_make ## Rebuild apache (might want to do it thru WHM instead) /scripts/easyapache –build

Categories: Uncategorized. Comments Off on Cpanel Apache Symlink Protection

AS Number Stats on Linux

I’ve got a couple of Linux machines that are sitting outside of the Sflow ‘zone’ and AS traffic stats go unmeasured. I wanted to get a rough idea on the number of connections per AS number so here’s a little app that parses netstat and sorts AS numbers by number of connection. NOTE1: This won’t […]

Categories: Uncategorized. Comments Off on AS Number Stats on Linux

Obfuscate or Encrypt Perl

There are 3 primary options: 1. Use PAR with PAR::Filter::Obfuscate or PAR::Filter::Crypto 2. Use Filter::Crypto::CryptFile (requires certain modules installed on target system) 3. Encrypt modules with Module::Crypt.

Categories: Uncategorized. Comments Off on Obfuscate or Encrypt Perl

Find symlinks on Cpanel

Find all possible root symlinks (leftover from attempted exploits) and save them as a list ‘symlinks.txt’. ls /var/cpanel/users | grep -v “\`\|\.\|cpanel\|root\|mysql\|nobody” | \ while read CPUSER; do find /home/$CPUSER -type l -not \( -lname “/home/$CPUSER/*” \ -o -lname “*rvsitebuilder*” -o -lname “[^/]*” -o -lname “/usr/local/apache/domlogs/*” \ -o -lname “/usr/local/urchin/*” \) ; done \ > […]