Author: jbmurphy
-
A script to loop through a WordPress database and search for text
We maintain both a WordPress development environment and a production environment. I have written a script that copies a WordPress site to the local machine. In that script I change the GUID (even thought this page says you shouldn’t), siteurl, and home. I change the GUID, because the site has not been publicly accessible, so I…
-
Xcopy vs Robocopy
This is news to me: “Xcopy fails with insufficient memory when the path plus filename is longer than 254 characters” Robocopy it is from now on!
-
PowerShell: Two functions to determine if a user is visiting the office
If you have users in distribution groups associated with each site in your organization, it should be easy to tell if a user is visiting from another office (more on why I want to do this later). First function returns the current site that the user is logging into: The second function loops through all…
-
PowerShell to verify ACLs (permissions) on a folder
In my previous post, I showed how to create a new ACL and apply it to a folder. Why apply it to the folder if the folder is already set correctly? I wrote the following function to compare the ACLs of a folder to a desired set of ACLs (either created by hand (lines 3-12) or…
-
PowerShell to assign permission to a folder (not copy inherited permissions)
In my previous post, I used PowerShell to change the permissions of a top level folder. In that script, I took the folder in question and copied the inherited permissions to it, and then I tinkered it to be what I wanted. I wanted to do something similar, but I wanted a set of permission…
-
CentOS 6 in a VM – Console resolution
I can NEVER remember this, and every time I re-install CentOS in a VM I have to go searching. If you want the console size to be larger in a vm add vga=791 (for 1024×768) to the end of the kernel line in /etc/grub.conf. The VESA values (for linux) are here
-
How to add Gnome to a CentOS 6 minimal install
I have been using the minimal iso (CentOS-6.0-x86_64-minimal.iso) to install CentOS 6. I wanted to add a GUI to my vm, but I could not find easy documentation showing how to add a GUI, or Gnome in this case, to a CentOS 6 minimal install. I was not looking for the smallest X windows install,…
-
Back to 2000 visitors a month!
September and October we light. Backup up at 2000 for November! I better get busy if I ever want to hit 3000!
-
PowerShell: Return, ForEach,ForEach-Object and a pipe
I just figured this out late last night. I was pulling my hair out. If you look at the following PowerShell code You get a result of: 1 2 3 4 5 Next, if you look at this code (the only real difference being the lack of a pipe.) You get: 1 2 3 That…
-
PowerShell code to split a space delimited string – with double spaces
I am working on a PowerShell wrapper script to run multiple commands on multiple machines. The first thing I wanted to do was to chop up a space or comma delimited argument. (If you make an argument mandatory, and the user does not provide it, PowerShell will prompt you for it – and when prompted…
