writings

All posts tagged writings

After studying many photos from Valery Titievsky’s Photostream on Flickr over the past few weeks, I decided I would need to set a limit on the number of photos to include in this post or risk mirroring most of that stream here. Three is just not enough, so please click through each photo on Flickr and explore the other photos. I think you’ll find yourself, as I have, spending a lot of time there.

First, let’s start off with the photograph which first drew me in:

Coffee & ...

This is part of a subset of photos within the set “The life in Black & White” simply titled “Coffee & …”. There is a sense of motion which he captured well here by tracking the waitress as she hurried by while using a slower shutter speed to blur the background.

Here is another photo entitled “Coffee & … (Street Life)”:

Coffee & ... (Street Life)

Here we see a good use of bokeh with the string of lights out of focus in front of the subject, but what really draws you in is the emotion captured in this moment. Is this despair or simply fatigue? Did she discover her wallet is empty after having finished her meal? There is a story here, but it is incomplete, thus the photo holds your attention.

Although I was tempted to pick yet another of the excellent “Coffee & …” photos, I forced myself to pick more of a street photo. This one is called “Old Man”:

Old man

Digging into the exif information for this image reveals that the flash did not fire, yet we see some quite dramatic lighting here. There is an excellent contrast between the dark, almost ominous, sky in the background and the brightly lit face of the man. His age and hair bring complex textures into the mix. What is the story here? Is this a street corner preacher, giving his sermon to all who pass, hoping some will stop to listen for awhile?

I have yet to make it through all 1600+ photos in Mr. Titievsky’s photostream, but I have subscribed to the RSS feed from his Flickr page so I can keep up to date on his work. I encourage you to do the same.

I think I’ve picked an excellent photographer to open this Category on my blog: Mr. Flibble. Irreverent, wacky and whimsical, yet at the same time cerebral and engaging. I couldn’t help but browse his entire photostream — Yes, every single photo entered my irises and tickled my visual cortex.

At the risk of driving you away from my own blog, I’ll lead with some important links to his work.

Now on to my critique. First one, so it may be a bit rough. Please endure!

I think the best way to critique this particular photographer will be to select a spectrum of his work. While he may be gaining notoriety for his recent distorted, ‘shopped and humorous creations, I feel it is important to dig a little deeper and reveal the underlying talent and evolution which is evident by browsing further back in his photostream. To start, the photo that sucked me in:

383/730: New sulphuric acid diet was maybe too drastic

New sulphuric acid diet was maybe too drastic

But wait, there’s more. This photo grabs your attention and the caption is hilarious, but Mr. Flibble is not done with you yet. The description of this photo on Flickr continues to entertain:

Not all of us are given free rein to lunge, stretch and perspire over ever part of the asylum. And as such, even the normally enthusiastic Flibble is prone to the odd love handle.

Not odd in that away, you understand. I hear it’s perfectly normal for love handles to protrude 45 inches outwards towards the ears before circling back towards the pelvis.

Anyway… a diet was in order and this one seemed so easy: “Just take half a litre of sulphuric acid with each meal and snack, and see the weight fall off you” they claimed.

Perfect.

Not being one to disobey unfounded claims, I embraced this diet with much gusto – even snacking between snacks just to be able to imbibe more of this magical “acid” they talked of.

Weighed myself today.

Something may have gone wrong.

Even the scales seem to suggest this might not have been my most splendid of ideas…

*sobs*

I’m on Twitter: @IDrinkLeadPaint

Strobist:
Softbox camera left at floor-level on 2.0, Second softbox camera right at floor-level, stupidly set on 2.5. Triggered by cable.

Yeah, so when he’s done melting your brain with sulfuric acid, he goes on to give you some juicy, technical details of how he achieved this wonder by providing strobist info. How cool is that? Super Cool, my friend.

The photo and caption grabbed me, the narrative in the description drew me in, and the details kept me coming back for more. That wood floor as a backdrop. Rough-hewn, wide hardwood. The perspective, although head-on and dead center on the scale itself, draws your eyes down the tibiae toward the center. Even the reflection of the skeletal ribcage in the LCD display on the scale and the skeletal nature of the metal “ribs” on the surface of the scale (why are those there? Perhaps a BMI feature of this scale?) work to increase the interestingness of this image.

Now, on to another absurdity which grabbed my attention.

381/730: Advanced ninjaing

Advanced ninjaing

While I much prefer Samurai to Ninjas, I couldn’t help but chuckle at this one upon first sight. But, again, Mr. Flibble delivers much more than expected. His description starts:

Dr. White was such a quiet, neat and polite man and seemed the most unlikely person to provoke the wrath of the asylum’s trainee ninja department, but he did, and today he paid the ultimate price.

It goes on. Please click the image above to continue reading. I’ll wait here should you decide to return.

Ahh, thank you for returning! Black, white, grey and Ninjas? What more could you ask for, but Mr. Flibble delivers it all. I love the setup here. There is so much detail, you can keep coming back to find something new. The textures of Dr. White’s lab coat and the “poofs” on the plate in front of him. The contrast of the deep blacks — not only in the ninja’s uniform, but also of Dr. White’s glasses frames and the stems of the flowers in the vase. One could almost remove the Ninja and Dr. White and still have a stunning photograph.

And now on to some alternative samples from Mr. Flibble’s work which show the underlying talent, absent the absurd, but still retaining the whimsy and vision that pulled me in so much that I did view his entire photostream.

Gremlin or Mogwai?

Gremlin or Mogwai?

Everything about this photo works:

  • Shallow depth of field with well-chosen point of focus
  • Black backdrop and foreground
  • Inverted subject
  • Cute!

Yet it still retains the essence of whimsy without the patent absurdity of his later photos. I’ve started following Mr. Flibble’s RSS feed on Flickr in hopes of seeing more photos like this in the future — albeit intermixed with the funny and absurd.

Next up, the abstract.

315/365: Yolk folk

Yolk folk

From the brief description on Flickr, you get the impression that he considers this a “throw away” shot, but I feel it shows he has photographic vision. While hunting for subjects to fulfill his 315/365 Project, he managed to find this gem amongst the routine of his life. The lines, the color, the bubble and the lighting all converge slightly off-center for a wonderful composition.

What does a good photographer do when faced with a subject that has been captured so many times over and over? Change the perspective!

In the gutter of Cambridge

In the gutter of Cambridge

A Google search of “Trinity Lane Cambridge” turns up several photos, but none of them as interesting as this. The forced perspective makes the buildings shrink into the background, looking more like cut-outs than stone and mortar. Texture, form, shadow and light mix perfectly here. I find myself discovering new details with each view — a true sign of photographic genius.

Finally, a bit of social consciousness.

Feature creep

Feature creep

Juxtaposition, contrast, depth of field and social consciousness all in one? Yup. And all accompanied by a bit of poetry:

The endless pursuit:

More blades
More plastic
Batteries
More colour
More marketing spin
More money
More landfill
More complicated
More compulsion to upgrade
More more.

Where will it ever end?

Unfortunately, I think the answer to Mr. Fibble’s question is yes. Yes, it will come to an end, but not before it hyper-extends into the beyond!

368/730: Dartford tunnel

Background

I’ve been happily running this site on Textpattern (version 4.2.0) for a couple of years now with no issues or concerns. It has been a solid platform and I found a good template which I was able to customize to my liking. Recently, however, my wife has expressed interest in starting her own blog (more on that to come), and she wanted to use WordPress primarily because she had used it before.

Over the past couple of months, I’ve been working a lot with WordPress in support of Lori’s effort to bring her blog to life. We’ve been running an internal development site during that time to find the right theme, customize that theme, play with different post presentations and build some content prior to launching. She’s very serious about taking this blog live, so I figured I should probably get serious about learning as much as I can about WordPress.

This post is all about my experience converting from Textpattern 4.2.0 to WordPress 3.0.4.

Finding a Theme and Testing Migration

The first thing I did was install WordPress 3.0.4 on my internal server so I could play with different themes and test migrating my old content. Since I’ve been doing a lot more photography recently, I tried to find a photo-centric theme. After looking at four or five different themes, I settled on F8 Lite by Graph Paper Press. I’m a big fan of its clean, simple grid presentation and the focus on photography.

During my initial testing I discovered that the standard process for creating a child theme under which to make your customizations did not work. I’ve not figured out why it breaks, so for now I’m working with a full copy of the original theme. I’ll have to keep track of what I’ve customized so I can re-apply those customizations when an updated version of this theme comes out (hopefully that won’t be often).

Another issue I found while researching migration from Textpattern to WordPress is that the built in tools for Textpattern migration have been broken for quite some time. Some people have developed some work-arounds, but it seemed the process was hit or miss depending on the versions of each platform in use. I noted, however, that there was a generic import tool which would utilize the old site’s RSS feed to import posts. I tested this out and it worked very well. All the post content was imported (some caveats on that later) and only some minor formatting issues were introduced.

After playing with the F8 theme and my imported content for several hours I decided to go ahead and start the process of migrating my live site.

Migration Preparations

Any successful migration starts with a full backup of the old site so you can restore it should something go horribly wrong. Textpattern, just like WordPress, is a MySQL/PHP based site, so there really are just two things to back up: the database and the site files.

First, I backed up the database with the following:

mysqldump -u root -p txp_database | gzip -9 > 20110116_textpattern.sql.gz

Breaking that down, I called mysqldump with a root account, prompted for that user’s password (-p) and dumped the database called txp_database. Since mysqldump outputs to standard out, I piped that through gzip with -9 for maximum compression, then re-directed it into the final file. I like to put the date as the first part of a backup filename so it is easier to distinguish later if I have a bunch of backup files in the same location.

Next it was time to back up the textpattern site files. This contained all the PHP code plus all of the customizations I’d made to that code and the site graphics. After changing to the directory under which all this lives (varies by server configuration, but could be /opt/textpattern or /usr/share/textpattern) I then issued the following:

sudo tar -czvf /tmp/20110116_textpattern_files.tgz ./

Breaking down this sequence, I escalated my privileges to root with sudo, issued tar to create (-c) a compressed (-z with gzip, use -j for bzip2), with verbose output (-v), file with the given name (-f) containing the contents of the current directory (./). Note that I placed the output file in a different location than the current directory to avoid any problem with the tar process trying to recursively include its output file in the input. It would also be a good idea to move both the MySQL dump and this backup file to a common location for safe keeping — leaving either under /tmp is a bad idea because some systems clear the contents of that folder upon rebooting.

At this point, I could completely mess up Textpattern and I would be able to utilize the contents of these two files to restore it all back to its current condition.

Migration and Importing Textpattern Content

Once all the backups were out of the way, it was time to move the WordPress files and database from my development site to my “live” Web server. This was the tricky bit, as I discovered some of the initial setup was migrated with the database and there was no easy way to re-configure those settings. Most notably, the site URL kept re-directing me to my local dev site after I migrated the files. I ended up starting with a fresh copy of the database, but using my modified WordPress files. I had to re-configure the site and re-import the Textpattern content, but that was easy to do since I already had a dump of the rss feed.

First, I wrapped up my WordPress development files in a tar/gzip file, similar to backing up by issuing the following after changing to the root of the WordPress folder on my development server:

sudo tar -czvf /tmp/20110116_wordpress_files.tgz ./

I then copied that tgz file up to my server and uncompressed it to a WordPress folder by changing to that folder and issuing:

sudo tar -xzvf /tmp/20110116_wordpress_files.tgz

Next, I issued the following sequence to get into MySQL, then issue SQL statements to create a fresh database:

mysql -u root -p
create database wordpress;
grant all privileges on wordpress.* to 'wp_user'@'localhost' identified by 'wp_password';
quit

Breaking that down, the first line opens a MySQL command prompt with root privileges. The next line creates the wordpress database. The third line simultaneously creates the user ‘wp_user’ with the password ‘wp_password’ and grants that user full access to the wordpress database. The last line quites the MySQL interface.

At this point, my old Textpattern site was still live, but I had to configure the WordPress site. I decided to quickly switch over to the WordPress site and finish up the configuration. To do this, I simply had to edit my /etc/apache2/sites-available/default file so it pointed to the location of the WordPress site instead of the Textpattern one. All the rest of the settings in that file remained the same.

Once that was done, I hit the wp-admin URL to complete the site setup and create a site administrator user account. I then logged in as the site administrator and fired up the rss-importer plugin, which I had already installed as part of my development site, and it came over when I copied those files. But first, a word on getting that RSS content out of Textpattern. . .

The rss-importer plugin takes as its input an RSS XML file. In order to generate such a file from Textpattern, I had to go into the site settings and set the RSS feed to present all of my posts in the feed and set it to place the entire contents of each post in that feed. Once that was set, I visited the site and right-clicked on the RSS link, saving that link as a file called rss.file. Within my WordPress development site, I was then able to upload the contents of rss.file into the rss-importer plugin. Here are my caveats about this method and why it worked for me, but might not work for you:

  1. My Textpattern content was all code/text. All of my images were hosted from my Flickr account. I don’t believe site embedded pictures would have transferred with this method.
  2. There is a 2 MB file upload limit in WordPress. I only had 108 posts in Textpattern and the RSS XML file was under 500 KB. I believe you can increase the 2 MB limit, if needed.
  3. The import wasn’t perfect. Some formatting was lost. I spent a significant amount of time going through each of the 108 posts and adjusting the formatting. A better import method may have preserved this formatting.
  4. The categories did not import either. I had to go through all posts and assign categories and tags. I’m not sure if any of the other import methods would preserve categories. I wanted to re-work these anyway, so this wasn’t a big loss.

Aftermath and Conclusion

So, yeah, I had to touch every post and fix some formatting. I also had to set up new Categories and set tags on each post. Good thing I’m not a terribly prolific blogger, or I would have had some tough choices to make. As it was, 108 posts weren’t too bad. The later posts were more complex, requiring more attention. As the posts got older, there was less to do, so the last half to one quarter went a lot quicker.

Overall, I’m happy with the look of the site and the way this theme integrates with WordPress. As mentioned before, I still need to work out the child theme issue, but hopefully I can figure that out in my development site soon. I’m also going to dig into the CSS of the site and change up some of the colors. I don’t like the red article link headers and hyperlinks, and I want some of the fonts to be just a bit larger.

My work on this site will never be done, but that is the way of the blogger. . .

V. ENERGY
1. Sun Tzu said: The control of a large force is the same principle as the control of a few men: it is merely a question of dividing up their numbers.
2. Fighting with a large army under your command is nowise different from fighting with a small one: it is merely a question of instituting signs and signals.

Energy can be considered another word for efficiency. When it becomes necessary to scale things up, there are two factors which will ensure you lose as little efficiency as possible.

The first factor is how you break the smaller scale model into separate tasks or functions. For example, you may have an application which currently utilizes one or two servers with each of those servers handling several roles. A common model is to have a Web/application server at the front with a database/storage server at the back. As you scale up this solution, you will need to split out the Web service, application (there may be sub-roles here), database and storage roles . As scale increases even more you will most likely end up with many load-balanced Web front end servers; a number of application servers to support the front end and any application sub-roles; and a database back end with query, engine and storage roles residing on separate hardware.

The second factor is how you co-ordinate the communications between the various servers involved. If you started with an optimized, efficient small scale model, then this is simply a matter of mimicking calls that used to be local as network calls to the correct processes on the remote servers. If, however, your small scale design was rife with inefficient calls, that will translate to great losses in efficiency when you try to send those calls across the wire to other servers.

Therefore, it is essential that you take time to maximize efficiency on your smaller scale implementations prior to attempting to scale them up. Make sure to design your application with modules that can be separated later. Pay close attention to the communications which take place between modules that could be split out to different servers later. With your application broken into logical, separate modules which transfer only a minimum amount of data to perform their tasks, scaling up will be much easier.

Studying for LPI certification this evening, and I had a fit of whimsy whilst playing with regular expressions. Random thoughts passing through my head resulted in the following combination of “memes”:

  • Swear words in the linux kernel source code.
  • Britney Spears’ song, “If You Seek Amy.”

So I downloaded the source code (linux-source-2.6.28, Ubuntu), unzipped it and ran the following grep command against it:

grep -ri "<fuck me>" *

Amazingly, despite the prevalence of the just the swear word itself (33 variations including fuck, fucked, fucking, fucker, etc in 2.6.28) in the kernel, there was only one hit:

fs/binfmt_aout.c:               /* Fuck me plenty... */

So I guess a more apt title for this post is, “If you seek Amy Plenty.”

IV. Tactical Dispositions
1. Sun Tzu said: The good fighters of old first put themselves beyond the possibility of defeat, and then waited for an opportunity of defeating the enemy.
2. To secure ourselves against defeat lies in our own hands, but the opportunity of defeating the enemy is provided by the enemy himself.
3. Thus the good fighter is able to secure himself against defeat, but cannot make certain of defeating the enemy.

This section brings to mind the common phrase, “low hanging fruit,” which is often used in business and political circles to refer to easy targets for adding new business or reforming policies. What is often missing from those discussions, however, is the question, “How high are we capable of reaching?”

When cutting the budgets of time, resources and money for a project, the goal can quickly get out of reach. As the time allowance shrinks, you leave less room for planning which can cause a higher margin of error — thus requiring more time to fix. As resources shrink, either more time will be needed or more resources will need to be brought in near the end — most likely at greater cost. As funding is removed, the ability to respond to unforeseen issues (hardware failures, natural disasters, personnel issues, etc.) is greatly diminished and will result in the need for emergency funding.

Keep in mind, too, that the height of the low hanging fruit is relative to your own capabilities and the capabilities of your competition. Do not take on a project which, once initiated, could easily be taken over by a more capable competitor. At the same time, be on the look out for smaller competitors who have taken on more than they can handle.

The fruit which hang low today may be out of reach tomorrow. Be prepared to reach as high as you can, but hold back the temptation to reach too high — even if the project is just within your range.

Sun Tzu wrote:

III. ATTACK BY STRATAGEM
18. Hence the saying: If you know the enemy
and know yourself, you need not fear the result of a
hundred battles. If you know yourself but not the enemy,
for every victory gained you will also suffer a defeat.
If you know neither the enemy nor yourself, you will
succumb in every battle.

We assume that we possess an accurate understanding of our own skills and capabilities. Many people, however, tend to overestimate their own performance, skills or capabilities. When they do, they make a fatal mistake which guarantees they will never see success.

Take some time out of your busy schedule to assess and re-assess your own skills and capabilities. An excellent way to do this is to review and update your current resume at least once a year. That will represent your view (however accurate) of yourself. Once you’ve updated this document, make sure to seek honest feedback from your colleagues. Hand them a red pen and request they be as brutally honest as they dare. Promise to take their feedback seriously and without retribution. Their honesty (should they wield it) will certainly be difficult to swallow and could possibly shatter your self esteem, but you will be better off for the experience.

Next, be sure to obtain as much information about potential projects and teams with which you work. If your skills do not benefit the team or will not advance the project, you should bow out. You will have only a 50/50 chance of success and may end up damaging your standing with others. Beware that some people may misrepresent the scope or requirements of a project. Be sure you always set up an exit path to avoid those sorts of situations.

With a solid grasp of your own capabilities and enough research prior to taking on any project, you will succeed far more times than you fail.

Here are some hints and tips for those who are new to using ssh/OpenSSH for Linux system administration. Most of these tips have come from my recent work with a large number of Linux servers hosted on a VMware ESXi 4.x server farm.

Password authentication VS ssh key authentication

  • If you are administering only a few systems on a closed network (i.e. accessible only locally or by a secure VPN connection), then password authentication is probably OK, but you should consider using ssh keys anyway.
  • If your network needs to allow ssh access directly from the Internet or you are administering a large number of systems, then you should definitely use ssh keys.

Ssh-agent, scripting and cron

  • ssh-agent can save you typing in the password to your ssh key every time you need it.
  • This site gives a good overview of ssh-agent and includes some code you can add to your .bash_profile script to ensure your keys get added upon login.
  • Although there are hack-ish ways to get ssh-agent and cron to work together, you are probably better off setting up special keys to use with scripts that must be called via cron. Just keep in mind that keys without passwords are a security risk.
  • If you cannot risk using keys without passwords, consider running those cron scripts locally on each system. Utilize shared file space or e-mail to collect the results.

Bash one-liners and ssh with ssh keys

  • I’ve become a fan of using bash “one-liner” scripts to keep abreast of server stats such as load averages, available patches and disk usage.
  • Keep an up-to-date list of hosts in a file called hostlist.
  • Run your one-liners while ssh-agent has your ssh keys cached.
  • Here’s a template one-liner which checks uptime on each host listed in the file hostlist:

for e in `cat hostlist`; do echo $e; ssh $e "uptime"; done

  • In the above example, you can replace uptime with just about any command which exists on the remote host.
  • You can also synchronize some of the configurations under /etc with the above by utilizing either scp or rsync instead of ssh in that one-liner.

Turn your one-liners into scripts

  • If you find yourself using the same one-liner over and over, it is time to save yourself some typing and turn it into a script.
  • I like to keep these sorts of scripts under ~/bin. I also like to add that to my $PATH and create a simlink ~/scripts.
  • Some one-liners are good candidates to be turned in to cron scripts. Just keep in mind the risks of using ssh keys without passwords, and include logic to detect conditions you want to monitor. For example, you can run /proc/loadavg through awk to isolate one of the three figures and send yourself an e-mail if that average is too high.

Sun Tzu wrote:

II. WAGING WAR
6. There is no instance of a country having benefited
from prolonged warfare.

Avoid becoming involved in open-ended projects. Always insist on clear conditions or goals that indicate the project is considered completed. Make sure that deadlines and milestones are realistic and attainable.

No one wants to be involved in a project that is languishing. When deadlines pass and milestones are never reached, those involved in the project become demoralized. This is similar to laying siege. In Sun Tzu’s words from this chapter:

2. When you engage in actual fighting, if victory
is long in coming, then men’s weapons will grow dull and
their ardor will be damped. If you lay siege to a town,
you will exhaust your strength.

So, too will your team lose their enthusiasm and have their creativity become dulled when a project turns in to a siege. One way to combat this is to break a larger project into a series of campaigns with clear objectives which advance the overall goal. Be sure to celebrate the small victories along the way to assure morale stays high.

If you find yourself pulled in to an endlessly mired project, there is only one thing to do. Retreat! There is no advantage to be gained by soldiering on if the end conditions are not clear. Retreat, re-group, re-evaluate and create a new plan which contains clear, achievable conditions for victory.