Blackhatgk's Home

System Administration

Plod Update

by on Jul.01, 2005, under System Administration

Well, I’ve been working with Plod today and after typing up that tutorial I decided that no one should have to experience that pain and suffering again… So I’ve created a port for the plod program and submitted it to FreeBSD.org. Hopefully they will accept the port and Plod will be added to sysutils/plod. What this means for everyone is that once it is in there all you will have to do to install plod is just:

cd /usr/ports/sysutils/plod
make install

And be done with it… Wooo Hooo… And the best part is if it is accepted I will get my name on the official FreeBSD contributor’s list.

Bookmark and Share
Leave a Comment more...

Installing and Using Plod on FreeBSD

by on Jul.01, 2005, under System Administration

For those of you who do not know what PLOD is…

PLOD is a tool designed to help administrators and others keep track
of their daily activities. Since your management will typically have
no idea what you are doing to justify such an exorbitant salary any
amount of money they may be paying you being classified as
“exorbitant”
, and since most people forget what they do themselves,
it’s good to keep a record. Trot your logs out around performance
review time, and show them to your management after suitable
sanitization
on a regular basis.

Being a relatively good FreeBSD user, but not an expert by any means I found the installation of this tool to require learning quite a few new aspects of FreeBSD. As such I thought I would offer what I’ve learned and how to install Plod here.

**********
Retrieving Plod
**********

The first problem the average user is going to have with using Plod is finding Plod. It’s not located in the ports directory, google links thousands of references to people plod’ing this or plod’ing down so much money for that. But very few references to the actual Plod program that we want. After some research I discovered that the official location for Plod appears to be:
http://www.deer-run.com/~hal/plod/plod.shar

So go ahead and fetch or wget that file to your system to continue:

fetch http://www.deer-run.com/~hal/plod/plod.shar

*********
Extracting Plod
*********
For me at least, this was my first time coming into contact with a .shar file. I had no clue what one was or what the hell to do with one. So I took another trip to google… And found out that .shar stands for Shell Archive and its not really a compression scheme but just a packing scheme. So the next step involved with installing plod is going to be to unwind the package:

cd to your home directory
cd ~
make a new directory for temp storage
mkdir plod
cd to the new directory
cd plod
Extract the file, in my case I fetched the file to my home directory, hence the ~/ in the path
sh ~/plod.shar

And now you are done with the extraction process.. Move along…

***********
Installing Plod
***********

Being that plod is/was a tool primarily designed for system administrators and attempts to remain as system neutral as possible.. There are no installation files, no installation documents, nothing… I know.. Gasp.. How could they? But they did… So this is what you need to know about FreeBSD to proceed…

Contrary to what you might have thought so far about FreeBSD’s file structure being an organized wreck, FreeBSD is very structured. Each directory does have a purpose and a meaning and each of the files can easily be copied to their respective locations.

/usr/local/bin
This directory is commonly used for locally compiled scripts and programs that were not initially offered by the Operating System. This is where I will choose to install the executable file for Plod. Now some of you may be asking about /usr/local/sbin. This is also a suitable place but this is usually for system administration tools only. Now even though Plod is a great system administration tool, it is also just a great tool that can be used by everyone on the system, hence why I chose bin instead of sbin. To install the plod executable in /usr/local/bin follow these steps:

Just in case you got lost and wandered to another directory while reading this
cd ~/plod
Got to make a simple change to plod to make it run on FreeBSD, being that this is an install document not going to take the time to explain vi or emacs. Just use your favorite editor to change line the following line
$CRYPTCMD = “/bin/crypt”;
To this:
$CRYPTCMD = “/usr/bin/crypt”;
Your installing a file /usr/local/bin, you are going to need the big boots to do this, in my case root cause I got the biggest boots of all
su
Enter your big boots password
Now you can copy the file
cp plod /usr/local/bin
On my system, cause I copied the file over there as Mr. Big Boots, the file retained his permissions, but you should make sure the file isn’t owned by anyone or anygroups that might modify the file and break it or your system
ls -lh /usr/local/bin/plod
-rwxr-xr-x 1 root wheel 27K Jul 1 08:03 /usr/local/bin/plod
If your file is not owned by big boots and his group of friends then: chown root:wheel /usr/local/bin/plod
You will also want to now set your file to the right permissions, by default mine is already correct, but lets do it again anyways
chmod 755 /usr/local/bin/plod

And now technically you are done with plod… But wait.. what if someone wants to know about this great tool and how to use it? Well then your going to have to install the man page… On FreeBSD systems the Man pages are located in the /usr/share/man directory. In this directory you will notice cat# and man#, the # refers to what type of program it is. To give you a quick rundown:

Number Description
—— ———–
1 General Command
2 System Calls
3 Library Functions
4 Kernel Interfaces
5 File Formats
6 Games
7 Miscellaneous Information
8 System Manager’s Manuals
9 Kernel Developer’s Manual

Obviously this is not a Game so this is going to go into the first man directory. The next thing you need to know about man pages is that they are usually Man Sources and on FreeBSD they are Man Sources GZipped. So lets get started shall we:

Did you wander off again?
cd ~/plod
Lets gzip this to save that ohh soo precious space
gzip plod.man
Wait a minute now it’s called plod.man.gz, we want plod.1.gz
mv plod.man.gz plod.1.gz
Finally lets put it where it belongs
cp plod.1.gz /usr/share/man/man1
And lets check those ohhh so important permissions
ls -lh /usr/share/man/man1/plod.1.gz
-rw-r–r– 1 root wheel 5.5K Jul 1 08:18 /usr/share/man/man1/plod.1.gz
Uhh Ohhh… Although this will technically work… If you check the other man pages you will see that they are: -r–r–r–
chmod 444 /usr/share/man/man1/plod.1.gz

That’s better… And now the man pages are done…

**********
Emacs Editor
**********
Ok, so my new friend is Emacs… I was a huge fan of VI but emacs has taught me that things can be just as powerful as VI but easier.. But yet harder… but yet easier.. I know, it’s an internal struggle that should be straightened out soon… We will see who will win…

Emacs has editor features that allows it to format text for you. And of course plod came with these nifty plod.el.v1 and plod.el.v2 files which means nothing to us.. Upon further investigation though it appears that these are Emac formatter files and should be installed in the lisp directory. The question is.. Which one… Being that v2 appears to stand for Version 2 I am assuming it is better so I will use that one.. If you like classic stuff try v1…

Emacs uses a directory on FreeBSD called /usr/local/share/emacs/site-lisp/ for storing these magical files. So here we go again:

Stop wandering away from home
cd ~/plod
Copy the file where it belongs
cp plod.el.v2 /usr/local/share/emacs/site-lisp/plod.el
Fix them pesky permissions
chmod 444 /usr/local/share/emacs/site-lisp/plod.el

*******
Conclusion
*******

That should be all you have to do to get this Plod software up and running. Of course I’m just a user like you so who knows… If I find any errors I’ll update it here.. If you have any questions or comments on the install let me know and we can try to get this document updated so its as complete as possible.

********
Stay tuned
********

Next time I hope to actually spend an entire day doing administrative things and use plod to track them and show my boss how productive I can be, I’ll be sure to include a write up of that too so you can see how to effectively use Plod now that you have it working.

Bookmark and Share
Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...