<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8995876</id><updated>2024-09-11T15:15:41.980-04:00</updated><category term="instant_messaging"/><category term="AIM"/><category term="batch_files"/><category term="blogs"/><category term="hotkeys"/><category term="howto"/><category term="mobile"/><category term="news"/><category term="sms"/><category term="spugbrap"/><category term="wordpress"/><title type='text'>spugbrap&#39;s random notes geek blog</title><subtitle type='html'>A place to post my favorite scripts, regexes, commandlines, utilities, code snippets, etc. Things that might be useful to someone googling for an obscure solution some day, just as I often do.  Most often relating to cygwin, textpad, java, windows, bash, and javascript.  Whatever I would normally throw into a text file of stuff to keep in case I need it again someday.&lt;p&gt;&lt;b&gt;*** NOTE: My current blog is located at: &lt;a href=&quot;http://www.spugbrap.com/blog&quot;&gt;http://www.spugbrap.com/blog&lt;/a&gt; ***&lt;/b&gt;&lt;/p&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default?alt=atom&amp;redirect=false'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default?alt=atom&amp;start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8995876.post-6970629284163683739</id><published>2006-10-10T00:27:00.000-04:00</published><updated>2006-10-10T00:28:55.539-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogs"/><category scheme="http://www.blogger.com/atom/ns#" term="news"/><category scheme="http://www.blogger.com/atom/ns#" term="spugbrap"/><category scheme="http://www.blogger.com/atom/ns#" term="wordpress"/><title type='text'>Trying out wordpress</title><content type='html'>I recently started a new blog at &lt;a href=&quot;http://spugbrap.wordpress.com&quot;&gt;http://spugbrap.wordpress.com&lt;/a&gt;, which may replace both of my blogger.com blogs soon. I&#39;m trying out wordpress, comparing it with the new blogger beta, and will decide from there. &lt;br /&gt;&lt;br /&gt;At this point, I will probably be posting all new entries over there, so you may want to go ahead and subscribe to it via the &lt;a href=&quot;http://feeds.feedburner.com/spugbrap-wp&quot;&gt;Entries feed&lt;/a&gt;, and possibly the &lt;a href=&quot;http://feeds.feedburner.com/spugbrap-wp-comments&quot;&gt;Comments feed&lt;/a&gt;. I may cross-post a little bit, for the sake of comparing blogger beta vs. wordpress, but the wordpress one will be my primary outlet for all things geeky/personal/both (sometimes it&#39;s hard to draw the line).</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/6970629284163683739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/6970629284163683739' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/6970629284163683739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/6970629284163683739'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/10/trying-out-wordpress.html' title='Trying out wordpress'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-920277148703217487</id><published>2006-08-23T12:35:00.000-04:00</published><updated>2006-08-23T13:48:54.833-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="batch_files"/><category scheme="http://www.blogger.com/atom/ns#" term="hotkeys"/><category scheme="http://www.blogger.com/atom/ns#" term="instant_messaging"/><title type='text'>Batch file: Trillian global disconnect and reconnect</title><content type='html'>I use &lt;a href=&quot;http://www.trillian.cc&quot;&gt;Trillian&lt;/a&gt; for most of my instant messaging, because it allows me to connect to AIM and Yahoo through one common user interface (it also supports ICQ, MSN, and IRC, but I don&#39;t use [it for] those). The features I like about it are numerous, but one of my major complaints is the way it sometimes has trouble reconnecting after being disconnected from one of the networks. &lt;br /&gt;&lt;br /&gt;Normally, it tries a few times to reconnect, automatically. But sometimes it seems like it gives up too soon. When this happens, you have to right click the system tray icon, go to the &quot;Connections&quot; submenu, and choose &quot;Global Disconnect&quot;. Then, you have to do the exact same thing, but choose &quot;Global Reconnect&quot;. The initial &quot;Global Disconnect&quot; is usually required, because Trillian is stuck in a state where it thinks you are connected in some way, such that just doing &quot;Global Reconnect&quot; wouldn&#39;t do anything.&lt;br /&gt;&lt;br /&gt;As anyone that knows me could tell you, I hate doing extra steps, particularly involving the mouse, when a simple keyboard shortcut could suffice. So, several years ago, I made this simple batch file, which doesn&#39;t do anything magical, but I use it almost every day. &lt;br /&gt;&lt;br /&gt;The batch file, included in the box below, uses &lt;a href=&quot;http://tometheus.com/Trillian/TrillKey.html&quot;&gt;TrillKey&lt;/a&gt; to send a &quot;Global Disconnect&quot; command to the currently-running instance of Trillian. Then, it waits 1 second, to give Trillian time to deal with the first request. Then, it uses TrillKey to send a &quot;Global Reconnect&quot; command to Trillian. For the brief delay in between commends, I use the &#39;sleep&#39; command from cygwin, but a couple other ways to put delays into batch files can be found here: &lt;a href=&quot;http://malektips.com/xp_dos_0002.html&quot;&gt;http://malektips.com/xp_dos_0002.html&lt;/a&gt;.&lt;br /&gt;To call this batch file, I have a shortcut to it on my desktop, with a shortcut key assigned to it (Ctrl-Alt-T). Works like a charm!&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;border: #000000 1px solid; padding: 2px; font-face: Arial, Helvetica, sans-serif; width: auto;&quot;&gt;@echo off&lt;br /&gt;c:\programs\trillkey.exe disconnect&lt;br /&gt;sleep 1&lt;br /&gt;c:\programs\trillkey.exe reconnect&lt;/div&gt;&lt;br /&gt;While writing this post, I noticed that I&#39;m using a really old version of TrillKey (from 2002). The latest version includes additional features, so my batch file can be simplified to a single command:&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;border: #000000 1px solid; padding: 2px; font-face: Arial, Helvetica, sans-serif; width: auto;&quot;&gt;@c:\programs\trillkey.exe disconnect delay 1 reconnect&lt;/div&gt;&lt;br /&gt;TrillKey can do a LOT more than just disconnect and reconnect, though. I highly recommend checking it out.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/920277148703217487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/920277148703217487' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/920277148703217487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/920277148703217487'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/08/batch-file-trillian-global-disconnect.html' title='Batch file: Trillian global disconnect and reconnect'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-3646319912628711355</id><published>2006-08-21T08:49:00.000-04:00</published><updated>2006-08-21T09:01:07.110-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AIM"/><category scheme="http://www.blogger.com/atom/ns#" term="howto"/><category scheme="http://www.blogger.com/atom/ns#" term="instant_messaging"/><category scheme="http://www.blogger.com/atom/ns#" term="mobile"/><category scheme="http://www.blogger.com/atom/ns#" term="sms"/><title type='text'>How to send an SMS from cell phone to an AIM user</title><content type='html'>I&#39;m not sure if this is common knowledge or not, but I only learned about it recently. Some cell phones let you sign on to instant messenger clients (usually AIM), but that can be less than ideal. When I did that a couple years ago, every single communication my phone did with AIM counted as a text message. That includes messages you send or receive, as well as sign-on related messages, and even disconnection messages. I&#39;d get disconnected fairly frequently, and every time that happened, it would cost me 2-3 text messages to sign back on. At 10 cents a pop (unless you pay for a plan with a bucket of monthly text messages), that got annoying pretty fast.&lt;br /&gt;&lt;br /&gt;Well, I recently found out that you can send a message to an AIM user, using your cell phone, without logging on with any actual AIM client. Just send an SMS text message with the following format:&lt;br /&gt;&lt;br /&gt;&lt;div  style=&quot;border: 1px solid rgb(0, 0, 0); padding: 5px;font-family:Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;float: left; width: 100px;&quot;&gt;Recipient: &lt;/span&gt;&lt;span style=&quot;clear: right;&quot;&gt;265010&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;float: left; width: 100px;&quot;&gt;Message: &lt;/span&gt;&lt;span style=&quot;clear: right;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;AIM_screen_name&lt;/span&gt;: message text&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;I know there are all sorts of &quot;mobile AIM&quot; features, but this is one simple one that has come in handy several times for me, already.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/3646319912628711355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/3646319912628711355' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/3646319912628711355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/3646319912628711355'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/08/how-to-send-sms-from-cell-phone-to-aim.html' title='How to send an SMS from cell phone to an AIM user'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115522725824666355</id><published>2006-08-10T12:27:00.000-04:00</published><updated>2006-08-10T12:37:45.576-04:00</updated><title type='text'>How to list just directories in bash</title><content type='html'>This morning, I was trying to find a way to list just the subdirectories in the current directory, in a bash shell script I was writing. I thought it would be simple, but everything I tried seemed to either take an extraordinarily long time, or felt like an ugly hack. &lt;br /&gt;&lt;br /&gt;The first thing I tried was:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;find . -type d&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But this was extremely slow, because it was recursively searching inside every subdirectory as well. I just wanted a list of subdirectories inside the current directory. I won&#39;t bore you/clutter this post up with any more of my less-than-ideal methods. &lt;br /&gt;&lt;br /&gt;What follows are a couple of ways of doing what I was trying to do, which I found in a post (and its comments) on the Ubuntu Blog, &quot;&lt;a href=&quot;http://ubuntu.wordpress.com/2005/10/19/list-only-the-directories/&quot;&gt;List only the directories&lt;/a&gt;&quot;:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;ls -l | grep “^d”&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;This works, but gives a &#39;long&#39; directory listing, when all I wanted was a list of directory names.&lt;/span&gt;&lt;br /&gt;&lt;hr&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;find . -type d -maxdepth 1 -mindepth 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;This one was my favorite, since it used the method I originally tried, but it fixed the slowness by using parameters to avoid recursion. It gave me a couple warnings about the order of the parameters, though, so I changed it to this:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;color:red;&quot;&gt;find . -maxdepth 1 -mindepth 1 -type d&lt;/span&gt;&lt;br /&gt;&lt;hr&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;ls -d */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;This gave me the same output as the &#39;find&#39; method did, but some timing tests showed me that the &#39;find&#39; method was about 2 times faster.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115522725824666355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115522725824666355' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115522725824666355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115522725824666355'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/08/how-to-list-just-directories-in-bash.html' title='How to list just directories in bash'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115497195915008835</id><published>2006-08-07T13:32:00.000-04:00</published><updated>2006-08-15T13:54:46.463-04:00</updated><title type='text'>A Handy CSS Debugging Snippet</title><content type='html'>From &lt;a href=&quot;http://homepage.mac.com/chrispage/iblog/C42511381/E20060806095030/index.html&quot;&gt;A Handy CSS Debugging Snippet&lt;/a&gt;: &lt;br /&gt;&lt;blockquote&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;  * { outline: 2px dotted red }&lt;br /&gt;  * * { outline: 2px dotted green }&lt;br /&gt;  * * * { outline: 2px dotted orange }&lt;br /&gt;  * * * * { outline: 2px dotted blue }&lt;br /&gt;  * * * * * { outline: 1px solid red }&lt;br /&gt;  * * * * * * { outline: 1px solid green }&lt;br /&gt;  * * * * * * * { outline: 1px solid orange }&lt;br /&gt;  * * * * * * * * { outline: 1px solid blue }&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This code, if placed in your stylesheet, outlines every element on the page with colored boxes. I like this because it&#39;s simple, and I learned something from it. I had no idea that you could use an asterisk for a css selector. Then, the idea of stringing them together to represent the elements that are most deeply nested with different colored outlines. Pretty slick!&lt;br /&gt;&lt;br /&gt;I will probably still use the many functions in the Outline menu of the &lt;a href=&quot;http://chrispederick.com/work/webdeveloper/&quot;&gt;Web Developer Extension&lt;/a&gt; for &lt;a href=&quot;http://www.getfirefox.com&quot;&gt;Firefox&lt;/a&gt;, and the &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;displaylang=en&quot;&gt;Internet Explorer Developer Toolbar&lt;/a&gt;, for most of my everyday outlining-for-debugging needs. There are also bookmarklets out there to do this type of thing. But, this snippet deserves a spot in my toolbox, because it seems like it could could come in handy someday.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115497195915008835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115497195915008835' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115497195915008835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115497195915008835'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/08/handy-css-debugging-snippet.html' title='A Handy CSS Debugging Snippet'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115470720839636499</id><published>2006-08-04T12:00:00.000-04:00</published><updated>2006-08-15T13:55:52.693-04:00</updated><title type='text'>Disabling Message Center in RealPlayer via a simple registry edit</title><content type='html'>Random tidbit of potentially useful information... &lt;br /&gt;&lt;br /&gt;From &lt;a href=&quot;http://googlesystem.blogspot.com/2006/08/realplayer-spartan-version.html#115463205820736638&quot;&gt;a comment&lt;/a&gt; by Wulf on the &lt;a href=&quot;http://googlesystem.blogspot.com&quot;&gt;Google Operating System&lt;/a&gt; blog:&lt;blockquote&gt;While playing around in my Registry, I found an interesting entry from RealPlayer.&lt;br /&gt;&lt;br /&gt;If you change &lt;div style=&quot;border: #112233 1px solid;&quot;&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;HKEY_CURRENT_USER\Software\RealNetworks\Msg\&lt;br&gt;Preferences\Frequency &amp;gt; (default)&lt;/span&gt;&lt;/div&gt; from &lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;1&lt;/span&gt; to &lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;0&lt;/span&gt;, the &#39;Message Center&#39; (read: ads) won&#39;t come up anymore...&lt;/blockquote&gt;&lt;br /&gt;I haven&#39;t tried this, as I so rarely use RealPlayer that I don&#39;t even remember the annoyance that this tip claims to prevent. But, I did go ahead and make this registry value change, in the hopes that someday, something might less annoying. :) &lt;br /&gt;&lt;br /&gt;I actually took this opportunity to try out REG.EXE, the &quot;Console Registry Tool for Windows&quot; (it came with Windows XP Pro), which I&#39;ve never gotten around to messing with... So this is how I changed this particular registry key:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;reg add &lt;br /&gt; HKCU\Software\RealNetworks\Msg\Preferences\Frequency&lt;br /&gt; /ve /d 0&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115470720839636499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115470720839636499' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115470720839636499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115470720839636499'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/08/disabling-message-center-in-realplayer.html' title='Disabling Message Center in RealPlayer via a simple registry edit'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115454503565152267</id><published>2006-08-02T14:19:00.000-04:00</published><updated>2006-08-03T00:29:06.653-04:00</updated><title type='text'>screen in cygwin needs System attribute on SockDir files</title><content type='html'>This will not be of use to many, if any, but I expended effort trying to figure out how to solve this today, so I&#39;m posting it here for future reference, if nothing else.&lt;br /&gt;&lt;br /&gt;Today, at work, I ssh&#39;d to my home computer, and tried to run &#39;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;screen -r -d&lt;/span&gt;&#39;, to reattach to an existing session of &lt;a href=&quot;http://www.gnu.org/software/screen/screen.html&quot;&gt;gnu screen&lt;/a&gt; at home. Here&#39;s what happened:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;$ screen -r -d&lt;br /&gt;There is no screen to be detached.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I knew this was not true, so I tried this:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;$ screen -list&lt;br /&gt;No Sockets found in /tmp/uscreens/S-myusername.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I didn&#39;t believe it, because I knew I had an existing session open, so I looked for myself:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;$ ls -l /tmp/uscreens/S-myusername/&lt;br /&gt;total 2&lt;br /&gt;-rw-------  1 myusername None 54 Jul 24 14:35 1696.tty0.spugbrap-home&lt;br /&gt;-rw-------  1 myusername None 54 Aug  2 14:19 3500.tty0.spugbrap-home&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I saw it right there, so I looked to see if one of the processes that I had running in my existing screen session was still running:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;$ ps | grep perl&lt;br /&gt;     3204     368    3204       1760   13 1003 14:20:05 /usr/bin/perl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sure enough, there it was... So, I took a look at my SockDir on my laptop, at work, to see if permissions might be involved in some way:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;$ ls -l /tmp/uscreens/S-myusername/&lt;br /&gt;total 3&lt;br /&gt;srwx------ 1 myusername None 53 Aug  2 14:18 2568.tty1.dave-laptop&lt;br /&gt;srw------- 1 myusername None 53 Jul  4 01:05 3600.tty1.dave-laptop&lt;br /&gt;srw------- 1 myusername None 53 May 15 15:42 960.tty1.dave-laptop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ah hah! There was a difference! The &#39;s&#39; at the beginning of the permissions list on my laptop&#39;s SockDir contents, but not on my home machine&#39;s.&lt;br /&gt;&lt;br /&gt;So, I went searching for what the heck that &#39;s&#39; stands for, since usually, if anything, I either see an &#39;l&#39; (L) or a &#39;d&#39;. I checked the help, info, and man pages for &#39;ls&#39; and &#39;chmod&#39;, but didn&#39;t find anything that actually matched this flag. The closet thing was &#39;suid + executable&#39;, but when I tried to chmod that onto one of my files, the permissions showed &#39;-rws------&#39;, which is not what I was looking for. &lt;br /&gt;&lt;br /&gt;A google search or two, for things like &#39;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;srwx------&lt;/span&gt;&#39;, &#39;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;srw-------&lt;/span&gt;&#39;, &#39;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;srwx srw&lt;/span&gt;&#39;, &#39;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;cygwin srw&lt;/span&gt;&#39;, etc. didn&#39;t turn up anything useful - at least not in the first pages of results.&lt;br /&gt;&lt;br /&gt;I tried looking at my laptop&#39;s SockDir in windows explorer, and looking at the advanced security properties of one of the files. Nothing looked interesting. Then I looked at it from a command prompt (4nt), and saw this:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;[c:\]dir c:\cygwin\tmp\uscreens\S-myusername&lt;br /&gt;[...]&lt;br /&gt;              0 bytes in 0 files and 2 dirs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Oops, let&#39;s try with &#39;attrib&#39; instead of &#39;dir&#39;:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;[c:\]attrib c:\cygwin\tmp\uscreens\S-myusername&lt;br /&gt;__SA_  C:\cygwin\tmp\uscreens\S-myusername\2568.tty1.dave-laptop&lt;br /&gt;__SA_  C:\cygwin\tmp\uscreens\S-myusername\3600.tty1.dave-laptop&lt;br /&gt;__SA_  C:\cygwin\tmp\uscreens\S-myusername\960.tty1.dave-laptop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ah hah! The &#39;system&#39; and &#39;archive&#39; attributes were set on these files. So, I verified that these flags were NOT set on the files on my home machine:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;$ attrib &quot;c:\\cygwin\\tmp\\uscreens\\S-myusername\*&quot;&lt;br /&gt;           C:\cygwin\tmp\uscreens\S-myusername\1696.tty0.spugbrap-home&lt;br /&gt;           C:\cygwin\tmp\uscreens\S-myusername\3500.tty0.spugbrap-home&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sure enough, there&#39;s the difference. So, I set the &#39;system&#39; attribute on those files (didn&#39;t bother with &#39;archive&#39; attribute, though I&#39;m not sure what causes it to be there on my laptop but not on my home):&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;$ attrib +&quot;c:\\cygwin\\tmp\\uscreens\\S-myusername\*&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Verified that it worked:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;srw-------  1 myusername None 54 Jul 24 14:35 1696.tty0.spugbrap-home&lt;br /&gt;srw-------  1 myusername None 54 Aug  2 14:19 3500.tty0.spugbrap-home&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then, I tried connecting to my existing session, and it succeeded.&lt;br /&gt;&lt;br /&gt;While preparing this post, I experimented a little bit more, and noticed that, for some reason, my home pc is not creating these screen socket files with the required &#39;system&#39; attribute at all, anymore. I&#39;m not sure why this is happening, now, because I can&#39;t think of anything I&#39;ve done, recently, that might have caused any different behavior as far as permissions and such. &lt;br /&gt;&lt;br /&gt;I will post again if I figure this out, but for now I am content with adjusting the attribute manually. In theory, I can keep each screen session alive until my next reboot (which is rare), so I shouldn&#39;t have to do too many manual adjustments like this. I also welcome any comments on how to solve this problem, or any other &lt;a href=&quot;http://spugbrap.blogspot.com/2005/07/how-to-reattach-to-gnu-screen-sessions.html&quot;&gt;useful tips&lt;/a&gt; for effectively using &lt;a href=&quot;http://quark.humbug.org.au/blog/index.cgi/geek/tools/20050606214258.html&quot;&gt;gnu screen in cygwin&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115454503565152267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115454503565152267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115454503565152267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115454503565152267'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/08/screen-in-cygwin-needs-system.html' title='screen in cygwin needs System attribute on SockDir files'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115302615601586449</id><published>2006-07-16T00:53:00.000-04:00</published><updated>2006-07-16T01:02:36.016-04:00</updated><title type='text'>finding unique ips in access log that have something in common</title><content type='html'>search for a string in access log, extract only ip address from matching line, sort the list of ip&#39;s and remove duplicates, output the [shortened] list...&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;for ip in `grep -i firefox /cygdrive/w/resin/log/access.log \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;&amp;nbsp;&amp;nbsp;| grep -o &quot;^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}&quot; \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;&amp;nbsp;&amp;nbsp;| sort -u \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;&amp;nbsp;&amp;nbsp;| wc -l`; \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;&amp;nbsp;&amp;nbsp;do echo $ip; \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%; font-family: courier new;&quot;&gt;done&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115302615601586449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115302615601586449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115302615601586449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115302615601586449'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/07/finding-unique-ips-in-access-log-that.html' title='finding unique ips in access log that have something in common'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115302526248259271</id><published>2006-07-16T00:43:00.000-04:00</published><updated>2006-08-15T14:23:23.223-04:00</updated><title type='text'>perl urlencode without libs</title><content type='html'>&lt;span style=&quot;font-weight: bold;font-size:85%;&quot; &gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;$url = &quot;Foo bar com.dx?q=23&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%;&quot; &gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;$url =~ s/([^\w\-\.\@])/$1 eq &quot; &quot;?&quot;+&quot;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;sprintf(&quot;%%%2.2x&quot;,ord($1))/eg;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%;&quot; &gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;print $url;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I don&#39;t remember where I got this, but it must have come in handy for me at some point. Never hurts to have this kind of stuff laying around, just in case.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115302526248259271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115302526248259271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115302526248259271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115302526248259271'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/07/perl-urlencode-without-libs.html' title='perl urlencode without libs'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115282081230892792</id><published>2006-07-13T15:13:00.000-04:00</published><updated>2006-07-13T22:01:38.036-04:00</updated><title type='text'>Generating a random fake name from the commandline</title><content type='html'>Today I needed to come up with a list of lots of fake names for test data. In the past, I either manually entered well-known fictional character names (e.g. Homer J. Simpson), or used strings of characters (like &#39;asdf g. hjkl&#39; or &#39;aaaaaaaaaaaaaa&#39;). &lt;br /&gt;&lt;br /&gt;I remembered seeing some sort of test data generator, somewhere, recently, so I &lt;a href=&quot;http://www.m-w.com/dictionary/google&quot;&gt;googled&lt;/a&gt; for &quot;&lt;a href=&quot;http://www.google.com/search?q=fake+name+generator+test+data&quot;&gt;fake name generator test data&lt;/a&gt;&quot;. &lt;br /&gt;&lt;br /&gt;What I found was &lt;a href=&quot;http://www.fakenamegenerator.com&quot;&gt;http://www.fakenamegenerator.com&lt;/a&gt;, which generates realistic test data based on country, name origin, and gender specifications. More info on the site at the end of this post. Here&#39;s a set of commands that I put together to retrieve one fake name from that site:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-family:courier new;font-size:85%;&quot;&gt;curl -s -b agreement=Yes &quot;http://www.fakenamegenerator.com&quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-weight: bold;font-family:courier new;font-size:85%;&quot;&gt;| grep -o &#39;on Google&quot;&gt;\([^&lt;]\+\)&#39; &lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-weight: bold;font-family:courier new;font-size:85%;&quot;&gt;| sed -e &quot;s/[^&gt;]*&gt;\([^&lt;]\+\)&lt;.*/\1/g&quot; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When you use the site like a normal human being, the fake data that is generated includes full name, address, email address (usable, provided by an anonymous email service), phone number, mother&#39;s maiden name, date of birth, and credit card number (+ expiration date). Very cool! For a very small fee, you can also order a bulk batch of data, which also includes fake Social Security Numbers).&lt;br /&gt;&lt;br /&gt;However, being the penny-pinching and geeky type, I wanted to be able to generate my own list of fake names (without all the other info), for free. The set of commands listed above work right now, from a &lt;a href=&quot;http://www.cygwin.com&quot;&gt;cygwin&lt;/a&gt; bash shell, but will probably break sometime in the future, when the HTML structure of the page changes. Oh well.&lt;br /&gt;&lt;br /&gt;Oh yeah, don&#39;t forget to &lt;a href=&quot;http://www.fakenamegenerator.com&quot;&gt;read their terms of service&lt;/a&gt;&lt;span style=&quot;font-size:70%; position:relative; bottom: 0.5em;&quot;&gt;*&lt;/span&gt; before using the service... Right now, I could not find anything prohibiting the use of automated tools to generate and retrieve names, but use the above set of commands at your own risk!&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:70%; position:relative; bottom: 0.5em;&quot;&gt;*&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-size:78%;&quot;&gt;The terms of service page only displays one time, unless you clear/disable your cookies.&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115282081230892792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115282081230892792' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115282081230892792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115282081230892792'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/07/generating-random-fake-name-from.html' title='Generating a random fake name from the commandline'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115280449552737126</id><published>2006-07-13T11:14:00.000-04:00</published><updated>2006-08-15T14:25:34.193-04:00</updated><title type='text'>Using ImageMagick and 4NT to find jpegs by quality level</title><content type='html'>Using &lt;a href=&quot;http://www.imagemagick.com&quot;&gt;ImageMagick&lt;/a&gt; and &lt;a href=&quot;http://www.jpsoft.com/4ntdes.htm&quot;&gt;4NT&lt;/a&gt; to find and modify all jpegs in the current dir who have quality level 94:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%;&quot; &gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;for %f in (*.jpg) do (echo %f &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; identify -verbose %f | grep Quality &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| grep -o &quot;[0-9]*&quot;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%;&quot; &gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;iff &quot;%@execstr[identify -verbose %f &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| grep Quality | grep -o &quot;[0-9][0-9]&quot;]&quot; == &quot;94&quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;then &amp;amp; echo %f &amp;amp; endiff&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%;&quot; &gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;for %f in (*.jpg) do &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(iff &quot;%@execstr[identify -verbose %f &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| grep Quality | grep -o &quot;[0-9][0-9]&quot;]&quot; == &quot;94&quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;then &amp;amp; echo %f &amp;amp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mogrify -strip -quality 84 %f &amp;amp; endiff)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;Unrelated side note:&lt;br /&gt;This is one of several posts that I will be making in the near future, which come directly from my ever-growing toblog.txt file... No code cleanup or lengthly explanations, just commands I&#39;ve run at some point that I thought were worth saving.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115280449552737126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115280449552737126' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115280449552737126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115280449552737126'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/07/using-imagemagick-and-4nt-to-find.html' title='Using ImageMagick and 4NT to find jpegs by quality level'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115211015962374910</id><published>2006-07-05T10:12:00.000-04:00</published><updated>2006-07-19T10:04:34.820-04:00</updated><title type='text'>Bash history substitution</title><content type='html'>Anyone who has had an introductory unix course should know about the bash shell&#39;s &quot;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;history&lt;/span&gt;&quot; command, which gives you a numbered list of commands that you&#39;ve run previously.&lt;br /&gt;&lt;br /&gt;You can execute one of those commands again by doing:&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ ![number]&lt;/span&gt; (for a particular command you&#39;ve seen on the history list)&lt;br /&gt;or&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ !!&lt;/span&gt; (for the previous command/last command in the history list)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;One thing that I didn&#39;t learn in any class, but did find out about from a co-worker, several years ago, was history substitution. It&#39;s easy to run the previous command with minor changes, by using a caret-delimited substitution expression. Here&#39;s a very simple example:&lt;br /&gt;&lt;br /&gt;view a file:&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ cat spugbrap.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then, edit that same file:&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ ^cat^vim^&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;that gets expanded to (and executed as):&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ vim spugbrap.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I&#39;ve used this feature countless times since learning about it, but it always suffered from a limitation: If the pattern you&#39;re trying to match occurs multiple times in the previous commandline, this subtitution method only replaces the first occurrance of it. So, I recently decided to find out how to substitute multiple occurances, since I was sure there had to be an easy way. Here&#39;s one way I found:&lt;br /&gt;&lt;br /&gt;watch a couple of tomcat log files continuously:&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ tail -F ~/tomcat/logs/stdout_20060704.log ~/tomcat/logs/stderr_20060704.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The next day, the log file names are different, because they&#39;re date-based. so I want to change 20060704 to 20060705, and it needs to happen twice because the date occurs twice in that commandline. No problem! Assuming the previously executed command was the &quot;tail&quot; commandline, above, simply enter this:&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ !!:gs/20060704/20060705/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;that gets expanded to (and executed as):&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ tail -F ~/tomcat/logs/stdout_20060705.log ~/tomcat/logs/stderr_20060705.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What if my previous command was long, and I need to make multiple substitutions with multiple strings?&lt;br /&gt;&lt;br /&gt;previous command:&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ tail -F stdout_20060704.log stderr_20060704.log host-manager.2006-07-04.log catalina.2006-07-04.log admin.2006-07-04.log  localhost.2006-07-04.log manager.2006-07-04.log jakarta_service_20060704.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to change the dates, which occur in two formats:&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ !!:gs/20060704/20060705/:gs/2006-07-04/2006-07-05/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the command I want to run (with substitutions) was not the previous command, but some other command that appears in the numbered list from running &#39;history&#39;, put the history line number between the exclamation point and the colon:&lt;br /&gt;&lt;span style=&quot;font-weight:bold;font-size:85%;font-family:courier new,courier,monospace;&quot;&gt;$ !123:gs/oldstr/replacementstr/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For more information about this, and other bash history manipulation capabilities, check out:&lt;br /&gt;&lt;a href=&quot;http://web.mit.edu/gnu/doc/html/features_6.html&quot;&gt;Bash Features - Using History Interactively&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115211015962374910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115211015962374910' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115211015962374910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115211015962374910'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/07/bash-history-substitution.html' title='Bash history substitution'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115151219448171262</id><published>2006-06-28T12:13:00.000-04:00</published><updated>2006-06-28T12:29:54.556-04:00</updated><title type='text'>Making System.out.println() return a String</title><content type='html'>At some point, recently, I needed to do both of these things in one little Java expression:&lt;br /&gt;- output a String to stdout&lt;br /&gt;- return the same String&lt;br /&gt;&lt;br /&gt;System.out.println() returns &#39;void&#39;, and you can&#39;t cast void to String, so I struggled with this for a little while. Here&#39;s what I came up with (&lt;a href=&quot;http://www.oatmealcookies.org/blog/spugbrap/geek/java/VoidToString.java&quot;&gt;download here&lt;/a&gt; if it looks ugly in the blog):&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;public class VoidToString&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static void main(String[] args)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(&quot;returned value: [&quot; +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new Object() &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public String q(String p) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(&quot;stdout: [&quot; + p + &quot;]&quot;); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return p; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}.q(&quot;blah&quot;) + &quot;]&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;It ended up not working in the context I was trying to use it in, because the 3rd-party API I was using did not appreciate the inner class, but I still thought it was a neat little trick.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115151219448171262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115151219448171262' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115151219448171262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115151219448171262'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/06/making-systemoutprintln-return-string.html' title='Making System.out.println() return a String'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-115083149649550495</id><published>2006-06-20T15:24:00.000-04:00</published><updated>2006-08-15T14:29:25.903-04:00</updated><title type='text'>getting the current date in a particular format in Windows XP/2003</title><content type='html'>I needed to get the current date, in the format &#39;yyyy-MM-dd&#39;, and use that value multiple times within a batch file.&lt;br /&gt;&lt;br /&gt;The command &#39;DATE /T&#39; returns a date like this:&lt;br /&gt;Tue 06/20/2006&lt;br /&gt;&lt;br /&gt;But I needed:&lt;br /&gt;2006-06-20&lt;br /&gt;&lt;br /&gt;Now, this would have been extraordinarily easy, if I could use &lt;a href=&quot;http://www.jpsoft.com/4ntdes.htm&quot;&gt;4nt&lt;/a&gt;, &lt;a href=&quot;http://www.cygwin.com/&quot;&gt;cygwin&lt;/a&gt;, &lt;a href=&quot;http://www.stokebloke.com/software/index.php#nclip&quot;&gt;nclip&lt;/a&gt;, or any number of other tools.  However, my options were limited on the machine that I needed to run this on, as it is a production web application server.  So, I had to come up with a way to do this using the tools I had available to me:&lt;br /&gt;- Windows 2003 Server (assumed to be a default installation, or more minimal than that)&lt;br /&gt;- Sybase ASE 12.5.x&lt;br /&gt;- Java&lt;br /&gt;&lt;br /&gt;I probably could have just written a simple java application to do this, but where&#39;s the fun in THAT? :)&lt;br /&gt;&lt;br /&gt;So, I consulted with my good friend, Jeff Scanlon, as I usually do when I have an interesting tech challenge, and together we came up with this batch file [NOTE: you can &lt;a href=&quot;http://www.oatmealcookies.org/blog/spugbrap/geek/scripts/batch_files/generate_set_my_date.bat&quot;&gt;download it here&lt;/a&gt;, if the code gets too munged with the blogger html/css]:&lt;br /&gt;&lt;br /&gt;------ BEGIN BATCH FILE -------&lt;br /&gt;&lt;br /&gt;@echo off&lt;br /&gt;REM generate SQL script to get date in correct format:&lt;br /&gt;echo select &#39;set my_date=&#39; + str_replace(convert(char(20),getdate(),102),&#39;.&#39;,&#39;-&#39;) &gt;%TEMP%\getDate_yyyy-MM-dd.sql&lt;br /&gt;echo go &gt;&gt;%TEMP%\getDate_yyyy-MM-dd.sql&lt;br /&gt;&lt;br /&gt;REM run the SQL script to generate a simple, temporary batch file:&lt;br /&gt;isql -U username -P password -i %TEMP%\getDate_yyyy-MM-dd.sql | findstr set &gt;%TEMP%\set_my_date.bat&lt;br /&gt;&lt;br /&gt;REM run the temporary batch file, which will set an environment variable, &#39;MY_DATE&#39;, to contain the date:&lt;br /&gt;call %TEMP%\set_my_date.bat&lt;br /&gt;&lt;br /&gt;REM clean up&lt;br /&gt;del /q %TEMP%\set_my_date.bat&lt;br /&gt;del /q %TEMP%\getDate_yyyy-MM-dd.sql&lt;br /&gt;&lt;br /&gt;REM this is where you&#39;d actually put code that uses the date, like:&lt;br /&gt;REM md c:\backup\%MY_DATE%&lt;br /&gt;REM copy c:\mystuff\*.* c:\backup\%MY_DATE%&lt;br /&gt;&lt;br /&gt;------ END BATCH FILE -------</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/115083149649550495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/115083149649550495' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115083149649550495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/115083149649550495'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/06/getting-current-date-in-particular_20.html' title='getting the current date in a particular format in Windows XP/2003'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-114679892898431618</id><published>2006-05-04T23:08:00.000-04:00</published><updated>2006-05-05T12:48:06.916-04:00</updated><title type='text'>How to list duplicate lines in a text file, with counts next to each unique line</title><content type='html'>At some point, last year (it&#39;s been in my &#39;toblog&#39; file all this time), I needed to analyze the lines in a text file, removing duplicate lines, while counting how many times each duplicated line occurred within the file, and sorting from most common to least common.  &lt;br /&gt;&lt;br /&gt;For example, using a text file called &#39;dupetest.txt&#39;, containing:&lt;br /&gt;&lt;table border=&quot;1&quot; style=&quot;font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: bold; font-size: 75%; border: 1px solid #333333; padding: 0px; width: auto;&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;foo bar baz&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;foo qux corge&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;spugbrap likes bacon&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;foo qux corge&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;spugbrap likes bacon&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;foo bar baz&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;oatmeal cookies are good&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;oatmeal cookies are good&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;foo bar baz&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;foo qux corge&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;foo bar baz&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;The output I want is:&lt;br /&gt;&lt;table border=&quot;1&quot; style=&quot;font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: bold; font-size: 75%; border: 1px solid #333333; padding: 0px; width: auto;&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;4 foo bar baz&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;3 foo qux corge&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;2 spugbrap likes bacon&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border: 1px solid #999999; padding: 1px;&quot;&gt;2 oatmeal cookies are good&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;I knew there had to be a simple way of doing this by just stringing together a few unix commands (in cygwin), but finding the right combination of commands took me some effort.  Here&#39;s what I came up with:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: bold; font-size: 75%;&quot;&gt;sort dupetest.txt | uniq -c -d | sort -n -r&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/114679892898431618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/114679892898431618' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/114679892898431618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/114679892898431618'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/05/how-to-list-duplicate-lines-in-text.html' title='How to list duplicate lines in a text file, with counts next to each unique line'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-114623227189044154</id><published>2006-04-28T09:27:00.000-04:00</published><updated>2006-04-28T12:36:06.836-04:00</updated><title type='text'>Talking over SSL from Java</title><content type='html'>For the first time in this blog, I&#39;m pleased to present to you a &lt;br /&gt;guest post from my good friend, Jeff Scanlon:&lt;br /&gt;&lt;hr&gt;Talking over SSL from Java&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;When using SSLFactory to talk SSL with a server, or using &lt;br /&gt;the URL class to open an https connection, an error you &lt;br /&gt;might encounter is:&lt;br /&gt;&lt;br /&gt;sun.security.validator.ValidatorException: PKIX path building failed: &lt;br /&gt;sun.security.provider.certpath.SunCertPathBuilderException: &lt;br /&gt;unable to find valid certification path to requested target&lt;br /&gt;&lt;br /&gt;One solution that worked for me is to add the server certificate &lt;br /&gt;to the cacerts file in the appropriate Java runtime.&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You must have the server certificate. If you don&#39;t have this &lt;br /&gt;   handy, navigate to the secure website, click on the lock icon &lt;br /&gt;   (in Internet Explorer). Click on &quot;Details&quot; tab and then click &lt;br /&gt;   the &quot;Copy to File...&quot; button. Export the certificate to a DER &lt;br /&gt;   encoded binary X.509 (.CER) file. Let&#39;s say you chose the &lt;br /&gt;   filename example.cer&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Copy example.cer to the jre/lib/security directory in the Java &lt;br /&gt;   runtime you are using. If you&#39;re on Windows and the JDK/JRE &lt;br /&gt;   is in C:\jdk1.5.0_04, then the full path is:&lt;br /&gt;   C:\jdk1.5.0_04\jre\lib\security&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Import the certificate into the cacerts file by using the &lt;br /&gt;   following command [&lt;span style=&quot;font-size: 75%; font-style: italic;&quot;&gt;editor&#39;s note: this is all one command, broken &lt;br /&gt;   into multiple lines for blogging&lt;/span&gt;]:&lt;br /&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: bold; font-size: 75%&quot;&gt;&lt;br /&gt;   keytool -import -storepass changeit -file &lt;br /&gt;   &amp;nbsp;&amp;nbsp;example.cer -keystore cacerts &lt;br /&gt;   &amp;nbsp;&amp;nbsp;-alias example&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   &#39;changeit&#39; is the default password to the cacerts keystore&lt;br /&gt;   &#39;example.cer&#39; is the filename you used in step #1&lt;br /&gt;   &#39;example&#39; is an arbitrary alias you choose for the certificate&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Now try your code and see if it can establish the SSL &lt;br /&gt;   connection. If you get an error like &#39;HTTPS hostname &lt;br /&gt;   wrong: should be ____&#39;, then add this code:&lt;br /&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: bold; font-size: 75%&quot;&gt;&lt;br /&gt;       import javax.net.ssl.HostnameVerifier;&lt;br /&gt;       import javax.net.ssl.HttpsURLConnection;&lt;br /&gt;       import javax.net.ssl.SSLSession;&lt;br /&gt;&lt;br /&gt;       // -------------------------------------------------&lt;br /&gt;&lt;br /&gt;       HostnameVerifier hv = new HostnameVerifier() {&lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public boolean verify(String hostName, &lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SSLSession session)&lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(&lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;hostName is [&quot; + hostName + &lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;] and session peer host is [&quot; + &lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;session.getPeerHost() + &quot;]&quot;);&lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return(true);&lt;br /&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;       };&lt;br /&gt;&lt;br /&gt;       HttpsURLConnection.setDefaultHostnameVerifier(hv);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;   The above code provides a hostname verifier replacement that &lt;br /&gt;   will cause hostname verification to succeed (by always &lt;br /&gt;   returning true). Be aware that using this code does have &lt;br /&gt;   security implications. However, this simplistic verify &lt;br /&gt;   replacement should solve SSL communication problems and &lt;br /&gt;   provide a starting point for implementing a custom verify &lt;br /&gt;   that maintains security.&lt;/ol&gt;&lt;hr&gt;&lt;span style=&quot;font-style: italic&quot;&gt;Jeff has been a good friend of mine for about 16 years, now.  &lt;br /&gt;He has been published several times (such as &lt;a href=&quot;http://www.amazon.com/gp/product/0764574868/102-2449647-2772914?v=glance&amp;n=283155&quot;&gt;here&lt;/a&gt;, &lt;br /&gt;&lt;a href=&quot;http://www.ddj.com/184414774&quot;&gt;here&lt;/a&gt;, and &lt;a href=&quot;http://www.ddj.com/184414718&quot;&gt;here&lt;/a&gt;), and is usually the first person I turn &lt;br /&gt;to for ideas/advice on any programming/computer-related topic.  He will definitely be contributing to this blog again in the future.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/114623227189044154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/114623227189044154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/114623227189044154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/114623227189044154'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/04/talking-over-ssl-from-java.html' title='Talking over SSL from Java'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-114127499302432149</id><published>2006-03-01T22:39:00.000-05:00</published><updated>2006-06-07T20:54:53.416-04:00</updated><title type='text'>html form tag without the top/bottom padding</title><content type='html'>&lt;span&gt;This seems like such a simple thing, but I&#39;m really happy to be able to add it to my collection of useful code snippets:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;The important part (HTML code snippet):&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Courier New, monospace; font-weight: bold; font-size: 11pt;&quot;&gt;&amp;lt;form style=&quot;display: inline; margin: 0px;&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Explanation/history/context:&lt;/b&gt;&lt;br /&gt;For years, now, I&#39;ve just accepted (but been annoyed by) the fact that the HTML FORM tag causes some whitespace to display above and below the form contents:&lt;br /&gt;&lt;table cellspacing=&quot;0&quot; style=&quot;border:1px solid #999999; padding: 3px 3px 3px 3px; width:auto;&quot;&gt;&lt;tr&gt;&lt;th style=&quot;text-align: center; border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;html&lt;/th&gt;&lt;th style=&quot;text-align: center; border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;screenshot&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;&lt;span&gt;Form outside table:&lt;br /&gt;&lt;br /&gt;Text above table&lt;br /&gt;&amp;lt;form&amp;gt;&lt;br /&gt;&amp;lt;table&amp;nbsp;border=&quot;1&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;table&amp;nbsp;cell&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;Text below table&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;&lt;img style=&quot;CURSOR: hand&quot; alt=&quot;&quot; src=&quot;http://photos1.blogger.com/blogger/1483/637/320/form_outside_table_screenshot.jpg&quot; border=&quot;0&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;One common way of avoiding that whitespace padding is to stick the FORM tag inside a TABLE tag, floating freely without being inside any particular row/cell, like this:&lt;br /&gt;&lt;table cellspacing=&quot;0&quot; style=&quot;border:1px solid #999999; padding: 3px 3px 3px 3px; width:auto;&quot;&gt;&lt;tr&gt;&lt;th style=&quot;text-align: center; border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;html&lt;/th&gt;&lt;th style=&quot;text-align: center; border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;screenshot&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;&lt;span&gt;Form inside table:&lt;br /&gt;&lt;br /&gt;Text above table&lt;br /&gt;&amp;lt;table&amp;nbsp;border=&quot;1&quot;&amp;gt;&lt;br /&gt;&amp;lt;form&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;table&amp;nbsp;cell&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;Text below table&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/1483/637/320/form_inside_table_screenshot.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;I&#39;ve never bothered to find a better way, until recently, when I decided that I didn&#39;t like HTML validators complaining about that.  So I searched and found a method of avoiding that whitespace that&#39;s simple, seems to work fine in multiple browsers, and passes HTML validation:&lt;br /&gt;&lt;table cellspacing=&quot;0&quot; style=&quot;border:1px solid #999999; padding: 3px 3px 3px 3px; width:auto;&quot;&gt;&lt;tr&gt;&lt;th style=&quot;text-align: center; border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;html&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;&lt;span&gt;Form outside table with style:&lt;br /&gt;&lt;br /&gt;Text above table&lt;br /&gt;&amp;lt;form&amp;nbsp;style=&quot;display:&amp;nbsp;inline;&amp;nbsp;margin:&amp;nbsp;0px;&quot;&amp;gt;&lt;br /&gt;&amp;lt;table&amp;nbsp;border=&quot;1&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;table&amp;nbsp;cell&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;Text below table&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th style=&quot;text-align: center !important; border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;screenshot&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;border:1px solid #999999; padding: 2px 2px 2px 2px;&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/1483/637/320/form_outside_table_with_style_screenshot.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/114127499302432149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/114127499302432149' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/114127499302432149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/114127499302432149'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/03/html-form-tag-without-topbottom.html' title='html form tag without the top/bottom padding'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-113919049438827793</id><published>2006-02-05T19:38:00.000-05:00</published><updated>2006-02-05T20:48:44.856-05:00</updated><title type='text'>Removing empty macros from Excel, to avoid popup security dialog</title><content type='html'>Anyone that&#39;s ever dealt with Excel has probably seen this security warning dialog about macros:&lt;br /&gt;&lt;a href=&quot;http://www.oatmealcookies.org/blog/spugbrap/geek/images/excel-macros-security-warning-screenshot.jpg&quot;&gt;&lt;img src=&quot;http://www.oatmealcookies.org/blog/spugbrap/geek/images/excel-macros-security-warning-screenshot.jpg&quot; border=&quot;1&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It&#39;s one thing if the spreadsheet actually has macros in it, especially if it actually *uses* the macros in it.  But even if you create a macro, and subsequently delete it, you still get this warning.  &lt;br /&gt;&lt;br /&gt;I found &lt;a href=&quot;http://www.contextures.com/xlfaqIndex.html&quot;&gt;an Excel FAQ&lt;/a&gt; today that included &lt;a href=&quot;http://www.contextures.com/xlfaqMac.html#NoMacros&quot;&gt;instructions for fixing this&lt;/a&gt;.  Worked for me!</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/113919049438827793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/113919049438827793' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113919049438827793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113919049438827793'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/02/removing-empty-macros-from-excel-to.html' title='Removing empty macros from Excel, to avoid popup security dialog'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-113899230069776998</id><published>2006-02-03T12:21:00.000-05:00</published><updated>2006-02-06T09:40:17.160-05:00</updated><title type='text'>Finding and un-removing files that I did a &#39;cvs remove&#39; on yesterday</title><content type='html'>Last July, &lt;a href=&quot;http://spugbrap.blogspot.com/2005/07/cvsrecentbsh.html&quot;&gt;I posted a bash shell script called &#39;cvsrecent.bsh&#39;&lt;/a&gt;, the purpose of which was &quot;to get a list of CVS revisions and log messages for all checkins within the past (some number) of days.&quot;&lt;br /&gt;&lt;br /&gt;I&#39;ve continued to use this script, to this day, but I found a shortcoming this morning that I hadn&#39;t noticed before.  It doesn&#39;t find files that have been removed from your working directory or the repository.  I removed some files from my working directory and did &#39;cvs remove&#39; on them yesterday, and today I decided I need to undo that.  &lt;br /&gt;&lt;br /&gt;So, I wrote a set of commands to find and check out the last version of all files that were deleted some number of days ago.  Here are the components I used:&lt;br /&gt;&lt;br /&gt;First, a bash function to get previous revision of a file:&lt;br /&gt;&lt;span style=&quot;font-family: Courier New, monospace; font-weight: bold; font-size: 75%&quot;&gt;function&amp;nbsp;cvsprev()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;cvs&amp;nbsp;-q&amp;nbsp;log&amp;nbsp;$@&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;grep&amp;nbsp;&quot;^revision&amp;nbsp;&quot;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;head&amp;nbsp;-2&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tail&amp;nbsp;-1&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cut&amp;nbsp;-f2&amp;nbsp;-d&quot;&amp;nbsp;&quot;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next, a bash function to get the date for some number of days ago, and format it the way cvs likes it:&lt;br /&gt;&lt;span style=&quot;font-family: Courier New, monospace; font-weight: bold; font-size: 75%&quot;&gt;function&amp;nbsp;getdaysagodate()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;date&amp;nbsp;--date=&quot;$1&amp;nbsp;days&amp;nbsp;ago&quot;&amp;nbsp;+&quot;%Y-%m-%d&quot;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Finally, here&#39;s the set of commands I used to:&lt;ol style=&quot;list-style-type: decimal&quot;&gt;&lt;li&gt;find all the files that CVS put in the &quot;Attic&quot; some number of days ago (in my case, I used 1 (one) since I removed the files yesterday).&lt;/li&gt;&lt;li&gt;for each file:&lt;ol style=&quot;list-style-type:lower-alpha&quot;&gt;&lt;li&gt;get the full working-directory path&lt;/li&gt;&lt;li&gt;find the last revision number, before it was removed&lt;/li&gt;&lt;li&gt;do a &#39;cvs update -r&#39; to check out the last version of the file&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style=&quot;font-family: Courier New, monospace; font-weight: bold; font-size: 75%&quot;&gt;for&amp;nbsp;f&amp;nbsp;in&amp;nbsp;&amp;nbsp;`cvs&amp;nbsp;-Q&amp;nbsp;log&amp;nbsp;-SNd&amp;nbsp;&quot;&gt;=$(getdaysagodate&amp;nbsp;1)&quot;&amp;nbsp;|&amp;nbsp;&amp;nbsp;grep&amp;nbsp;-A1&amp;nbsp;Attic&amp;nbsp;|&amp;nbsp;&amp;nbsp;sed&amp;nbsp;-e&amp;nbsp;&quot;s/^.*Attic.*$//&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-e&amp;nbsp;&quot;s/^\-\-$//&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-e&amp;nbsp;&quot;s/Working&amp;nbsp;file:&amp;nbsp;//&quot;`;&amp;nbsp;&lt;br /&gt;do&amp;nbsp;cvs&amp;nbsp;update&amp;nbsp;-r&amp;nbsp;`cvsprev&amp;nbsp;$f`&amp;nbsp;$f;&amp;nbsp;&lt;br /&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another command could be added to check those files back into CVS automatically, but I wasn&#39;t 100% certain that I wanted to check all of them back in.  I mainly just wanted to find them, and look at them.  Maybe sometime I&#39;ll update the cvsrecent.bsh script, so it can handle files that have been removed.  At least I&#39;m half-way there after having written these commands today.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/113899230069776998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/113899230069776998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113899230069776998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113899230069776998'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2006/02/finding-and-un-removing-files-that-i.html' title='Finding and un-removing files that I did a &#39;cvs remove&#39; on yesterday'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-113388282750964208</id><published>2005-12-06T10:22:00.000-05:00</published><updated>2005-12-06T10:59:20.333-05:00</updated><title type='text'>roundabout connection from my desktop to laptop</title><content type='html'>hahaha, talk about overkill... &lt;br /&gt;&lt;br /&gt;I&#39;m connecting to my laptop from my desktop PC (sitting right next to each other), but it&#39;s quite a roundabout way...&lt;br /&gt;&lt;br /&gt;- Laptop is wirelessly connecting to router #1&lt;br /&gt;- Desktop is plugged into wireless router #2 (with sveasoft firmware, configured to &lt;a href=&quot;http://forums.anandtech.com/messageview.aspx?catid=36&amp;threadid=1513386&amp;enterthread=y&quot;&gt;act as a bridge to router #1&lt;/a&gt;)&lt;br /&gt;- Both machines are connected to my company&#39;s VPN.&lt;br /&gt;&lt;br /&gt;and yet I think that&#39;s what I have to do in order to connect from desktop to laptop, and maintain the network environment I need right now. hehe</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/113388282750964208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/113388282750964208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113388282750964208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113388282750964208'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2005/12/roundabout-connection-from-my-desktop.html' title='roundabout connection from my desktop to laptop'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-113345355091263108</id><published>2005-12-01T06:00:00.000-05:00</published><updated>2005-12-01T11:24:07.736-05:00</updated><title type='text'>Windows XP cmd.exe file/directory name completion</title><content type='html'>In Windows XP, to enable/customize &lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;CMD.EXE&lt;/span&gt; file/directory name completion, open &lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;REGEDIT&lt;/span&gt; and go to this key:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;HKEY_CURRENT_USER\Software\Microsoft\Command Processor&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here&#39;s some info on the values that may be present, and my own settings.&lt;br /&gt;&lt;br /&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; border=&quot;1&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Value Name&lt;/th&gt;&lt;th&gt;Value Type&lt;/th&gt;&lt;th&gt;Default&lt;/th&gt;&lt;th&gt;My Setting&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;CompletionChar&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;REG_DWORD&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;0x06&lt;/span&gt;&lt;i&gt; (Ctrl-F)&lt;/i&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;0x09&lt;/span&gt;&lt;i&gt; (TAB)&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;PathCompletionChar&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;REG_DWORD&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;0x04&lt;/span&gt;&lt;i&gt; (Ctrl-D)&lt;/i&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;0x09&lt;/span&gt;&lt;i&gt; (TAB)&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;EnableExtensions&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;REG_DWORD&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;i&gt;[not sure]&lt;/i&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;0x01&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/113345355091263108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/113345355091263108' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113345355091263108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113345355091263108'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2005/12/windows-xp-cmdexe-filedirectory-name.html' title='Windows XP cmd.exe file/directory name completion'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-113328282068945272</id><published>2005-11-29T11:47:00.000-05:00</published><updated>2005-11-29T12:58:17.463-05:00</updated><title type='text'>IE Tab FireFox Extension is great!</title><content type='html'>The &lt;a href=&quot;https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&amp;amp;id=1419&quot;&gt;IE Tab FireFox Extension&lt;/a&gt; is awesome!  It allows you to open the current page in a new tab, rendered by the Internet Explorer engine.&lt;br /&gt;&lt;br /&gt;Although most sites work fine in FireFox, it&#39;s an unfortunate fact of life that some sites are designed to work with Internet Explorer only.  To deal with this, I&#39;ve been using the &lt;a href=&quot;https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&amp;id=35&quot;&gt;IE View FireFox Extension&lt;/a&gt;, which allows you to open the current page in an Internet Explorer window.  &lt;br /&gt;&lt;br /&gt;It allows you to define a list of sites that will always open in IE, which is useful if you use FireFox as your primary browser, but frequently need to use some IE-only sites.&lt;br /&gt;&lt;br /&gt;This new IE Tab extension allows you to configure the same kind of list.. sites that will always open in an IE Tab.  It even supports Ctrl-leftclick to open the current IE Tab into a new Internet Explorer window, using the IE View extension!  I highly recommend both of these extensions.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/113328282068945272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/113328282068945272' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113328282068945272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113328282068945272'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2005/11/ie-tab-firefox-extension-is-great.html' title='IE Tab FireFox Extension is great!'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-113277349700569293</id><published>2005-11-23T14:04:00.000-05:00</published><updated>2006-07-24T11:23:48.350-04:00</updated><title type='text'>Simple column name list in sybase with sqsh</title><content type='html'>At my current job, we primarily use Sybase ASE for our database servers. For most of my querying needs, I use a nice little tool called &lt;a href=&quot;http://sourceforge.net/projects/sqsh&quot;&gt;sqsh&lt;/a&gt;, a handy replacement for the basic Sybase &#39;isql&#39;.&lt;br /&gt;&lt;br /&gt;I hate the excessive amounts of output that sybase gives me when I do &#39;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;sp_help [table_name]&lt;/span&gt;&#39;, because most of the time all I&#39;m trying to do is get a list of column names for a particular table.&lt;br /&gt;&lt;br /&gt;MySql&#39;s &#39;show databases&#39;, &#39;show tables&#39;, &#39;show columns&#39;, etc. seem so much more intuitive to me.&lt;br /&gt;&lt;br /&gt;So, a couple days ago I chained together a few tools, and created an alias + function combo that let me simply type &#39;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;show_columns [table_name]&lt;/span&gt;&#39;, and get nothing but a quick list of column names.&lt;br /&gt;&lt;br /&gt;Here is what I added to my .sqshrc file to make this a permanent addition to my collection of useful commands&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-weight:bold&quot;&gt;\func show_columns_func&lt;br /&gt;\echo Column list for table: ${1}&lt;br /&gt;sp_help ${1}; -m vert  grep &quot;Column_name:&quot;  \sed -e &#39;s/Column_name: *\([^ ]\)/\1/g&#39;&lt;br /&gt;\done&lt;br /&gt;\alias show_columns=&quot;\call show_columns_func &quot; &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/113277349700569293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/113277349700569293' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113277349700569293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/113277349700569293'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2005/11/simple-column-name-list-in-sybase-with.html' title='Simple column name list in sybase with sqsh'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-112935359343222952</id><published>2005-10-15T01:11:00.000-04:00</published><updated>2005-11-07T12:53:10.816-05:00</updated><title type='text'>Internet Explorer: explorer.exe versus iexplore.exe</title><content type='html'>For several months, my profile on my home desktop PC was behaving strangely. Over time, the one EXPLORER.EXE process kept growing and growing in resource usage (memory + handles + everything else, it seemed), until eventually it would crash. If I logged out once in a while, and logged back in, I got a fresh EXPLORER.EXE instance with no memory leak. This was not an ideal solution, but it worked for a while.&lt;br /&gt;&lt;br /&gt;Well, I recently read &lt;a href=&quot;http://blogs.msdn.com/ie/archive/2005/09/16/469686.aspx&quot;&gt;an article in the IEBlog&lt;/a&gt;, which announced a beta version of the &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;displaylang=en&quot;&gt;Internet Explorer Developer Toolbar&lt;/a&gt;. This toolbar is long overdue, and although I still prefer the &lt;a href=&quot;https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&amp;amp;category=Developer%20Tools&amp;amp;id=60&quot;&gt;Web Developer Toolbar extension for Firefox&lt;/a&gt;, this is a big step in the right direction! They do share some similar features, and I use both every day now.&lt;br /&gt;&lt;br /&gt;I installed it on my work laptop just fine, but when I tried to install it on my home PC, the toolbar did not show up in IE. I logged in with my wife&#39;s profile, and she (someone who doesn&#39;t need such a toolbar) could open it just fine. But not me. So, I poked around for quite a while, using various tools such as these 3 freeware tools from &lt;a href=&quot;http://www.sysinternals.com/&quot;&gt;Sysinternals&lt;/a&gt;: &lt;a href=&quot;http://www.sysinternals.com/Utilities/Filemon.html&quot;&gt;Filemon&lt;/a&gt;, &lt;a href=&quot;http://www.sysinternals.com/Utilities/Regmon.html&quot;&gt;Regmon&lt;/a&gt;, and &lt;a href=&quot;http://www.sysinternals.com/Utilities/ProcessExplorer.html&quot;&gt;ProcessExplorer&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I sat there and compared my laptop with my desktop, with all unnecessary processes stopped or filtered, and tried to watch the effects of toggling the toolbar on and off (On my PC, even though the toolbar would not display, it was listed in the toolbars context menu and could be toggled).&lt;br /&gt;&lt;br /&gt;Eventually, I found a major difference. On my laptop, there was one main EXPLORER.EXE process, and then for every Internet Explorer window I had open, there was a separate IEXPLORE.EXE process. On my desktop, there was one EXPLORER.EXE process, and that was it. No matter how many IE windows I had open, it was all running inside one process.&lt;br /&gt;&lt;br /&gt;I compared the options in my desktop and laptop network and system settings, because I remembered something in there about launching new processes (in Control Panel  Folder Options  View, a checkbox called &#39;Launch folder windows in a separate process&#39;). That was checked on both machines, but didn&#39;t affect these web browser windows.&lt;br /&gt;&lt;br /&gt;So I did some searching to find out how to change this, and eventually found &lt;a href=&quot;http://www.codeguru.com/forum/archive/index.php/t-318293.html&quot;&gt;a relevant message thread&lt;/a&gt; which, at the end of the thread (of course), referenced &lt;a href=&quot;http://www.winguides.com/registry/display.php/964/&quot;&gt;a useful solution&lt;/a&gt;.&lt;br /&gt;Add this registry value (and the key, too, if it&#39;s not there):&lt;br /&gt;&lt;table cellspacing=&quot;2&quot; cellpadding=&quot;1&quot; border=&quot;1&quot;&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Key:&lt;/td&gt;&lt;td&gt;&lt;table cellspacing=&quot;1&quot; cellpadding=&quot;0&quot; border=&quot;0&quot;&gt;&lt;tr valign=&quot;top&quot;&gt;&lt;td&gt;HKEY_CURRENT_USER\Software\&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Microsoft\WindowsCurrentVersion\&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Explorer\BrowseNewProcess&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Value Name:&lt;/td&gt;&lt;td&gt;BrowseNewProcess&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Data Type:&lt;/td&gt;&lt;td&gt;REG_SZ (String Value)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Value Data:&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;Phew! Adding that key did the trick, solving both my Developer Toolbar problem and my memory leak problem.</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/112935359343222952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/112935359343222952' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/112935359343222952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/112935359343222952'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2005/10/internet-explorer-explorerexe-versus.html' title='Internet Explorer: explorer.exe versus iexplore.exe'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8995876.post-112932048146108918</id><published>2005-10-14T15:32:00.000-04:00</published><updated>2005-10-14T16:15:00.053-04:00</updated><title type='text'>Web pages that capture keypresses are evil!</title><content type='html'>I hate it when I encounter a web page that tries to be fancy and make its own hotkeys to navigate within the page.  Well, I usually hate it anyways.  I like that &lt;a href=&quot;http://mail.google.com/support/bin/answer.py?answer=6594&quot;&gt;gmail has keyboard shortcuts&lt;/a&gt;, and the most important thing is that their keyboard shortcuts are simple (letter keys) and only affect the behavior of the gmail site.  They don&#39;t capture keypresses that would ordinarily be handled by my browser, like Alt-F (I&#39;ve depended on that to open the &#39;File&#39; menu in every web browser since 1995 or so, and most desktop apps as well.  &lt;br /&gt;&lt;br /&gt;But someone at &lt;a href=&quot;http://www.mapquest.com&quot;&gt;AOL/Mapquest&lt;/a&gt; thought it would be clever to intercept Alt-[key] events (probably not a complete list, just what I noticed):&lt;br /&gt;&lt;br /&gt;Alt-F: redirects you to their &#39;Find It&#39; page (should open browser&#39;s &#39;File&#39; menu)&lt;br /&gt;Alt-D: redirects you to their &#39;Directions&#39; page (should put cursor focus in browser&#39;s &#39;Location&#39;/&#39;Address&#39; bar, with current location selected)&lt;br /&gt;Alt-M: redirects you to their &#39;Maps&#39; page (I&#39;m not aware of any default browser behavior for this)&lt;br /&gt;Alt-H: redirects you to their main (Home) page (should open browser&#39;s &#39;Help&#39; menu)&lt;br /&gt;&lt;br /&gt;While I applaud them for thinking about keyboard navigation, I don&#39;t like their choice of keys.&lt;br /&gt;&lt;br /&gt;Another site, &lt;a href=&quot;http://uncyclopedia.org/wiki/Main_Page&quot;&gt;Uncyclopedia&lt;/a&gt;, captures Alt-keys as well:&lt;br /&gt;&lt;br /&gt;Alt-H: move cursor focus to their &#39;history&#39; tab at the top&lt;br /&gt;Alt-F: move cursor focus to their &#39;search&#39; box in the sidebar&lt;br /&gt;Alt-E: move cursor focus to their &#39;view source&#39; tab at the top (should open browser&#39;s &#39;Edit&#39; menu)&lt;br /&gt;&lt;br /&gt;Now, there are certainly workarounds that I could use to allow me to continue controlling my browser with the keyboard:&lt;br /&gt;&lt;ol type=&#39;1&#39; style=&quot;padding-top: 2px; padding-bottom: 2px; margin-top: 2px; margin-bottom: 2px&quot;&gt;&lt;li&gt;Some browser features have multiple keyboard shortcuts; I could force myself to learn different keys.&lt;br /&gt;  &lt;li&gt;I could try to find/create a plug-in/add-on/extension for each of my browsers, to allow me to either:&lt;ol type=&#39;a&#39;&gt;&lt;li&gt;reassign my browser&#39;s keyboard shortcuts to work around these web sites(see #1 above)&lt;br /&gt;    &lt;li&gt;prevent web pages from being able to capture these keypresses, perhaps with options to toggle this feature for the current site, etc.&lt;/ol&gt;&lt;li&gt;Stop using web sites that steal my favorite keyboard shortcuts&lt;br /&gt;  &lt;li&gt;Use a different browser, such as Opera (which seems to be immune to the evil put forth by the 2 sites above)&lt;/ol&gt;&lt;br /&gt;But I just feel like I shouldn&#39;t have to do extra work because of these sites... their web developers should respect the common keyboard shortcuts used by the big players in the browser market today (IE and Firefox).</content><link rel='replies' type='application/atom+xml' href='http://spugbrap.blogspot.com/feeds/112932048146108918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8995876/112932048146108918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/112932048146108918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8995876/posts/default/112932048146108918'/><link rel='alternate' type='text/html' href='http://spugbrap.blogspot.com/2005/10/web-pages-that-capture-keypresses-are.html' title='Web pages that capture keypresses are evil!'/><author><name>spugbrap</name><uri>http://www.blogger.com/profile/16847742411835463316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.oatmealcookies.org/dave/images/dave20050820.jpg'/></author><thr:total>0</thr:total></entry></feed>