Howto make Mongo SSL on Ubuntu 12.04

To make Mongo DB SSL on Ubuntu 12.04 you need to either purchase it or compile from source.

To make compiling from source easy here’s a script to help you out!

Mongo Compile SSL from Source Script

Note: Make sure you are not running an EC2 Small instance or you will run out of space! . . . → Read More: Howto make Mongo SSL on Ubuntu 12.04

passing bash variable to perl command in bash script

Recently I tried passing a bash variable to perl command in bash script, it didn’t end well.

Troy Engel from http://tacticalvim.wordpress.com/ was nice enough to point out the issue:

use sed instead of perl for what you need; it’s simpler, faster and uses the bash variables easily.

I set up a test script /home/someuser/test.sh to show:

. . . → Read More: passing bash variable to perl command in bash script

php mysql update variable

Goal: Update wordpress post with PHP cli

sed delete all lines after

Objective: Prep dev httpd.conf for production

Tasks:

Remove jenkins virtual host entry (which starts with a comment line “#Start Jenkins”) Replace .dev with nothing (ex: www.dev.example.com becomes www.example.com) Replace debug with error (ex: Loglevel debug becomes Loglevel error) Sed to remove lines after match

In this example we will use sed delete all lines after . . . → Read More: sed delete all lines after

mysql insert cdn sync tool

To manually update the CDN Sync Tool table (for wordpress plugin CDN Sync Tool) try this MySQL Insert Statement:

Replace the id with the latest id on your table

To confirm your work:

redhat add multiple users

useradd script

to add multiple users to a system and force them to change their password upon login try the following script:

Redhat

The above script will add three users to the system (someuser anotheruser yetanotheruser) with the password “password” and set the password age to zero. This forces them to change their password . . . → Read More: redhat add multiple users

linux unwrap text file

I spent forever trying to figure out how to unwrap an apache access_log that was splitting requests between two lines. I finally found the answer!

Create a perl script called unwrap.pl and run the script like this:

Bash Server Backup Script

I’ve created a Bash Server Backup Script that will backup your MySQL databases (each database separately in to .sql and .xml files) and your main directories (/var/log, /var/www/html, /etc, /home, /root) to a timestamped directory. Feel free to re-use or hack up however you’d like

Here’s my Bash Server Backup Script: Download the script here . . . → Read More: Bash Server Backup Script

Reset mysql root password

To reset the mysql root password follow these steps 1. Stop running mysql instances

1a. If that doesn’t work then kill all running mysql instances

1. Stop running mysql instances

2. Start Mysql in safe mode

3. Run these command replacing somepassword with your new password

4. Start mysqld again . . . → Read More: Reset mysql root password

multiple reverse proxy host broken

Nathan Bridgewater explained how to configure multiple reverse proxies properly with apache and IIS (without losing original domain name).  I’m reposting this for myself to keep a record of this fine work.

multiple reverse proxy host broken iis serving up local server name instead of the ServerName that was originally passed to it. How to . . . → Read More: multiple reverse proxy host broken