a skeleton and a pirate walk up to a door…
Monthly Archives: October 2010
carver
Evan concentrates as he carves his first solo pumpkin. He designed the face, sketched it out, and carved it all on his own.
moroccan
we headed out to the Moroccan Castle for dinner tonight. Evan is now a big fan of chickpeas, couscous, and eating in fake tents.
Easy server monitoring script
I manage or monitor a few servers, and it’s a good idea to keep an eye on how they’re holding up. The Linux uptime
command is all I need – show me how long the server’s been up (or if it’s cycled recently – power hiccup?), and CPU load averages.
I just whipped up a dead-simple solution to let me embed the uptime reports from the servers into my retro homepage.
I’m quite sure there are better and/or more robust ways to do this, but this is what I came up with after maybe 2 minutes of thought.
On each of the servers, I added a shell script called “uptimewriter.sh
” (in my ~/bin
directory, so located at ~/bin/uptimewriter.sh
). I made the file executable (chmod +x ~/bin/uptimewriter.sh
) and used this script:
#!/bin/sh
echo "document.write('"`uptime`"');"
All it does is wrap the output of the uptime
command in some javascript code to display the text when embedded on a web page. I then added it to the crontab on each of the servers, running every 15 minutes, and dumping the output into a file that will be visible via the webserver.
*/15 * * * * ~/bin/uptimewriter.sh > ~/public_html/uptime.js 2>&1
Every 15 minutes, the uptimewriter.sh
script is run, and output into a javascript file that can be pulled to display on a web page.
Then, on my retro home page, I added code to run the javascript file:
<script src="http://home.darcynorman.net/uptime.js" type="text/javascript" charset="utf-8" async defer></script>
When called from a web page, that will render the output of the uptime
command, wrapped in a document.write()
call as per the uptimewriter.sh
script, displaying it nicely:
I can do some more work to style it a bit, so it wraps more nicely, but it’s a decent start.
parked
the province denied my driver’s license medical renewal, so I get to stay parked until it gets reviewed. bureaucracy is awesome.
Tips for using WordPress as a website manager
I’m working on a project that involves building a website to organize and present a bunch of content. We could do it in raw HTML, but it makes more sense to use a content management system. We could do it in Drupal, but my ability to make Drupal look good is somewhat lacking. So, I’m using a site on UCalgaryBlogs to take advantage of WordPress’ content management features. Here’s the basic how-to:
Basic setup:
First, create a page. Creatively call it “Home” or something. Go to Settings > Reading and set it as the front page.
Next, create your content as pages. Take advantage of WordPress’ parent-page feature to nest the pages as deeply as you want. I disabled comments and trackbacks on all pages, to keep it cleaner (and nobody’s likely to comment on the pages anyway – we’ll provide a feedback system for that).
I am using (at least for now) the default twenty-ten theme. It’s pretty complete, and looks great. Pages show up in the main navigation bar, and get full drop-down hierarchical menus built for them.
Enable the Pages widget under Appearance > Widgets. Makes it easier for people to scan to find a page, without having to hunt and seek through all drop-down menus. It’s trivial to provide both ways of navigating.
Plugins that help:
- Bunny’s Print CSS – make it look good if people decide to print stuff.
- Explanatory Dictionary – automatically provide definitions for words and phrases, using a central glossary.
- Markdown for WordPress and BBPress – minimize the use of angly brackets as much as humanly possible.
- Next Page – provide next/previous/parent links to help people navigate through a bunch of content without hunting through menus.
- Xavin’s List Subpages – provide a list of subpages on a page, for handier navigation of sections of the site.
With that in place, WordPress becomes a very robust content management system. Much easier to build a website with a team of people through WordPress, than it is to collaborate over static HTML or some of the other options. Easy.
funkfog morning
a thermal inversion hung over the city, trapping the stink beneath the clouds. the valley stunk like rotting farm gas.
cotton
colourful supplies at the local medical clinic
McLuhan’s global village, ca 1960
Stephen posted a link to this newly rediscovered video of Marshall McLuhan discussing media on CBC’s Explorations documentary series in 1960. This was 4 years before Understanding Media was published. It’s well worth watching. It strikes me that this kind of deep, theoretical presentation/discussion would likely be impossible to broadcast now.
UPDATE: As of October 27, 2010, the video was taken down from YouTube, due to a copyright violation claim by CBC. I suppose they’re planning to rebroadcast the 50 year old video at some point?
I’m sure McLuhan would have something to say about the message of copyright takedowns and the ephemeral nature of corporate digital media.
morning snow
we had a surprise dump of white stuff overnight. the roads and paths were clear, as latent heat melted it quickly, but it accumulated everywhere else.