Rebooting and Shutting Down via Command Prompt

When I originally found myself needing to reboot a machine via Remote Desktop, I realized that the shut down option was removed from the Start menu. Instead, I had the option to end my Remote Desktop session, nothing else. CTRL+ALT+DEL understandably didn’t work, as my local machine interpreted the key combination, not the remote machine. Without an obvious solution at the time, I remembered that there was a command line executable that could be used to shut down. The executable worked so well that I put batch file shortcuts on the desktop of the machine, allowing me to either restart or shut down the machine with a simple double-click. Seeing as this proved useful to me, I thought I would share how to do it.

To reboot the remote machine, simply use the following command in its Command Prompt.

shutdown /r /t:1 /y

There are three arguments being specified here: the first tells the shutdown executable that you want to reboot, not shut down. The second tells it to wait 1 second before shutting down, rather than the default 20 seconds. Finally, the third tells it to automatically answer “Yes” to any questions asked by the operating system when shutting down. The latter may speed up the operation, but you may lose any unsaved changes.

To shut down, simply use the following command:

shutdown /t:1 /y

That’s all there is to it. For more information about the shutdown comment, see this Microsoft Support article.

After using this approach for a month or so, I discovered that there was a way to use CTRL+ALT+DEL in Remote Desktop. Instead of CTRL+ALT+DEL, simply press CTRL+ALT+END, and the remote machine will behave as if it received a CTRL+ALT+DEL signal.

Comparing Files and Folders With WinMerge

Before I started working for my current employer, I hadn’t yet discovered how useful differencing tools could be. As I began working regularly with Visual SourceSafe 6 at work, I grew to value the fact that I could check for differences before every file check in. It was a standard for my employer, but to me, it was a process I was getting used to. Eventually, I realized that I needed a stand-alone comparison tool, in case Visual SourceSafe wasn’t around. This eventually lead me to a WinMerge, an open source differencing and merging tool.

Win Merge User Interface

There are numerous reasons why I like WinMerge. Most of all, I really appreciate the contextual options. With files, I can select any difference within a file, and choose to copy it from one file to the other, without leaving the application. With folders, similar functionality is available… I can copy, delete, compress, or move any given file difference from one side to the other. There are plenty additional features beyond that, but for the sake of brevity, I’ll make this simple: WinMerge is a tool I highly recommend for developers everywhere.

If you’re not yet convinced, I should probably mention that it can be used with Subversion. This works in Windows specifically, provided the TortoiseSVN shell is installed. TortoiseSVN allows the user to use an external comparison tool, rather than the built-in application, TortoiseMerge.

To register WinMerge instead of TortoiseMerge, follow the steps below:

  1. Right click anywhere in Windows Explorer, and select TortoiseSVN -> Settings.Configuring Subversion to use WinMerge as a diff viewer
  2. Expand the External Programs section.
  3. Select the Diff Viewer option.
  4. Select the External radio button in the Configure the program used for comparing different revisions of files section.
  5. Press the […] button to browse to point to your WinMerge executable. In my case, this was the path: C:Program FilesWinMergeWinMergeU.exe

Pinning Tabs in Google Chrome

Today, I discovered a feature in Google Chrome that had somehow eluded me to this date. If you right-click any tab, several contextual options will be listed. Most of these are fairly standard; however, one stands out from the rest. The “pin tab” option, once selected, will transform the current tab so that only the favicon is visible, not the text. This reduces the size of the tab, but also results in it being moved to the left-most side of the bar, as seen below:

On the left of this image, tabs which have been "pinned" are visible.

When you close Chrome, and re-open it, tabs who have been pinned will load automatically. While you could achieve a similar result by adding numerous websites to your home page list, the tab pinning approach seems better, to me.  I feel it truly reflects the minimalistic nature of Google Chrome, a trait that has been a big influence in its adoption. By simply showing a favicon, they are helping support the idea that an icon should be enough to represent an application a person uses often. Windows 7, for example, took a huge step in that direction with the task bar re-design. I’m happy to see that Google is doing similar, as it optimizes how the space is used within a window, and helps organize information.

If you find that your pinned tabs are becoming too numerous, consider moving some of them to the bookmark bar. It is possible to have the bookmarks appear with only a favicons as well. To do this, simply edit an existing bookmark, and delete the name. Chrome will still allow you to use the bookmark without a name, as it still has an icon to represent it.

Google Chrome allows bookmarks to exist without a name. If a bookmark has no name, only the favicon will be displayed.

How to Launch Multiple Instances of Notepad++

Update Nov 22, 2016: I added a video tutorial for this! The written blog post remains available below.

Notepad++ is my primary text editor, as it offers a huge amount of features, and yet remains fairly simple to use.  After months of using it heavily both at home and at work, I began to wonder if I could launch multiple instances of it at one time. Given that I have two monitors in either case, I thought it would be interesting to have one Notepad++ window per monitor.

The best approach I found makes a new copy of Notepad++ launch every time you use a shortcut. To make this work on your machine, simply do the following:How to configure Notepad++ to launch a new copy of itself every time

  1. Right-click any Notepad++ shortcut.
  2. Select Properties.
  3. Move to the Shortcut tab.
  4. In the end of the Target field, add ” -multiInst”.
  5. Click OK.

Example:

  • Target: “C:Program FilesNotepad++notepad++.exe” -multiInst

You might be wondering at this point, what if I’m already using Notepad++, do I still have to use the shortcut to launch another? Thankfully, no. To launch another instance when already using the editor, you can simply press ALT + F6, or Click Run -> Open in another instance in the menu bar.

How to open another instance of Notepad++ once you're already within it

Testing Web Performance by Throttling Bandwidth

In the past, I often found myself wondering how some of my websites would perform when accessed from a low bandwidth connection. Unfortunately, I had no convenient way to test such a scenario, so I usually just forgot about the idea. I recently found myself in a similar scenario at work, and my searches returned a useful tool, Speed Simulator, by Vikas Patial:

Speed simulator is a simple throttling proxy which allows you to see how your site behaves under different connection speeds. It was written by me to test AJAX/Flash loaders and see how much my time took to load. You can simulate various speeds like that of a modem or a ADSL. A pre delay function is also there to help simulate delays due to DNS, connection establishment etc.

Here’s what it looks like:

Screenshot of the Speed Simulator user interface

It simply acts as a proxy, so all you need to do is point your browsers to access the web through Speed Simulator. You’ll then be transported back to the good ol’ days where most people had to wait for websites to load.

To do this:

  1. Click Start, and search for “Internet Options”. Launch it.
  2. Click on the “Connections” tab.
  3. Click the “LAN Settings” button, found within the “Local Area Network (LAN) Settings” section.
  4. Once the “Local Area Network (LAN) Settings” dialog appears, locate the “Proxy Server” section.
  5. Enable the “Use a proxy server for your LAN” checkbox, and enter the following:
  • Address: localhost
  • Port: 8080 (reflect the port listed in Speed Simulator)

Local Area Network (LAN) Settings dialog in Windows, with a proxy server configured.

Press OK to save your changes, and then simply click “Start” in the Speed Simulator window.

That’s it – all you need to do next is launch a browser, the bandwidth should be throttled. I’ve seen it work with Google Chrome and Internet Explorer. Configuring a proxy in Firefox requires different steps, but should work just as well, once configured.

I can see myself using this tool in the future, and not only for simple performance tests. For example, I can use it to test for possible timing-related flaws in JavaScript code. Definitely a welcome addition to my web development tool set.

Introducing All Due Credit

When I write for this blog, I don’t always write a post from start to finish, and publish it immediately. Usually, I have to review it multiple times myself, and in certain cases, I decide I want someone else to take a look at it too. In these cases, I typically send the post to one of my friends first, and I await their feedback. At the end of the day, their input allows me to ensure that my content meets a certain standard of quality. Given the significance of their aid, I felt I needed a way to publically thank them, per post. Faced with that idea, I did what any WordPress user would do – I looked for a suitable plugin within WordPress’s fantastic plugin directory. Normally I find what I need there, but in this particular instance, I couldn’t. So, being a developer, I decided to go ahead and create a plugin to suit my needs.

Meet All Due Credit, the result of this effort. Released with a GPL2 license, All Due Credit allows bloggers to include a list of names along with any post. Each name is accompanied by a text label that reveals what the person’s role was. Additionally, a Gravatar (globally recognized avatar) can be associated along with every name.

Here’s an example that includes all labels:

All Due Credit

In my case, I only really needed “Reviewed by” and “Thanks to”, but I figured I’d take it a little further while I was at it.  Since releasing it, I’ve been actively using it on my blog, so you may notice it appear under certain posts. It is still pretty early in its implementation, but since I was already pleased that it met my requirements, I thought I’d give others the chance to use it as well. To reflect the work ahead, I originally released it as version 0.3, whereas I’m now up to 0.3.6. Once I consider it feature complete and stable, I’ll mark it as 1.0.0… but until then, I’ll be working on adding features and improving whatever it already does.

If you want more information about the plugin, make sure to check the project page on my website. To download it, or see how my work on it has been progressing, see the All Due Credit page in the plugin directory.

Not Just Another First Person Shooter

In my youth, I took to video games like most adolescent males did – the habit continued into my adult life. As I aged, the time investment gradually decreased, but never disappeared. I played all sorts of games, but seemed to prefer first person shooters and strategy games, above all. Despite my gaming experience, there is one first person shooter that I prefer over all the others. As it turns out, I’m not referring to a video game, but instead… the sport known as Paintball:

Paintball is a sport first played in 1981 in the U.S. state of New Hampshire, in which players compete, in teams or individually, to eliminate opponents by hitting them with capsules containing paint (referred to as paintballs) propelled from a device called a paintball marker. While oil-based paint was originally used, paintballs are actually made of a special non-toxic, biodegradable, water soluble mineral-oil. The game is regularly played at a sporting level with organized competition involving worldwide leagues, tournaments, professional teams, and players. Paintball technology is also used by armies to supplement military training, riot response, and non lethal suppression of dangerous suspects.

Games are played on indoor or outdoor fields of varying sizes. A game field is scattered with natural or artificial terrain, which players use for strategic play. Rules for playing paintball vary, but can include capture the flag, elimination, defending or attacking a particular point or area, or capturing objects of interest hidden in the playing area. Depending on the variant played, games can last from seconds to hours, or even days in scenario play.

I’ve played Paintball a few times in my life, and each time has resulted in valuable memories. You see, there’s nothing quite like experiencing the action in person. Our bodies are fantastic instruments, and this was certainly apparent to me when playing Paintball. Once the round starts, all my senses fired up, my adrenaline began pumping, and everything suddenly slid into focus. The dangers of the battlefield are made pretty obvious, pretty fast, as it does hurt to get shot. Paintball markers fire paintballs at a speed of approximately 200 miles per hour, so you generally do everything you can to avoid being shot. Not only will a popped Paintball eliminate you from the match, but it will hurt too. Not agonizing pain by any means, but bruising is fairly common.

Beyond the bruising, Paintball is a pretty safe sport… and that is key. When I play, it is usually with a group of friends… and while I do enjoy eliminating enemy players from the game, I wouldn’t want them to get seriously hurt from it.  The safety precautions are pretty well designed. To give you an idea: foreign markers are all examined to ensure they meet safety requirements, foreign paintballs are usually rejected in favor of the field’s, and protective gear is worn at all times.

The people working these Paintball fields are very insistent that the safety rules are followed. Sometimes, they even come up with creative punishments for players that disrespect the rules. For example, one place I went to was very strict about players keeping their masks on at all times. There were designated places, called graveyards (where you go when you’re eliminated), where masks could be removed. Graveyards had protective netting all around to ensure no stray paintballs could be fired in. To help govern this rule, they said the third person to take off their mask in an unauthorized location would be “executed”. By that, they meant the entire paintball group would line up, and each would fire one paintball upon the offending individual, at one time. Since paintballs hurt, no one wants to be shot so many times. It was an amusing rule, and I know this for a fact – because I was the third person to violate it.

You see, certain paintball masks have serious issues with fogging. That is, your visibility drops significantly because of breathing, and your overall body heat. This was always an issue for me in the past, so I was usually eager to take off my mask. It would allow the fog to clear, and give me greater visibility for a few minutes. Unfortunately for me, at one point, as we were all gathered with the referee, I really wanted to take off my mask. I looked ahead of me, and saw that another player already took off his mask. Because of this, and my overall lack of visibility at that moment, I thought we must have been at a Graveyard. I took off my mask… and because the referee was looking in my general direction, he noticed me, and announced I was the third. I only knew about one prior violation, so the fact that I was third was a surprise. I laughed at my luck, and quickly gave up my efforts to describe why I took off my mask. I was told to stand at a distance, and every other player lined up and took aim at me. The referee made it clear that only one shot must be taken by all players. Should a player violate this rule, they would executed in turn. Now, given that paintballs bruise, the last place you want to be shot is in the groin. So, naturally, I had the habit of wearing a jockstrap when playing Paintball… and on this day, I was very, very glad. When asked if I was ready, I slid my ammo cannisters to the front of my belt, further protecting my family jewels, and gave my executors a thumbs up. Three seconds later, I was hit with approximately 20 paintballs at one time.  To my surprise, it really wasn’t very painful… it just stung for a moment, and then it passed. I had a friend among the executors, and he assured me afterwards that he did not fire along with the others. I appreciated the gesture, but as I had just discovered, it really wasn’t that bad. Still, definitely an interesting life experience.

Though the the mask penalty was unique, additional rules exist that are far less controversial.  A good example of this would be the “Freeze” rule. It goes like this: if you’re very close to an enemy player, you have the option of telling him to “Freeze”, instead of shooting him point-blank. Given the speed at which paintballs are fired, point blank range would likely hurt more than from a distance (lack of deceleration time). In my case, however, I don’t mind being shot up close – I seem to have a pretty good tolerance to bruising. Still, I respect the Freeze rule when it is active – it offers some strategic benefits as well. Consider the following scenario: if you run out of ammo on the battlefield, you’re normally pretty much finished. You have to leave the field, and wait for the next round. Yet, with the Freeze rule active, you can simply keep playing, and essentially bluff. With or without paintballs, a marker, when fired, will make the usual CO2 firing sound, and smoke will leave the barrel as it normally does. In the chaos of battle, this trick can be helpful in keeping enemy players hidden behind cover. While they’re too afraid to emerge from cover, all you have to do is run up to them, and scream “FREEZE!”. They’ll likely surrender, and thus, you will have managed to eliminate other players without ammunition. I’ve seen this strategy used by many players, though I’m not sure it is legal in professional leagues. I personally really enjoy it, as it represents a realistic challenge, rather than an instant forfeit on your part. It makes me feel like I’m unarmed, and with proper strategy, I can still contribute to the team beyond the usual limits.

I always like tough challenges, both physically, and mentally, and that’s another reason why I’m fond of Paintball. Unlike most first person shooters, Paintball can keep me fit physically, as well as mentally. It represents, to me, the ideal gaming experience… not to mention the best graphics I have ever seen. In the spirit of challenge, I once decided to use a handgun marker for one round. Handgun markers generally have limited ammo, and they use tiny, swappable CO2 tanks. The marker I used supported only 8 paintballs at a time, and the CO2 tank could only power roughly 20 shots. This meant that reloading had to be performed on the field, whenever necessary. Rather than worry about this, I saw my challenge – how far could I get with only 8 paintballs?

My handgun round turned out to be the last of the day, where my team was attacking a building that was fortified by enemy players. Since it was the last round, upon being eliminated, players from both teams could exit the battlefield, and immediately re-enter. The building was therefore a very significant threat; even if you eliminated the occupants, they’d be back in a couple minutes. Armed with a single handgun, I spent most of my time slowly approaching the building, without ever firing a shot. This required a significant amount of  time and strategy, and due to running in between cover, it was very tiring. However, I eventually reached the outer wall of the building. I placed my back to it, and slowly approached the door. I could hear the players inside communicating with each other, aware that an enemy was close. After trying to get a few shots at the occupants, I decided to do something unexpected. I slowly backed away from the building, and bolted through the front door as fast as I could. Immediately in front of me was an enemy player, who screamed at me, “FREEZE!”. Unfortunately for him, my adrenaline-enhanced reaction involved shooting him in the chest immediately, before my brain registered the “Freeze” completely. The enemy player, who was a friend of mine, was rightfully angry that he had been shot. A Freeze is a courtesy, and it essentially equates to a valid shot. Alas, he had been bluffing, and confided in me afterwards that he would have shot me point blank in revenge, but had no ammo left. I assured him that my elimination soon followed, and boy, did it ever. After my initial entrance and subsequent “kill”, I entered another room in the building, where two shocked enemy players blasted me with an excess of paintballs. Despite the fact that I ultimately was destroyed, I had more fun than I’ve had in a while. The fact that I was there in person, experiencing the situation with all my senses, made a world of difference. No longer could a video game satisfy the sensory overload that was Paintball.

Experiencing the game first-hand brings about new possibilities as well. While you could be limited by game world architecture, in Paintball, the boundaries are much more broad. This is perfectly natural, given that games aim to re-created real-world mechanics, whereas Earth already has some clearly-defined.  In both video games and the actual sport, I like that creativity goes unhindered. Here’s an example: at one point, while defending a castle-type structure, I had a significant amount of difficulty seeing through my mask, so much that I stopped caring about the round. If I couldn’t see, what was the point? So, instead of firing at the attackers, I would get them to shoot at me while running back and forth on the castle walls. I would occasionally stop to do a little dance, at which point I noticed more paintballs were being fired. I didn’t do this solely for amusement, though. I had warned nearby teammates to exploit the opportunity to take out the enemies, knowing very well that their attention would be on me.

All that said, I personally feel that Paintball is the best first person shooter… the only problem I see is the price. I usually pay around 125$ every time I go, so it’s not something I’m willing to do on a monthly basis, at least not yet. Buying my own gear could alleviate the costs by removing the rental fees, which are significant. Cost aside, in my mind, the sport simply cannot be defeated by video games. Until, of course, virtual reality is released, with neural connection a la Avatar.

How to Restore Underlined Shortcuts in Menus

In a post titled New Folder Shortcut in Windows, I explained how accelerator keys could speed up the process of creating new folders. The key combination that needs to be pressed depends on which letters are underlined in the Windows menu; however, starting with Vista, Microsoft decided to hide these hints, by default. You can still use the key combinations if you know them, but if you don’t, here’s how to make to the underlined letters always visible in Windows 7:

  1. Click Start, and launch the Control Panel.
  2. Click Ease of Access.
  3. Click Change how your keyboard works.
  4. Locate the Make it easier to use keyboard shortcuts section.
  5. Enable the Underline keyboard shortcuts and access keys checkbox.
  6. Click OK.

That’s it. After that change, menus will reveal which characters are accelerator keys by underlining them, just like in older versions of Windows.

The "Underline keyboard shortcuts and access keys" feature in action.

When Gaming Handles Invade Real Life

Having been a gamer since my teenage years, I’m pretty familiar with representing myself in a virtual world. While some games offers customization of an avatar, the most common element is usually a username, also known as a gaming handle. When other players encounter you in this online world, they know you by your handle, not your real-life name. Over the years, I came to realize that my online personna could sometimes find its way into the real world, with undesirable results.

Job interview

The first situation I’m going to describe revolves around the handle. When creating gaming handles, I now know to exercise caution, as the name may be seen in a context that isn’t… appropriate. I have personally experienced this before, and it is both and amusing and troubling tale. At one point in my life, I went in for an internship interview, and when the interviewer arrived, he pulled up the electronic version of my resume on his laptop. I couldn’t see his screen, but after a few moments, he looked up, and said: “ToadLurker?” It took me a couple seconds to realize that yes, I heard correctly. ToadLurker was my gaming handle, but I didn’t understand how it had anything to do with my resume. I confirmed the name as my own, and asked him where he saw it. It seems the file’s properties actually contained the author name, which, by default, seemed to be related to the Windows logon name. This is where I learned a very valuable lesson – despite the gaming, your Windows account should always be based on your real name. Also, the handle should be something that you can show to an employer without being embarrassed. Certainly not something that you’ll want to do, but I feel it to be a good rule of thumb.

Similarly, it is important to resist the temptation of using gaming handles as usernames for non-gaming websites. Recently, as I was using a finance-related website, I realized that I could not remember my username. I had to call their support line, and the agent eventually told me my username: ToadLurker. Registering with that username was obviously a mistake (rarely use it -hence why I couldn’t remember), but it was pretty awkward to hear that on the phone, and have to acknowledge that it was, in fact, your username. You’re also probably wondering what ToadLurker is, and to me, that’s the amusing part. To a random person, it doesn’t sound very good – it almost sounds like ToadLicker, suggesting I like to lick psychoactive toads to get high. Even if they don’t think this, the word “lurker” doesn’t really inspire trust in anyone.

Along the same line, by the way, don’t register on websites using an e-mail address that is too embarrassing to show to a potential employer. I used to live with a guy that had an e-mail called operationpimp@providerhere.com. Just keeping that e-mail address around is a risk to his reputation… what if it accidentally was seen by an employer? I used to have a good laugh imagining what would happen if he actually sent his resumes using that address.

Finally, to put an end to your wondering, I’ll explain how I came to adopt ToadLurker as my gaming handle. It goes back to my earlier gaming years, where I played Starcraft, a real-time strategy game, most of all. I really liked one particular unit, called a Lurker. Lurkers burrowed into the ground, and stayed there, awaiting enemy units. When enemies would walk near burrowed Lurkers, they would be immediately attacked by spines that pierced through the ground. The Lurkers themselves remain burrowed, making them great ambushers. I always liked that concept, so it found a way into my gaming handle.

LAN Party

The Toad portion actually started at SOAD, which is an acronym for System of a Down, a band I listened to at the time. SoadLurker was therefore my first draft, and I kept it for a while. A few years later, I began playing Battlefield 1942 with a clan, regularly. During one of our league matches, a shoutcaster decided to broadcast our match. He was essentially watching the match, and behaving as a regular sports commentator would. After the match, the team got together on an audio chat program, and listened to the shoutcast together. At one point during the match, the shoutcaster noticed me doing something in the game world, and tried to pronounce SoadLurker a few times, with little success. He decided it was too hard to read, so he asked his wife what she thought. Her suggestion was to just call me “Toad”, as it was simpler. Upon hearing that, the team had a good laugh, and I decided that yeah, why not call myself Toad?

That was, of course, a very long time ago. At this point in my life, I’m very supportive of the idea of using real names as gaming handles. They’re much less likely to lead to awkward situations like the ones I have experienced.

Photo credit

First photo by bpsusf.

Second photo by Umberto Salvagnin.

Third photo by Chase N.

A Close Encounter With Accidental Theft

On one particular work day, I decided to go shopping for some groceries with a coworker. It is something we actually do fairly regularly, as we work in the heart of downtown Montreal, where stores are abundant and easily accessible. After visiting a mainstream grocery store, we decided to visit an organic produce shop. Not a random one, mind you – as my mother just-so-happens to work there during the day. Given that the store is so close to where I work, I have a tendency to drop by fairly often. As such, I know the owners and other employees to a degree, and we get along pretty well. They even started giving me a 15% discount on everything I buy, which is essentially the same rebate my mother gets.

Organic grocery store

They’ve always had problems with theft, especially since stores started selling re-usable grocery bags. To counter theft, they have cameras installed throughout the store, and they also ask that customers leave their bags at the front desk when they come in. Usually, when I visit, I don’t bother taking off my backpack. I don’t like having to worry about my belongings, and, naturally, I know I would never steal. It seems they agree with the latter, as they never asked me to leave my bag with them.

So, as I walked into the store on this particular day, I was carrying a re-usable grocery bag, one filled with groceries from another store. Without really thinking about it, I walked in as I usually did, and walked towards the refrigerators, seeking a particular product: Slow Cow. Slow Cow is pretty much the opposite of Red Bull, both in function and in name. It is a product that will help you relax, rather than help you stay active.

Slow Cow

So, once I saw the can, I took it off the shelf, and dropped it into my bag. It took about three seconds for me to realize what I had done. I placed the drink in my bag, amongst other products from another store. It could certainly be interpreted as an attempt at theft. Upon realizing this, I immediately retrieved the can from my bag, and at that precise moment, the owner turned the corner, and greeted me. While still holding the can, I greeted him with enthusiasm, all the while thinking how bad the situation must look. I’m still holding the can, and he appeared at a perfect moment to see me remove it from my bag. It took most of my mental strength to suppress the smile that was forming on my face. It was something I would have expected to see on Seinfeld. Thankfully, the owner seemed to assume nothing was odd, which was exactly the case. Had it been shown on Seinfeld, I suspect a different outcome would have been written. It just all seems so illogical, so ridiculous… why would anyone target such a friendly store, one that is also close to his work and his family? It just suggests a significant lack of analysis and thought, to the point where one would suspect mental instability. Seems like a perfect scene for George