Category Scripts

php mysql update variable

Goal: Update wordpress post with PHP cli < ?php $con = mysql_connect("localhost","root","[redacted]"); if (!$con) { echo "Unable to connect to DB: " . mysql_error(); exit; } if (!mysql_select_db("wordpress")) { echo "Unable to select mydbname: " . mysql_error(); exit; } $myfileText…

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…

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…

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…

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…

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: . -s (source_user) -d (destination_user) #Note: the bin bath of teamsite…