Browsing the blog archives for November, 2008.

Subversion – Checkout Older Revision

Examples

The SVN syntax for reverting to a previous version of a file is less than obvious. If you want to pull down a previous version of a file type you must first choose a version:

svn log FILE_NAME

This will list all the changes to the file. Next, you pick the revision you are interested in and then type:

svn up -r REVISION_NUMBER FILE_NAME

This will pull down the older version/revision of the file. Next, we are going to rename the file:

mv FILE_NAME FILE_NAME.good

The next step is to pull down the current version of the file:

svn up FILE_NAME

After that is done we are move the “good” file on top of the latest version:

mv FILE_NAME.good FILE_NAME

Now commit the change:

svn ci FILE_NAME

It seems like there should be an easier way without merging so if anyone knows an easier way, please post it!

No Comments

Linux Process Thread Count

Examples

On Linux, to get a thread count for particular process, issue:

ps UH p PID_OF_PROCESS | wc -l

Removing the pipe to the “| wc -l” yields more information about the running threads.

No Comments

MySQL Increase Column Size

Examples

An example of modifying a MySQL table to increase a VARCHAR column size:

alter table TABLE_NAME modify COLUMN_NAME VARCHAR(1024) NOT NULL;

This increases COLUMN_NAME to 1024 characters.

No Comments

MySQL Drop Unique Constraint

Examples

In MySQL 5.0 it is possible to drop unqiue constraints but, the syntax is not incredibly intuitive.

alter table TABLE_NAME drop index UNIQUE_CONSTRAINT_NAME;

Code Ghar provides a more thorough description.

1 Comment