rollback httpd.conf changes on error

To rollback httpd.conf changes on error use this script: #!/bin/bash #File: deploy_new_httpd_conf.sh #Define this PATH_TO_NEW_HTTPD_CONF=”~” #Backup old httpd.conf file /bin/cp -f #Copy new httpd.conf over the existing one /bin/cp -f ${PATH_TO_NEW_HTTPD_CONF} #Test the Syntax /usr/sbin/apachectl -t if…

wget warm drupal cache

Objective: Warm Drupal Cache I wrote this script to warm the cache of a drupal site Script Contents #!/bin/bash -ex # Locate the binaries MKDIR=”$(which mkdir)” RM=”$(which rm)” WGET=”$(which wget)” #************************************ #### YOU MUST DEFINE THESE PATH_CACHE_ROOT=”/root/some_dir_name_to_store_data” PATH_LOG_FILE=”” URL_TO_CACHE=”” USER_AGENT=”Mozilla…

Howto use command line SVN on Mac OSX

[wp_ad_camp_2] Objective Use the command line SVN client on Mac OS X Subversion was built to be used with the command line subversion client (not the bastardized GUI clients that are being sold on the market right now). As such…

psexec icacls remote computer

Set proper permissions in IIS 7.x on a remote computer We will be using psexec icacls on the remote comptuer Objective: Grant NT AUTHORITY\NetworkService the proper permissions for a particular website on “somecomputer” using credentials “somedomain\someuser somepassword” The Command to…

Websphere Stop All Servers Script

Here’s a ksh script to stop all running websphere servers. Booyah! #!/bin/ksh # # This script stops all running Websphere servers # cd /opt/ibm/WAS70/logs servers=`echo *Node*` cd /opt/ibm/WAS70/AppServer/profiles/AppSrv01/bin for server in $servers; do pid=`ps -ef | grep $server | grep…

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`,…

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…