tag:blogger.com,1999:blog-56254784447150944382024-03-13T01:42:12.337-07:00Philip SteinerThings I'd forget if I didn't post them here.Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.comBlogger142125tag:blogger.com,1999:blog-5625478444715094438.post-9927916857417242882023-08-27T14:31:00.002-07:002023-08-27T14:31:51.685-07:00Use diskpart CLI to reformat a Linux boot USB flash drive<p>Useful for reformatting a flash drive after using it as a Linux boot drive. </p><p>In a Windows 10 command prompt, running as administrator:</p><p><span style="font-family: Consolas;">C:\Windows\system32>diskpart</span></p><p><span style="font-family: Consolas;">Microsoft DiskPart version 10.0.19041.964</span></p><p><span style="font-family: Consolas;">Copyright (C) Microsoft Corporation.</span></p><p><span style="font-family: Consolas;">On computer: YOURPC</span></p><p><span style="font-family: Consolas;">DISKPART> list disk</span></p><p><span style="font-family: Consolas;"> Disk ### Status Size Free Dyn Gpt<br /></span><span style="font-family: Consolas;"> -------- ------------- ------- ------- --- ---<br /></span><span style="font-family: Consolas;"> Disk 0 Online 476 GB 1024 KB *<br /></span><span style="font-family: Consolas;"> Disk 1 Online 931 GB 1024 KB *<br /></span><span style="font-family: Consolas;"> Disk 2 Online 7396 MB 4509 MB *</span></p><p><span style="font-family: Consolas;">DISKPART> select disk 2<br /></span><span style="font-family: Consolas;">Disk 2 is now the selected disk.</span></p><p><span style="font-family: Consolas;">DISKPART> clean<br /></span><span style="font-family: Consolas;">DiskPart succeeded in cleaning the disk.</span></p><p><span style="font-family: Consolas;">DISKPART> create partition primary<br /></span><span style="font-family: Consolas;">DiskPart succeeded in creating the specified partition.</span></p><p><span style="font-family: Consolas;">DISKPART> format fs=fat32 quick<br /></span><span style="font-family: Consolas;"> 100 percent completed</span></p><p><span style="font-family: Consolas;">DiskPart successfully formatted the volume.</span></p><p><span style="font-family: Consolas;">DISKPART> exit<br /></span><span style="font-family: Consolas;">Leaving DiskPart...</span></p>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-68531488717190020872023-01-26T09:55:00.002-08:002023-01-26T09:57:27.567-08:00How to recover an off-screen window in Windows<p> Recover an off-screen window:</p><p></p><ol style="text-align: left;"><li>Select the window's tab in the task bar</li><li>Press Alt+Spacebar to open the window's context menu</li><li>Press M to select Move in the context menu</li><li>Press an arrow key to snap the mouse pointer to the window</li><li>Move your mouse around until it drags the window back into view</li></ol><p></p>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-9433698046416566972022-11-18T14:14:00.004-08:002022-11-18T14:25:12.330-08:00Mastodon<p> You can find me on Mastodon: <a href="https://techhub.social/@psteiner">@psteiner@techhub.social</a></p>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-70217378250342789792022-06-24T10:58:00.002-07:002022-06-24T10:58:18.698-07:00Where is that Perl module installed?<p> Out of the box Perl comes with a 'standard library' of modules. You can use tools like cpan, cpanm and ppm to install additional modules. </p><p>To find out whether a module is standard or an add-on, run the command <b><span style="font-family: Consolas;">instmodsh </span></b>to find out.</p>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-11324422778146953922022-02-22T21:44:00.001-08:002022-06-24T10:50:57.852-07:00Canadians! How to turn off that annoying "Control-Shift" Keyboard Switch <p>No offense to <i>mon copains </i><i>Quebecois </i>(did I say that right?), but a particular quirk affects PCs for a unilinguist Anglo like me when the Region setting in Windows is set to Canada (or I suppose any bilingual country). </p><p>I've had the annoying experience of holding down "Control-Shift" for more than a couple of seconds, say while I'm trying to decide if I want to paste plain text into a Google Chrome field (using Ctrl-Shift-V), then suddenly I'm getting accented characters all over the place. </p><p>This is Windows being helpful to us Canucks, by switching the keyboard layout from Canadian English to Canadian French, which would be great, if a) I had a Canadian French keyboard, and b) I knew how to write in Canadian French on that keyboard, and c) I actually wanted to write in Canadian French!</p><p>Well, I discovered how to turn off that 'helpful' keyboard shift:</p><p></p><ol style="text-align: left;"><li>Open Settings and search for "advanced keyboard settings":<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiV6B4ER_CUom3gtK3fhSr2Umy-vL0rjvwoWdwXDZeZd9gZGWd0gn4pC3dF2SEd6xvHwkiwvBEdNVh4PcHMoRB-GGXw2jAfY3W11fWac4kHEQqvLGp_fzB8VeshuW9sfyDRL17YyImeynCpxCpn-758aHEN59gSCtE1RbKytlofvqImkEtQ1iIp7DEi" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="380" data-original-width="585" height="260" src="https://blogger.googleusercontent.com/img/a/AVvXsEiV6B4ER_CUom3gtK3fhSr2Umy-vL0rjvwoWdwXDZeZd9gZGWd0gn4pC3dF2SEd6xvHwkiwvBEdNVh4PcHMoRB-GGXw2jAfY3W11fWac4kHEQqvLGp_fzB8VeshuW9sfyDRL17YyImeynCpxCpn-758aHEN59gSCtE1RbKytlofvqImkEtQ1iIp7DEi=w400-h260" width="400" /></a></div><br /><br /></li><li>In the Advanced Keyboard Settings panel, click on Language bar options:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhh6OtpubF_HHHk4duPtnVNuY_joME7-fqP_vgrYST7bN-W9m0260b85IiWBJ3gI-GKDAN7uRhZmB_Q0yVHGCd8whuMumzsLVh9XeUg983wXpI88xXodiMoDo6wnoKqO3vbM7u6I7CcANHMLRbGvdk67ilQS3W9jPVG7rlKbG8uIWF6D-q0hZxfvdwD" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="469" data-original-width="523" height="359" src="https://blogger.googleusercontent.com/img/a/AVvXsEhh6OtpubF_HHHk4duPtnVNuY_joME7-fqP_vgrYST7bN-W9m0260b85IiWBJ3gI-GKDAN7uRhZmB_Q0yVHGCd8whuMumzsLVh9XeUg983wXpI88xXodiMoDo6wnoKqO3vbM7u6I7CcANHMLRbGvdk67ilQS3W9jPVG7rlKbG8uIWF6D-q0hZxfvdwD=w400-h359" width="400" /></a></div></li><li>In the Text Services and Input Languages control panel, select the "Advanced Key Settings" tab and click the "Change Key Sequence" button:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEh_u8DZ1ACY33Sb-ZNOEOcYSYR9l7Tqh5k3klVRThUzzINzvYuinOkHHpQAGA034fqlj8CT_Iz4_sJRif21rw8DWdMEKjhm3TGrHQslLibZZ7EZnGzi9MsBhQNth5Sk5d3dXgnBeMZ9x8wq9OL4TmBTub5W5TQ_qm9OR_bnGRHAhCwEztnengJXaPMX" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="485" data-original-width="417" src="https://blogger.googleusercontent.com/img/a/AVvXsEh_u8DZ1ACY33Sb-ZNOEOcYSYR9l7Tqh5k3klVRThUzzINzvYuinOkHHpQAGA034fqlj8CT_Iz4_sJRif21rw8DWdMEKjhm3TGrHQslLibZZ7EZnGzi9MsBhQNth5Sk5d3dXgnBeMZ9x8wq9OL4TmBTub5W5TQ_qm9OR_bnGRHAhCwEztnengJXaPMX=s16000" /></a></div><br /><br /></li><li>Finally we are there: click the "Not Assigned" radio buttons for either or both "Switch Input Language" or "Switch Keyboard Layout" options:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEignmKWJlSQXe1B_2KHyY6ATdvbpr0C_Ees0pg--1vWdro7CF9heBFLl4_1Su3CEwK1ygp6YljCu1DTyDgZgjnrvMEBU83sWp8ZPJji2YFiIF-tU9gWAZWHJazJm0Ou7GOVgYviFkdmqYUIDfc9Zl9gv5GYYFPyFEB-yeOSWA06jJGQAfoEEeozUoE0" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="199" data-original-width="409" src="https://blogger.googleusercontent.com/img/a/AVvXsEignmKWJlSQXe1B_2KHyY6ATdvbpr0C_Ees0pg--1vWdro7CF9heBFLl4_1Su3CEwK1ygp6YljCu1DTyDgZgjnrvMEBU83sWp8ZPJji2YFiIF-tU9gWAZWHJazJm0Ou7GOVgYviFkdmqYUIDfc9Zl9gv5GYYFPyFEB-yeOSWA06jJGQAfoEEeozUoE0=s16000" /></a></div></li></ol><div>And that I think is it!</div><p></p>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-62444294720863449402021-06-23T13:55:00.002-07:002021-06-23T14:01:16.164-07:00Using Windows Command Line to make a dummy file<p>Echo 64 bytes to a seed file: </p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;"><p style="text-align: left;"><span style="font-family: Consolas;">C:\Temp>echo This is just a sample line appended to create a bi wefhwef weh> dummy8.txt</span></p></blockquote><p>Then call 'type' in a for loop to append the contents of the file to itself:</p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;"><p style="text-align: left;"><span style="font-family: Consolas;">C:\Temp>for /L %i in (1,1,8) do type dummy.txt >> dummy.txt</span></p></blockquote><p>Makes a 32,768 byte (32Kb) file.</p><div><blockquote><p>Courtesy https://www.windows-commandline.com/how-to-create-large-dummy-file/</p></blockquote></div><div><br /></div>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-72184413620632418762021-06-08T12:03:00.000-07:002021-06-23T13:40:19.580-07:00Formatting Time and Date with Perl<pre><span style="font-family: Consolas;"># timestamp examples
use strict;
use warnings;
use v5.10.0;
use POSIX qq(strftime);
my $timestamp = strftime("%Y-%m-%d_%a_%H-%M-%S",localtime);
say $timestamp; # 2021-06-08_Tue_11-54-28
# ------------------------------------------------------------------------------
use DateTime;
my $today = DateTime->today();
say $today; # 2021-06-08T00:00:00
say $today->date; # 2021-06-08</span>
</pre>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-41371225654820034092020-11-04T14:13:00.000-08:002021-06-23T13:42:28.042-07:00Extensions for Perl in VS Code<p></p><div>Extension for Perl that work reasonably well in Visual Studio Code</div><ul style="text-align: left;"><li><a href="https://marketplace.visualstudio.com/items?itemName=jeff-hykin.better-perl-syntax">Better Perl Syntax</a></li><ul><li>better Perl syntax highlighting</li></ul><li><a href="https://marketplace.visualstudio.com/items?itemName=cfgweb.vscode-perl">Perl (cfgweb)</a></li><ul><li>Code intelligence for Perl</li><li>Perl::Tidy (doesn't seem to work)</li></ul><li><a href="https://marketplace.visualstudio.com/items?itemName=mortenhenriksen.perl-debug">Perl Debug</a><br /></li><ul><li>Integrated debugger for Perl</li></ul><li><a href="https://marketplace.visualstudio.com/items?itemName=d9705996.perl-toolbox">Perl Toolbox</a></li><ul><li>Linting</li><li>perlcritic</li><li>Documents are only checked on open or save</li></ul></ul><p></p>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-41484252907200170482020-06-07T17:17:00.001-07:002022-06-24T10:51:44.123-07:00The Safe Way to test Thermal Runaway Protection on 3D Printers<br />
<ol>
<li>Disconnect the heater cartridge from the main board</li>
<li>Start heating the hot end</li>
<li>Expect machine to error out after ~10 seconds and shut down </li>
</ol>
Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-55216522881139239692020-05-28T14:36:00.000-07:002022-06-24T10:52:08.311-07:00Writing useful commit commentsSome thoughts on writing useful [concise, descriptive, contextual] commit comments. Applies to all SCM systems (Git, Subversion, etc.)<br />
<div style="box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir, "helvetica neue", helvetica, ubuntu, roboto, noto, "segoe ui", arial, sans-serif; font-size: 16px;">
<br /></div>
<h2>
<strong style="box-sizing: border-box; color: #24292e; font-size: 16px;">A properly formed Git commit subject line should always be able to complete the following sentence</strong><span style="color: #24292e; font-size: 16px;">:</span></h2>
<div>
<ul style="box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir, "helvetica neue", helvetica, ubuntu, roboto, noto, "segoe ui", arial, sans-serif; font-size: 16px; padding-left: 32px;">
<li style="box-sizing: border-box;">If applied, this commit will <em style="box-sizing: border-box;"><u style="box-sizing: border-box;">your subject line here</u></em></li>
</ul>
<div style="box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir, "helvetica neue", helvetica, ubuntu, roboto, noto, "segoe ui", arial, sans-serif; font-size: 16px;">
For example:</div>
<ul style="box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir, "helvetica neue", helvetica, ubuntu, roboto, noto, "segoe ui", arial, sans-serif; font-size: 16px; padding-left: 32px;">
<li style="box-sizing: border-box;">If applied, this commit will <em style="box-sizing: border-box; color: green;">refactor subsystem X for readability</em></li>
<li style="box-sizing: border-box;">If applied, this commit will <em style="box-sizing: border-box; color: green;">update getting started documentation</em></li>
<li style="box-sizing: border-box;">If applied, this commit will <em style="box-sizing: border-box; color: green;">remove deprecated methods</em></li>
<li style="box-sizing: border-box;">If applied, this commit will <em style="box-sizing: border-box; color: green;">release version 1.0.0</em></li>
<li style="box-sizing: border-box;">If applied, this commit will <em style="box-sizing: border-box; color: green;">merge pull request #123 from user/branch</em></li>
</ul>
<blockquote class="tr_bq">
- <a href="https://chris.beams.io/posts/git-commit/#imperative">Chris Beam</a></blockquote>
</div>
Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-64127867236666997342020-05-14T14:48:00.002-07:002022-06-24T10:52:39.295-07:00Don't name ANYTHING AUX, or NUL, or...Further to my earlier post, I discovered 'aux' is not just a bad choice for folder names, it's bad for ANY file name on Windows!<br />
<br />
Apparently back in the Dark Ages (1974 or so) when Bill Gates invented computers, the Interwebs and everything else digital, AUX, NUL, COM3, etc. were deemed names reserved for the OS, "magical files" if you will. That decision lives on through backward-compatibility (c'mon, 1974?! CP/M?! DOS?!?!?).<br />
<br />
While working on my project, MS Visual Studio Code happily agreed to let me name a file"aux.yaml". Even though this ominous warning appeared, it let me continue once I appended "yaml" to the name:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4cPB7gAOdTLVN-HtaGqO8gsYu7fYgGQrnp84jtAOobBNHfmnezNbcm2RpArud6zZYFKoEsT3tZfWDQMlXXdYqPU7R_6Xkl3ECLFL28SETwv_LKhebZRrMN4sS3cyzZs8ecoIC63_OpwU/s1600/aux_fail.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="163" data-original-width="383" height="136" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4cPB7gAOdTLVN-HtaGqO8gsYu7fYgGQrnp84jtAOobBNHfmnezNbcm2RpArud6zZYFKoEsT3tZfWDQMlXXdYqPU7R_6Xkl3ECLFL28SETwv_LKhebZRrMN4sS3cyzZs8ecoIC63_OpwU/s320/aux_fail.PNG" width="320" /></a></div>
<br />
<br />
Everything went fine until I tried to add the file to the project's working copy in Subversion. For some reason, no matter how many times I pressed "Add..." in TortoiseSVN, the file refused to appear in the commit list, and failed to adopt its stroppy little blue plus sign in Windows Explorer.<br />
<br />
Hmm, let's open it with Notepad++ to make sure the file is OK - nope, Notepad++ complained bitterly about the file when I tried to open it:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWwd1ibkXlLFbnXVgYXdwjXHW0JDuh76y1Q7dOfYdHGNd4DP_Xb4LZtdkE2u3sYC26eupMGbhZnlHQ2XgcayUUdcmqfi2cMMEqrxWiMDMCbhjCMBHlA2ASPmLuoNMokqW5pIBUfPE8Gj0/s1600/aux_open_fail.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="158" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWwd1ibkXlLFbnXVgYXdwjXHW0JDuh76y1Q7dOfYdHGNd4DP_Xb4LZtdkE2u3sYC26eupMGbhZnlHQ2XgcayUUdcmqfi2cMMEqrxWiMDMCbhjCMBHlA2ASPmLuoNMokqW5pIBUfPE8Gj0/s1600/aux_open_fail.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
So at this point I figure the file was somehow corrupted by my attempts to add it or move it around in the Subversion working copy, let's just nuke it and start over:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYEMqoRdI0cQYs3FJ6PAVJpyhkn8NyFPlpIJFwVvvJQKeTTWyzxgUSexSCAILupEVjZbUCdg3kl2bLJHdudodrvc4L2yh5MrO81kF9hAHVzCYz0I_i3ox_rqwUb_Vj7aSbt_odnhPjN6Y/s1600/aux_delete_fail.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="268" data-original-width="449" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYEMqoRdI0cQYs3FJ6PAVJpyhkn8NyFPlpIJFwVvvJQKeTTWyzxgUSexSCAILupEVjZbUCdg3kl2bLJHdudodrvc4L2yh5MrO81kF9hAHVzCYz0I_i3ox_rqwUb_Vj7aSbt_odnhPjN6Y/s320/aux_delete_fail.PNG" width="320" /></a></div>
<br />
OK this is definitely weird.<br />
<br />
A few minutes googling produced the answer: open an admin command prompt and delete or rename the file. The command <span style="font-family: "courier new" , "courier" , monospace;">ren \\.\C:\path\to\file\aux.yaml auxiliary.yaml </span><span style="font-family: inherit;">put everything right again - TortoiseSVN happily added the file, Notepad++ opened it with nary a whimper, and Visual Studio Code - well, let's just say it has it's own opinion on file names.</span><br />
<br />
References:<br />
<br />
<a href="https://www.itnews.com.au/news/how-a-1974-bug-still-bites-win10-and-azure-users-515102">How a 1974 bug still bites Win10 and Azure users</a>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-50316303835742080882020-05-11T11:34:00.001-07:002022-06-24T10:52:59.351-07:00Windows error naming folder 'aux' - wat?!<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_S9LPDItL_D-QcFE3KWAuQrHVDaNwSsFEJlX-FIf_CIIzRtT9llTVYgKQ6Ls_ii13c72nj-ysPnHJHpixixAL-SGCMNdQF7W1K2wZdy30as8yV_jBb2l2P5KM7zCzxF0yb-vT7nfWLCQ/s1600/aux_error.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="257" data-original-width="547" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_S9LPDItL_D-QcFE3KWAuQrHVDaNwSsFEJlX-FIf_CIIzRtT9llTVYgKQ6Ls_ii13c72nj-ysPnHJHpixixAL-SGCMNdQF7W1K2wZdy30as8yV_jBb2l2P5KM7zCzxF0yb-vT7nfWLCQ/s1600/aux_error.PNG" /></a></div>
<br />
Windows complained, unjustly I thought, when I tried to name a folder 'aux'. Turns out this is one of a number of <a href="https://en.wikipedia.org/wiki/Filename#In_Windows">restricted MSDOS device files</a>:<br />
<br />
<pre style="background: none rgb(255, 255, 255); border: 1px solid rgb(200, 204, 209); color: #202122; font-family: Menlo, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 16px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; padding: 1em; vertical-align: baseline; white-space: pre-wrap;">CON, PRN, <b>AUX</b>, CLOCK$, NUL
COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9
LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9
LST (only in 86-DOS and DOS 1.xx)
KEYBD$, SCREEN$ (only in multitasking MS-DOS 4.0)
$IDLE$ (only in Concurrent DOS 386, Multiuser DOS and DR DOS 5.0 and higher)
CONFIG$ (only in MS-DOS 7.0-8.0)</pre>
Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-10320357605557836242019-09-19T17:45:00.001-07:002022-06-24T10:53:20.473-07:00How to Get a Good Old Command Prompt from Windows Explorer in the latest Windows 10 Remember the ol' shift-click in Windows Explorer trick to open a command prompt from a folder?<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjONS0eEb2esZWb26EP8uEEb5kRHPK1VAghukXyvrgtV7lGj9jV9QsA23aHIQxtWjm0sLmlFo6QPP6ebj_chnG165RG_hk6Kz3sm4OC8RSRxCNLQFu1gRvWjYi5PBOJA5Yc4LCNhtf2mk/s1600/open_command_prompt_here.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="440" data-original-width="660" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjONS0eEb2esZWb26EP8uEEb5kRHPK1VAghukXyvrgtV7lGj9jV9QsA23aHIQxtWjm0sLmlFo6QPP6ebj_chnG165RG_hk6Kz3sm4OC8RSRxCNLQFu1gRvWjYi5PBOJA5Yc4LCNhtf2mk/s320/open_command_prompt_here.png" width="320" /></a></div>
<br />
Windows 10 since version 1803 (?) helpfully offers to open a Powershell prompt instead:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDz8QgBwL_tEFncXAtoSZv439YgUtKt0wxsTCxTSxz6mlNq4uUccocQ9S7ryqK65xp_cUAsFz2pcwc1_hfL99Tb_txpQQHHQqCpFBzP4x5bY0UFFWOCK6Iql4l0l8kavn7MD9snrZbtHY/s1600/open_powershell_here.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="437" data-original-width="644" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDz8QgBwL_tEFncXAtoSZv439YgUtKt0wxsTCxTSxz6mlNq4uUccocQ9S7ryqK65xp_cUAsFz2pcwc1_hfL99Tb_txpQQHHQqCpFBzP4x5bY0UFFWOCK6Iql4l0l8kavn7MD9snrZbtHY/s320/open_powershell_here.png" width="320" /></a></div>
<br />
Which is great, if I want Powershell, which I don't. Apparently there's no way to revert or override this helpful 'feature', so I went around the side door - I shift-clicked to open Powershell, then typed "cmd" at the Powershell prompt, <i>et voila, </i>I get a good old command prompt in the folder:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgji4fEmYD9fIN12DRwNiEcUWiGc0ZqpmqzXa7bH2DP1mPwhFjLIZLMWPxYm8C8DPrKLR5uOawEppyGx_zDd00A4HVSE9ULYYPkRc-ZSqxSQGvx_eVqq3EqgmWtnKctWPOwhLrnUrRMh3I/s1600/cmd_in_powershell.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="300" data-original-width="694" height="138" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgji4fEmYD9fIN12DRwNiEcUWiGc0ZqpmqzXa7bH2DP1mPwhFjLIZLMWPxYm8C8DPrKLR5uOawEppyGx_zDd00A4HVSE9ULYYPkRc-ZSqxSQGvx_eVqq3EqgmWtnKctWPOwhLrnUrRMh3I/s320/cmd_in_powershell.png" width="320" /></a></div>
<i><br /></i>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-66287687529575602302019-07-18T12:28:00.001-07:002022-06-24T10:53:34.805-07:00Neil Armstrong's first step happened on my 10th Birthday! Or did it?Did Neil Armstrong's historic first step on the moon land on my 10th birthday? Let's see. NASA published a <a href="https://history.nasa.gov/SP-4029/Apollo_11i_Timeline.htm">detailed timeline</a> of the Apollo 11 mission, and with a little help from date/time conversion websites, and a confirmation that California did indeed observe PDT in 1969, I constructed this timeline of the highlights:<br />
<br />
<pre>Apollo 11 Timeline
Event PDT (UTC-7) EDT (UTC-4) UTC (GMT) SAST (UTC+2)
No DST
----------- --------------- --------------- --------------- --------------
Liftoff 6:32 am 9:32 am 1:32 pm 3:32 pm
Wed 16 July
Landing 1:17 pm 4:17 pm 8:17 pm 10:17 pm
Sun 20 July
<b>First</b> <b><span style="color: red;">8:56 pm</span></b> 11:56 pm | <span style="color: #38761d;"><b>2:56 am</b> </span> 4:56 am
<b>Step <span style="color: red;">Sun 20 July</span></b> | <b><span style="color: #38761d;">Mon 21 July</span></b>
My 10th <b>10:35 pm</b>
Birthday <b>Mon 21 July</b>
Lunar 10:54 am 1:54 pm 5:54 pm 7:54 pm
Ascent Mon 21 July
Splashdown 9:21 am 12:51 pm 4:51 pm 6:51 pm
Thu 24 July
</pre>I have a recollection of watching the landing on (black and white) TV, then looking out the window at the sky, thinking, "Wow, they are up there right now!". I don't recall if the Moon was visible during the day at that time.<br />
<br />
Well, sadly, as I was living in Petaluma, California at the time, Neil's boot hit the moondust at 8:56 pm PDT on Sunday, July 20th, the <i>day before</i> my 10th birthday.<br />
<br />
For a certain someone in Cape Town, however, it happened <i>very early </i>on her 10th birthday!Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-49384160792779451462019-05-01T17:47:00.002-07:002021-06-23T13:42:28.042-07:00Perl - get the script path<pre># C:\Foo\Bar\my_script.pl
use strict;
use warnings;
use FindBin qw($Bin);
print "My script lives in $Bin\n"; # My script lives in C:/Foo/Bar
</pre><br />
Note that there is no trailing slash, and Windows back-slashes '\' are converted to forward slashes '/'Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-69039288179992182432019-04-03T16:41:00.003-07:002022-06-24T10:53:52.916-07:00How to Roll Back (revert) an SVN commitCrap. My last commit in Subversion broke Jenkins. How do I undo it?<br />
<br />
Sometimes TortoiseSVN gives us too much of a good thing. There are several options with similar names for "reverting" and "updating" files in Subversion, and I can never keep them straight, thus another post that tries to sum up the options and their effects.<br />
<br />
First, just a simple "undo":<br />
<br />
<b>Revert a single file:</b><br />
<ol>
<li>Right-Click -> TortoiseSVN -> Show log</li>
<li>Find the revision/changeset you want to rollback to (i.e. the revision just before the change you want to remove)</li>
<li>Right-click on <b>the single file </b>in the list of files -> <b>Revert to this Revision</b></li>
</ol>
<b>Revert the entire changeset:</b><br />
<ol>
<li>Right-Click -> TortoiseSVN -> Show log. </li>
<li>Find the revision/changeset you want to rollback to</li>
<li>Right-click on <b>that revision </b>-> <b>Revert to this Revision</b></li>
</ol>
<div>
(Paraphrased from <a href="https://stackoverflow.com/users/56693/eduncan911">eduncan911</a>'s lucid instructions in <a href="https://stackoverflow.com/questions/611879/how-do-i-roll-back-all-or-part-of-a-commit-to-svn">this post</a> on Stack Overflow)<br />
<br />
Wait a minute. The context menu in TortoiseSVN (1.9.7.x) shows three similar commands when selecting a revision in the list:</div>
<div>
<ol>
<li>Update item to revision</li>
<li>Revert to this revision</li>
<li>Revert changes from this revision</li>
</ol>
<div>
and just the last one, "Revert changes from this revision," when selecting an item in the list of files.<br />
<br />
What???</div>
</div>
<div>
<br /></div>
<div>
Here's what each "Revert" option does, according to <a href="https://stackoverflow.com/users/571407/jb-nizet">JB Nizet</a> again on <a href="https://stackoverflow.com/questions/22859953/tortoisesvn-revert-changes-from-this-revision-vs-revert-to-this-revision">Stack Overflow</a>:</div>
<blockquote class="tr_bq">
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Let's say you have these N successive commits: 1, 2, 3 and 4.</div>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
If you select the commit 2 and choose "<b>Revert to this revision</b>", your working copy will contain the changes brought by commits 1 and 2. Commits 3 and 4 will be "canceled".</div>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
If you select the commit 2 and choose "<b>Revert changes from this revision</b>", your working copy will contain the changes brought by commits 1, 3 and 4. Commit 2 will be "canceled", or rather, played in reverse on the top of commit 4: if a line was added, it will be removed. If a line was removed, it will be re-added.</div>
</blockquote>
<div>
(Emphasis and spelling corrections are mine)</div>
<div>
<br /></div>
<div>
So it would follow that either option has the same effect when undoing just the last commit on a file.</div>
<div>
<br /></div>
<div>
How about "Update item to revision" vs "Revert to this revision"? Here's <a href="https://stackoverflow.com/users/23264/peter-parker">Peter Parker's</a> explanation on <a href="https://stackoverflow.com/questions/1214939/update-item-to-revision-vs-revert-to-revision">Stack Overflow</a>:</div>
<blockquote class="tr_bq">
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Update to revision</strong> will only update files of your working copy to your chosen revision. But you <strong style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">cannot continue</strong> to work on this revision, as SVN will complain that your working copy is <strong style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">out of date</strong>.</div>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">revert to this revision</strong> will undo all changes in your working copy which were made after the selected revision (in your example rev. 96,97,98,99,100) Your working copy is now in <strong style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">modified state</strong>.</div>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
The file content of both scenarios is same, however in first case, you have an <em style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">unmodified working copy</em> and you cannot commit your changes (as your working copy is not pointing to HEAD rev 100), in second case you have a <em style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">modified</em> working copy pointing to head and you can continue to work and commit</div>
</blockquote>
<div>
(spelling and punctuation corrections are mine)</div>
Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-71239212277665826122018-12-19T12:02:00.003-08:002022-06-24T10:54:10.047-07:00Count directories with Windows command line<span style="font-family: Courier New, Courier, monospace;">cd C:\Foo</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">REM Foo contains 2 files and 3 folders</span><br />
<span style="font-family: Courier New, Courier, monospace;">dir /b</span><br />
<span style="font-family: Courier New, Courier, monospace;">file1.txt</span><br />
<span style="font-family: Courier New, Courier, monospace;">file2.txt</span><br />
<span style="font-family: Courier New, Courier, monospace;">Folder1</span><br />
<span style="font-family: Courier New, Courier, monospace;">Folder2</span><br />
<span style="font-family: Courier New, Courier, monospace;">Folder3</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">REM Filter out files and '.' and '..' folders</span><br />
<span style="font-family: "Courier New", Courier, monospace;">for /f %i in ('dir /b /ad-s-h ^| find /i /v /c ""') do @echo %i</span><br />
<span style="font-family: "Courier New", Courier, monospace;">3</span>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-88882059590612864052018-09-11T22:39:00.002-07:002021-06-23T13:42:28.043-07:00Perl: How to capture a regex match in one line<pre style="background-color: #f6f8fa; border-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.6px; line-height: 1.45; overflow: auto; padding: 16px; word-break: normal; word-wrap: normal;"><span class="pl-k" style="box-sizing: border-box; color: #d73a49;">my</span> (<span class="pl-smi" style="box-sizing: border-box;">$match</span>) = <span class="pl-s" style="box-sizing: border-box; color: #032f62;"><span class="pl-pds" style="box-sizing: border-box;">"</span>some string<span class="pl-pds" style="box-sizing: border-box;">"</span></span> =~ <span class="pl-sr" style="box-sizing: border-box; color: #032f62;"><span class="pl-pds" style="box-sizing: border-box;">/</span>(some).*<span class="pl-pds" style="box-sizing: border-box;">/</span></span>;
<span class="pl-c1" style="box-sizing: border-box; color: #005cc5;">print</span> <span class="pl-smi" style="box-sizing: border-box;">$match</span>; <span class="pl-c" style="box-sizing: border-box; color: #6a737d;"><span class="pl-c" style="box-sizing: border-box;">#</span> prints "some"</span></pre>
Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-18197606805733426762017-03-17T15:46:00.001-07:002018-09-12T10:26:39.175-07:00Ten Years OnJust realized I've had this blog up on Blogger since February 2007.<br />
<br />
My site is <strike>now</strike> no longer hosted on GitHub pages at <a href="https://psteiner.com/">https://psteiner.com/</a><br />
<br />
See you <strike>there</strike> here!<br />
<br />
<span style="background-color: yellow;">[Edit - 11 Sept 2018: decided to move back, GitHub pages is too much work!]</span><br />
<div>
<span style="background-color: yellow;"><br /></span></div>
Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-34770116045388109792017-03-05T17:10:00.003-08:002017-03-05T17:10:55.170-08:00Control+Shift+Enter to launch a Windows program as admin!To launch any Windows program with elevated (admin) privileges, hold <span style="font-family: Courier New, Courier, monospace;"><b>Control+Shift</b></span> keys, then double-click the program's icon, even on the taskbar.<br />
<br />
Alternatively, hit the <span style="font-family: Courier New, Courier, monospace;"><b>Windows</b></span> key, type the program name, e.g. <b style="font-family: "Courier New", Courier, monospace;">cmd </b><span style="font-family: inherit;">then type </span><b style="font-family: "Courier New", Courier, monospace;">Control+Shift+Enter</b><span style="font-family: inherit;"> to launch the program with elevated (admin) privileges. You might have to enter admin credentials in the UAC popup.</span><br />
<br />
See <a href="http://lifehacker.com/5592973/use-ctrl%252Bshift%252Bclick-to-open-programs-as-administrator-in-windows-7">this LifeHacker article</a> for more details.Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-7764550659063593482016-04-13T17:30:00.004-07:002016-04-13T17:30:52.746-07:00How to check for admin rights from a Windows batch fileSimple check for administrative permissions in a batch file:<div>
<br /><span style="font-family: Courier New, Courier, monospace;">REM Check for admin rights - net session must run as admin</span><br />
<span style="font-family: Courier New, Courier, monospace;">net session >nul 2>&1</span><br />
<span style="font-family: Courier New, Courier, monospace;">if %ErrorLevel% NEQ 0 (</span><br />
<span style="font-family: Courier New, Courier, monospace;"> echo You must right-click and select "RUN AS ADMINISTRATOR" to run this script.</span><br />
<span style="font-family: Courier New, Courier, monospace;"> echo.</span><br />
<span style="font-family: Courier New, Courier, monospace;"> pause</span><br />
<span style="font-family: Courier New, Courier, monospace;"> exit /B</span><br />
<span style="font-family: Courier New, Courier, monospace;">)</span><br />
<div>
<br /></div>
</div>
Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-53662758980760011092016-02-17T13:40:00.000-08:002016-02-17T13:40:09.757-08:00Another HEREDOC style for Windows Batch Files<span style="font-family: inherit;">I wanted to pipe a SQL query to sqlplus in a batch file, without using a temp SQL file.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">That technique involves echo'ing the SQL </span>statements<span style="font-family: inherit;"> to a temp file, then call sqlplus on that file:</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">REM create the temp SQL file</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">echo SELECT USER >>temp.sql</span><br />
<span style="font-family: Courier New, Courier, monospace;">echo FROM DUAL; >>temp.sql</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">REM execute sqlplus</span><br />
<span style="font-family: Courier New, Courier, monospace;">sqlplus -S / @temp.sql</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">REM cleanup!</span><br />
<span style="font-family: Courier New, Courier, monospace;">del temp.sql</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">An alternative is to wrap the echo statements in parentheses "( ... )", so they execute as a block, then pipe "|" the result to sqlplus:</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">(</span><br />
<span style="font-family: Courier New, Courier, monospace;"> echo SELECT USER</span><br />
<span style="font-family: Courier New, Courier, monospace;"> echo FROM DUAL;</span><br />
<span style="font-family: Courier New, Courier, monospace;">) | sqlplus -S /</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">Admittedly, this is not much prettier than the first example, but it's self-contained, and doesn't leave random temp files that may or may not get cleaned up.</span>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-16808831498233437512014-05-09T17:13:00.002-07:002014-05-09T17:13:51.025-07:00HEREDOC for Windows Batch FilesFrom <a href="https://en.wikipedia.org/wiki/Here_document">Wikipedia</a>: "In <a href="https://en.wikipedia.org/wiki/Computer_science">computer science</a>, a here document (here-document, heredoc, hereis, here-string or here-script) is a file <a href="https://en.wikipedia.org/wiki/Literal_(computer_programming)">literal</a> or <a href="https://en.wikipedia.org/wiki/Input_stream">input stream</a> literal: it is a section of a <a href="https://en.wikipedia.org/wiki/Source_code">source code</a> file that is treated as if it were a separate file."<br />
<br />
<br />
Here's one way to accomplish this in a Windows batch file. Inside the batch file, <span style="font-family: Courier New, Courier, monospace;">echo</span> the text to an output redirection, e.g. "> here.txt". Use carets "^" followed by double linebreaks to output on separate lines:<br />
<br />
here_test.bat<br />
<hr />
<span style="font-family: Courier New, Courier, monospace;">echo This is my ^</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br />
</span> <span style="font-family: Courier New, Courier, monospace;">multi-line here document ^</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br />
</span> <span style="font-family: Courier New, Courier, monospace;">that this batch file ^</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br />
</span> <span style="font-family: Courier New, Courier, monospace;">will print! > here.txt</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br />
</span><br />
<hr />
When executed here_text.bat will create a new file here.txt containing the lines of text:<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">This is my</span><br />
<span style="font-family: Courier New, Courier, monospace;">multi-line here document</span><br />
<span style="font-family: Courier New, Courier, monospace;">that this batch file</span><br />
<span style="font-family: Courier New, Courier, monospace;">will print!</span></div>
Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com1tag:blogger.com,1999:blog-5625478444715094438.post-1311790238389707792014-03-03T20:13:00.001-08:002014-03-03T20:23:16.976-08:00Protective<div xmlns="http://www.w3.org/1999/xhtml">Noticed this rather defensive SSID in passing from my bus commute. I'm not sure if it's the WiFi or the Wife that's under guard, but the security's pretty robust. <br>
<a href="https://lh4.googleusercontent.com/-NnsJve86Iq0/UxVS-TvhjDI/AAAAAAAAGvA/53ywczqgkOI/s2560/1393906421375.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img border="0" src="https://lh4.googleusercontent.com/-NnsJve86Iq0/UxVS-TvhjDI/AAAAAAAAGvA/53ywczqgkOI/s288/1393906421375.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 162px; height: 288px;"></a></div>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0tag:blogger.com,1999:blog-5625478444715094438.post-87978442476274102932013-05-16T16:48:00.000-07:002013-05-16T17:02:13.446-07:00Do-it-yourself uptime command for Windows 7How long has my computer been running? A fundamental question that Unix-y systems can answer with the <span style="font-family: "Courier New", Courier, monospace;"><a href="http://en.wikipedia.org/wiki/Uptime">uptime</a></span> command. <br />
<br />
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 <span style="font-family: "Courier New", Courier, monospace;">net statistics</span> command. Put this in a file named <span style="font-family: "Courier New", Courier, monospace;">uptime.bat</span> somewhere on your path:<br />
<br />
<span style="font-family: "Courier New", Courier, monospace;">@echo off</span><br />
<span style="font-family: Courier New;">for /f "tokens=1,2,*" %%i in ('net statistics workstations ^| find "since"') do @echo %COMPUTERNAME% up since %%k</span><br />
<span style="font-family: Courier New;"></span><br />
<span style="font-family: inherit;">Then open a command prompt and type in the freshly minted command:</span><br />
<span style="font-family: Courier New;"></span><br />
<span style="font-family: "Courier New", Courier, monospace;">C:\Users\philip>uptime<br />MYCOMPUTER up since 5/15/2013 5:21:27 PM</span>Philip Steinerhttp://www.blogger.com/profile/13271984132120153264noreply@blogger.com0