jump to navigation

BOINC Logrotate gotcha January 31, 2008

Posted by gnukathryn in BOINC, Configuration.
add a comment

In a previous post, I provided the logrotate config file I use for BOINC.  One “gotcha” just popped up.  The script stops the daemon before doing the rotation and then starts it again.  If for whatever reason you manually stopped the daemon, when cron runs logrotate, the daemon will be restarted.  I’m investigating ways of dealing with this.

I’m sorry Dave, I’m afraid I can’t do that January 23, 2008

Posted by gnukathryn in Fundamentals, Terminal.
1 comment so far

OK, OK… sorry for the bad humor in the post title.

I’ve been diving into the intricacies of Unix permissions. Up to this point, I’ve been comfortable enough with both symbolic notation (rwx) and octal notation (1,2,4). I’ve been looking at a sandboxing scheme for BOINC. That has brought up a whole bunch of questions that I’ve been working on answering.

The first thing I noticed was the use of 4 digit octal notation. The second, third and forth digits are the file permissions I’ve been dealing with since the beginning. The first digit refers to the presence or absence of setuid, setgid and the sticky bit.

setuid and setgid change the ID a program runs under. In turn that allows controls access permissions. If you have a program you want to run as a regular user (a good thing) but it needs elevated privileges to do certain things, you can use setuid and setgid to give that program the permissions it needs. Remember though, it’s a good idea to only use that to the extent it’s needed. Elevate the privileges, do what you need to do and then drop them.

The sticky bit has two usages depending if it’s on an executable file (the original usage) or a directory (today’s common usage). If it’s on a executable, it allows the binary to be shared across users (or at least that’s how I’m understanding it). If it’s on directory it allows files to be locked down to the owner and the super user. So even if you have write permission on the directory, you won’t be able to move, modify rename or delete a file if you don’t own it.

There’s also some stuff on umasks I’m trying to understand, but that’s still all a bit hazy in my mind.

I never realized Unix permissions could get so complicated.

What I’m working on January 15, 2008

Posted by gnukathryn in Scripting, Software, Terminal.
add a comment

I have two ongoing projects. I can only work on them in small chunks of time because of real life commitments. Both involve scripting.

My first project that seems to have been going on forever is writing a script that will let me listen to an entire genre of music in mplayer. I run mplayer from the command line. I can make a play list that will play an entire directory. But my music is arranged genre – artist – album – track. I create the playlist by doing a simple ls > playlist. Easy peasy. But if I try that in the top directory, it doesn’t work so well. Actually, it doesn’t work at all even if you recurse down the directory structure. mplayer wants full path names, not relative ones. So I was going to write a script that created the playlist file for me. But no, I get the bright idea to make this a lot harder than it has to be. I’m now trying to get the playlist built on the fly with options to choose which genre of music I want to listen to. My current (very broken) script can be found here. There is quite a bit of stuff commented out because it just doesn’t work.

My other project was inspired by a post on the wordpress.com forums. The basic question is how to figure out who are the most frequent commenters on your blog. You can get an xml dump of a wordpress.com blog. It shouldn’t (in theory) be too difficult to write something in perl or python that parses the xml and gives that information. I’ve never coded a line of perl or python in my life. So on some advice, I’ve decided on perl for this little project. I’m just trying to get the basics into my brain at the moment. That and I’ve been looking a bit a libraries for parsing xml in perl, but they’re just a bit out of reach right now.

Kernel Source as Your Screen Saver January 10, 2008

Posted by gnukathryn in Installing, Nifty!, Software, Terminal.
add a comment

I came across this blog post in one of the feeds I read daily. I thought it was cool and I wanted to share. It’s a way to use the Phosphor screen saver that comes with xscreensaver to display a random bit of the Linux kernel source.

I have to admit, I don’t use a screen saver. They drive me nuts. My screen powers down after 1 minute. And I like it that way. But this is cool enough and novel enough that I might try it, at least for a few days.

The directions are written for a Debian based system, so I’ll have to play around a bit and see if I can get it to work with Fedora. But everything seems bog standard. It uses a small program the author wrote to display the contents of a random file in a directory (this will also help me out in some scripting I’m doing for mplayer).

It of course assumes that you do have the xscreensaver package and said package contains the Phosphor screensaver.  It also assumes that you have the kernel source on your system as well.  It’s also necessary to compile the author’s program (which should only be `make` and `make install`).

If  I get this to work, I’ll definitely report back.  I’ll also report back on Argument Shuffle.

Ruby January 6, 2008

Posted by gnukathryn in Ruby, Scripting.
add a comment

It’s been suggested that I stop abusing bash.  Hey.  I do my best.  I’m not a programmer.  I highly doubt I’ll ever be one.

A friend sent me a link to an interactive online Ruby tutorial.  It’s made by the same folks who wrote Why’s (Poignant) Guide to Ruby.  I skimmed through the book a couple weeks ago after seeing it mentioned on a blog somewhere.  I really liked the writing style.  That same style comes through in the tutorial.  If you can get me to laugh, then you’ll probably hold my attention.

I haven’t moved very far through the tutorial yet.  But I’m liking what I see so far.  We’ll see how it goes.