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

Manually insert row to cdn sync table INSERT INTO `wordpressdb`.`prefix_cst_new_files` (`id`, `file_dir`, `remote_path`, `changedate`, `synced`) VALUES (1567,’/full/path/to/file/filename.txt’,’filename.txt’,’1345062888′,’1′);

To confirm your work:

SELECT * FROM `wordpressdb`.`prefix_cst_new_files` where . . . → Read More: mysql insert cdn sync tool

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 # for name in someuser anotheruser yetanotheruser; do useradd $name; echo ‘password’ | passwd –stdin $name; chage -d 0 $name; done

The above script will add three users to the system (someuser . . . → 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:

# perl unwrap.pl access_log > accesslog2 #!/bin/env perl use strict; my $sentinel = 0; my $previous_line; my $result . . . → Read More: linux unwrap text file

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 # service mysqld stop 1a. If that doesn’t work then kill all running mysql instances # pkill mysql 1. Stop running mysql instances # service mysqld stop 2. Start Mysql in safe mode # mysqld_safe –skip-grant-tables 3. Run these command replacing . . . → 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

copy teamsite user

To copy teamsite user permissions i’ve written a python script.

You’ll need to replace the path with the path of your teamsite’s bin directory:

#!/usr/bin/python #Script Name: copyTeamSiteUser.py #Use: ./copyTeamSiteUser.py -s (source_user) -d (destination_user) #Note: the bin bath of teamsite was hardcoded, please replace /opt/iw-home/TeamSite/bin # path of your teamsite’s bin directory #Author: Steve Stonebraker . . . → Read More: copy teamsite user

parse apache access log entries to find top user agents, top urls and top IPs

This script will allow you to see the top user agents, urls, IPs for your log files:

 

Script name: ls-httpd

#!/bin/bash # Usage # ls-httpd type count # Eg: # ls-httpd url 1000 # will find top URLs in the last 1000 access log entries # ls-httpd ip 1000 # will find top IPs . . . → Read More: parse apache access log entries to find top user agents, top urls and top IPs

active directory disable users older than x days

Script Details

This is example will show you how to disable folks that have a password older than x number of days AND / OR have not logged in for X number of days

Requirements ActiveRoles Management Shell (free) Powershell Server 2003 or Higher Domain Controller Example Script

Filename: C:\1audit\scripts\disable_accounts_password_age_greater_91_days.ps1 Description: (Disable users that have . . . → Read More: active directory disable users older than x days

kill liferay script

Here’s a bash kill liferay script!

This should kill any running liferay or liferay social office on a linux system.

Open up your favorite editor and paste this in

#!/bin/bash # #Script name: kill_liferay.sh # #Purpose: To kill any running instance of liferay on a linux system # #Usage: ./kill_liferay.sh # for pid in `ps . . . → Read More: kill liferay script