Wednesday, September 26, 2012

Recursive String Replacement

find /recursive/replace/directory/ -type f -exec sed -i 's/properlyescapedsearchstring/properlyescapedreplacementstring/g' {} +

by properly escaped, I mean using the backslash character(\) before special characters ( \. \/  \\ )
I should make myself a tool for this.

Installing the Papyrus Eclipse Plugin

The software source you will need is:
http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/juno/main

Then you will need to install the modeling libraries from eclipse.org. I ended up just installing them all.

For whatever reason, I did not have a 'palette' tool box on my first model. It is there now, I created a new specific model (use case checkbox) with basic primitive types (checkbox) and they were magically there-- if you don't see any way to add diagram graphics via the 'palette'.

About Cloned Wordpress Servers and Logging In to the Wrong Server

So, I cloned an entire server as a development environment.

On that server was a wordpress installation.

The server was logging in to the wrong wordpress installation.

There is probably a 'correct' way to do this. But I found the wordpress options I needed to change in the wordpress database in the prefix_options table. (We have prefixes set to ON for multiple wordpress installations. Our tables are prefixed and referenced with prefix_ prepended in this post.)

SELECT * FROM prefix_options LIMIT 0,20;

From there, you should see why your new wordpress is logging you in to your old wordpress...

Hint:
mysql> select * from prefix_options limit 0,20;
+---------+-----------+-------------------------+--------+
|option_id|option_name|option_value             |autoload|
+---------+-----------+-------------------------+--------+
|        1|siteurl    |http://notdevelopment.com|yes     |


mysql> UPDATE prefix_options SET option_value='http://development.com' WHERE option_id=1;


Monday, September 24, 2012

Changing the default user and group for files in linux directories

Issue this command to have new files in the directory get set with the owner the same as the owner of the directory

chmod u+s

or issue this command to have new files in the directory get set with the group that is the same as the group of the directory

chmod g+s

also restricting deletion by any non-owner or privileged user is chmod +t to set the sticky bit

Capitalization is used to show whether the execute permission is set or not since these settings show up in the same spaces as the execute bit.

Here are a few examples that you might see if you ls -la:

rwSrwSrwT
(that means rwxrwxrwx with uid, gid, & sticky set)

rwxrwSrwt
(that means rwxrwxrw- with only the gid & sticky set)

Followers