Archive for the ‘Linux’ Category

PHP Project Management with Git and Capistrano

Sunday, March 28th, 2010 by Joyce Johnston

I really like using Git and Capistrano to manage my personal projects. If you’re not familiar with Git, it’s a version control system that allows you to track versions of your project. Capistrano is a Ruby utility that allows you to deploy your project to a production server from your local machine with a single command, and easily roll back to a previous version if something goes wrong.

Read more »

Two down. Three to go.

Thursday, October 29th, 2009 by tburns

I passed the CVOICE certification exam today, which doubles as my CCNA-Voice cert as well. I now have two exams of the five I need for CCVP: CIPT1 and CVOICE. Next up is CIPT2… which should be considerably more focused than the CVOICE material. I’ll try to get that complete before the end of November. That will leave me with the QOS and the Troubleshooting exams to round out the winter.

Upgrading wordpress: There are many paths to the mountain

Friday, October 16th, 2009 by tburns

Here is one way to do it that worked like a breeze for me. I upgraded from version 2.7 to 2.8.4. Here’s what I did:

There were three things I wanted to do with this upgrade. One, make sure I didn’t lose anything; two, be sure I had a backout/restore plan; and three, minimize downtime.
I. Backup the existing site files:
Do a mysqldump of the database and tar backup of all the site files:

mysqldump -u root -p tburnsBlog > /path/to/backupLocation/tburnsBlog.sql
tar cvzf /path/to/backupLocation/tburns.com.tar.gz /path/to/DocumentRoot/tburns.com

Read more »

Set your shell options to something useful

Monday, September 7th, 2009 by tburns

You can manipulate shell options to allow for more useful and intuitive function using the shopt command.

Copying Files:

In Fedora, by default, wildcard options with some file manipulation commands such as cp, mv, and rm will not copy the hidden files in the present working directory. This is because file globbing (pattern matching) is not set to expand hidden files. Suppose, for example, I wanted to copy the entire contents of this user’s directory to another location. The directory has a listing of files, both hidden and not hidden, as well as one subdirectory called documents/. Here is the output of a recursive listing showing all the files in the tree:

 [sshuser@localserver ~]$ ls -alR
.:
total 40
drwx------  3 sshuser sshuser 4096 2009-09-07 11:02 .
drwxr-xr-x 12 root    root    4096 2009-09-06 13:16 ..
-rw-------  1 sshuser sshuser  490 2009-07-29 12:20 .bash_history
-rw-r--r--  1 sshuser sshuser   18 2008-02-29 08:27 .bash_logout
-rw-r--r--  1 sshuser sshuser  176 2008-02-29 08:27 .bash_profile
-rw-r--r--  1 sshuser sshuser  124 2008-02-29 08:27 .bashrc
-rw-r--r--  1 sshuser sshuser 7023 2009-09-07 11:02 code-markup.php
drwxr-xr-x  2 sshuser sshuser 4096 2009-09-07 11:03 files
-rw-r--r--  1 sshuser sshuser  920 2009-09-07 11:02 traffic.dmp

./documents:
total 8
drwxr-xr-x 2 sshuser sshuser 4096 2009-09-07 11:03 .
drwx------ 3 sshuser sshuser 4096 2009-09-07 11:02 ..
-rw-r--r-- 1 sshuser sshuser    0 2009-09-07 11:02 .file-1.txt
-rw-r--r-- 1 sshuser sshuser    0 2009-09-07 11:03 resume.doc
[sshuser@localserver ~]$

Read more »

Renice 2: Even Nicer With Arrays

Tuesday, September 1st, 2009 by tburns

I put an entry out here that detailed how to find the process ID of a running process and then how to re-nice it from within a bash shell script. This first script referenced processes that could be identified by a single pid. But what about processes that spawn multiple pids, or multiple processes that are all named the same but are, in fact, separate instances?

Here is a small bash script segment that identifies process PIDs; puts them into an array; then uses that array to renice the processes. In this case, the processes are VoIP applications that use RTP (real time protocol), and, in particular SIP (Session Initiation Protocol) to put voice traffic on the wire and usually need immediate CPU access.

This script does many things before it gets to this point… we pick it up here at the renice process… Note that some of the variables you see here were instantiated early in the script. Also, to get the code to fit neatly on the page here, I took out a lot of the formatting of the echo statements that allows for clear logging…
Read more »