Thursday, May 16, 2013

Do-it-yourself uptime command for Windows 7

How long has my computer been running? A fundamental question that Unix-y systems can answer with the uptime command.

For some odd reason, Windows 7 has no built-in uptime command. You can simulate this by displaying the date and time Windows 7 last rebooted as reported by the net statistics command. Put this in a file named uptime.bat somewhere on your path:

@echo off
for /f "tokens=1,2,*" %%i in ('net statistics workstations ^| find "since"') do @echo %COMPUTERNAME% up since %%k

Then open a command prompt and type in the freshly minted command:

MYCOMPUTER up since 5/15/2013 5:21:27 PM

Saturday, May 11, 2013

Ruby, Ruby

You enter the j'Edit Five bistro from the steamy Paris evening. A sultry blonde, encased in a tight red dress, leans into the light over the toolbar at the far end of the room. She beckons to you with a heavy-lidded gaze, one eye obscured behind a curtain of flowing golden locks.

You step toward her, confident in that instant you're about to begin a beautiful friendship. You carry your plans and UML diagrams tucked inside the breast pocket of your jacket, a sheaf of ideas and ambition that only she can satisfy.

But as you draw near, you see the faint crow's feet around her eyes, the smudges on her dress, notice the style is seasons out of date. For the first time, you see the stringy, diminutive man in striped coveralls and a bill cap perched on the stool at her far side. A large red stone twinkles from the ring he twists around his pinkie.

You feel the heat from her body as you slide onto the bar stool beside her. "What is your name," you ask.

"Ruby," she breathes, "Ruby One Eight Seven." You inhale the cloying musk of her perfume, notice the slight trembling in her slim fingers as she lifts a tall flute of champagne to crimson lips. A trickle of moisture slides down the groove by her chin, spotting the front of her dress.

You try to mask your disappointment. You had so anticipated this meeting, a chance to make glorious music. But she is old, her skin creasing as she fits on a smile. She is deprecated, you think.

"And your little friend?" you ask, returning the railroader's nod.

"Him? He is only Rails Two Oh Three," her lip curls as she sneers. "He is just hoping to get lucky again tonight, but we are finished."

"You were so good together," you say, "I saw you performing together here years ago, up on the Web Two Oh stage."

"Yes," she says, "but I am tired. I live only to remember how I once danced here. The man who introduced us to j'Edit, he has gone away. And my younger sister, Ruby Two, has taken the limelight. Mais, she cannot dance here, my plugin is too old for her. So she prefers to dance for the Vim on Rue Rivoli, the Cafe Sublime, and le Palais de RubyMine." As she sweeps a cascade of gold away from her furrowed brow, the glitter of tears in her eyes reflects the flash of the red gems on her delicate earlobes.

You turn your gaze to the dim room. It is a good room, the windows edged with chrome, cups of Java steaming on the tables. Many coders and hackers huddle in booths by the glow of their screens, pecking out lines of Perl and Python, HTML and Scala. An aging XML roue nudges a tangled mass of angle brackets through the XSLT parser, chuckling as his XPaths return nodes.

"It could happen again," you say, "I could update the plugin to bring Ruby Two and her companion Rails Four back into the j'Edit. We could see them light up the windows again. She could parse, and colourize, and even debug in this room again. What do you say? Shall we find your little sister, and bring her back here?"

She tips her head back, stilling the quiver in her lip. "I will take you to the source, where we will set out the latest plugin for her, and repair the compiler errors and deprecations. We will update the mode to fit her. I may never dance here again, but my little Ruby Two, she will, and you will see to it. It will be her day, Ruby Two's day."

She demurs when you offer your hand. Instead, she lifts her satin clutch from the dark wood of the bar, and strides on her tall heels toward the door, a new vigor in her step. She pauses, and glances back at you. "Well, shall we?" she asks, not waiting for your answer as she exits, letting in the rush of traffic on the warm air.