DSwain- The New Day

Sunday, May 28, 2006

Slow Updates

Yes, my updates have been slow to say the least. Twenty days ago was the last time I wrote an entry. I've been enjoying myself for the most part recently, or trying my best to. Things have been getting busy over the past 20 days or so. Sometimes, stressful and upsetting, or at least watching others around me, but times have been moving along at least. First off, I'm planning on buying myself a laptop. I intend to use it next year quite frequently, at least for the first semester. I need it because for a semester-long school project I'll be doing next year, and well I don't feel like dragging around a desktop from home and school often. Anyway, the deal I've managed to dig up is this one: Dell Latitude CPx which should be quite impressive for the price and pretty much exactly what I need. I intend on buying it sometime today. That should be neat.

In other news, I now officially have a real job. It's at a local ISP. I used to use the service often, so it's neat to be in the command post almost now of where I used to be. I've only worked one day so far, but everyone seems to be real helpful and nice. I think it'll be a nice place to work for a while. I'm not quite sure what my schedule is going to look like thus far, but it won't be a big issue over the summer.

Aside from those things, marching band has started back up somewhat again. I have a parade to do tomorrow, and then another one on June 10th. We'll see how those go... I imagine fairly well. The season coming up next year should be real neat. Going away for band camp, a new (and real nice) drum instructor so we'll see what happens with that. Carolyn and I have been going out for over eight months now. That's been nice also, so I'm happy with things. Sometimes stressful situations come along, yes, and I need to learn to keep my mouth shut sometimes also yes, but things have been nice. Finally, I've been working on my actual website (swainnet.zapto.org) quite a bit. I taught myself some more HTML so I've improved the website a little bit. I should teach myself some more things (PHP maybe) for my new job, but improving my HTML was the first step in the process.

I have to admit it's getting better, better, all the time

I guess that gives you a good run down of things to come. In about two or three weeks, school is over. One more year after this... wow. Gotta start working on more college stuff too this summer. I have to look at a few more places and such. I'll update more on that at another time. I'll try to write sooner again, folks. Peace.

Monday, May 08, 2006

Creating a Status Page via Bash & HTML

Realistically, this is a pretty cheap way of doing this. I've seen much more professional method of doing this, but my method happens to work (with proof, even). And so, here we go:

To break this down into a basic form, what happens is that this script that I wrote does a run through of a variety of different elements throughout my machine to list as status, and then redirects that output to an HTML file. The HTML file, in turn, is moved over into its correct location on the server to be updated. This process is computed once every minute via crond.

First, we begin with the bash script. I just added some things which I thought were important for reading the status of a server for a user. This consists of programs like uptime, df, free, and uname. This is the exact script code.

As you can see, many of the commands are common coreutil/system commands which aren't very uncommon. These are outputted to an HTML file along with the tags to make things bold, add spaces, and so on. I wrote the code to add spaces as functions so the code was more clear.

Next, on your machine you need to set up cron. Cron is a daemon system which puts a command on a schedule to run at certain times. You can have it do anything from running at every minute to running once a year with it. It's a rather flexible code, but it's a little confusing to understand by just reading a raw example. What you do with crond is write crontabs. Crontabs are basically small files which specify the user which the command is running for, the times which it should run, and what the actual thing to run is. My example looks like this:
* * * * * sudo /srv/www/htdocs/stats_script
This basically says that there are no specific times to run other than every minute, and to execute the command sudo /srv/www/htdocs/stats_script which handles the rest. Once you write this into a particular file, you run the command crontab filename which in turn adds the command to the appropriate crontab file. This file is read by crond on a minutely schedule and runs the command.

The result of all of this? Here it is.

Tuesday, May 02, 2006

Whoops!

Forgot to post in a while. I meant to a couple of times over the past week, but it kind of got away from me. Sorry about that.

First off, happy birthday to Carolyn (yesterday) and also Chris (today) if they're reading this even. Yay birthdays!

Moving on though, lets see. I've been looking at colleges and stuff still. Tomorrow I'll be looking at Marist College, which looks like a very nice and pretty promising school. We'll see what our visit shows us, though. College searching is getting annoying, and really less promising all the time. It seems like everywhere I look, I don't meet the "requirements" of some school or am going to be missing some key ingredient from becoming a member at any of these schools. It's kind of annoying, but that's alright because it'll work out in the end anyway. I try my best to live for myself on my own terms, so I'll try and not let something like that dictate how I feel about living.

What else can I talk about? Hm... well summer is coming up quickly. It's a good and bad thing at the same time. I'm happy that this year is ending finally, but this summer and next year (and years to come I suppose) look like challenging times ahead which I personally don't want to deal with too much. Well, I honestly do to some degree, but I get the feeling that most things in the next school year will carry many unimportant and irritating pieces to it. At any rate though, you've just gotta look at it positively I suppose. It'll be fine, if not fantastic, so there's no need to worry.

That's about all I have to say. Oh, one last thing. If you ever wanted to organize your schedule at all, but don't like real calendars or external programs to do it for you, Google Calendars is a nice alternative to use. It's fairly simple, but it's nice and easily accessible which gives it an upper hand from the starting gate.

Peace.