<?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: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-7506387393531842150</id><updated>2011-10-16T13:28:54.765-04:00</updated><category term='resize'/><category term='gpt'/><category term='mail'/><category term='wiki'/><category term='sysadmin'/><category term='funny'/><category term='perl'/><category term='multiple columns'/><category term='fast'/><category term='tomcat'/><category term='word'/><category term='settings'/><category term='foswiki'/><category term='KVM'/><category term='excel'/><category term='win7'/><category term='ntfsresize'/><category term='tips'/><category term='cartalk'/><category term='keyboard'/><category term='windows'/><category term='open'/><category term='pam'/><category term='silly user'/><category term='sort'/><category term='automatic updates'/><category term='apache'/><category term='linux'/><category term='debug'/><category term='dovecot'/><category term='jehovah&apos;s witness'/><category term='mysql'/><category term='cygwin'/><category term='ntfs'/><category term='slow'/><category term='scientific mode'/><category term='delusions'/><category term='jsp'/><category term='migration'/><category term='openssl'/><category term='putty'/><category term='music'/><category term='2007'/><category term='pop'/><category term='twiki'/><category term='rhel4'/><category term='unix'/><category term='mac'/><category term='ssl'/><category term='religion'/><category term='command-line'/><category term='calc'/><category term='microsoft'/><category term='drive-by'/><category term='partition'/><category term='font size'/><category term='ubuntu'/><category term='md5'/><category term='desktop heap'/><category term='itunes'/><category term='password'/><category term='puttycyg'/><category term='MBR'/><category term='calculator'/><title type='text'>Welcome to boredom...</title><subtitle type='html'>This site is really just an easy way for me to keep notes on system administration, programming, and other topics.  You'd have to be really bored to read it!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-1033101762408056862</id><published>2011-01-25T09:52:00.000-05:00</published><updated>2011-01-25T09:52:54.940-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='word'/><category scheme='http://www.blogger.com/atom/ns#' term='open'/><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><category scheme='http://www.blogger.com/atom/ns#' term='slow'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='2007'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>Word and Excel 2007 slow to open documents</title><content type='html'>One of my users had this apparently common problem -- opening either Word or Excel documents in Office 2007 was taking a long time (about 1 minute).  Opening the document from within the application was fine.&lt;br /&gt;&lt;br /&gt;This was the solution:&lt;br /&gt;http://excel2007-slow-open-file.blogspot.com/&lt;br /&gt;&lt;br /&gt;Basically, installing the "Analysis Toolpak" addin "fixed" the excel problem, but Word was still slow.  So I installed "Lookup Wizard" (in Excel) and the Word problem was also fixed.  Awesome, yes?  I LOVE MICROSOFT!!!11!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-1033101762408056862?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/1033101762408056862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2011/01/word-and-excel-2007-slow-to-open.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/1033101762408056862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/1033101762408056862'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2011/01/word-and-excel-2007-slow-to-open.html' title='Word and Excel 2007 slow to open documents'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-878054135019275705</id><published>2011-01-25T09:44:00.002-05:00</published><updated>2011-01-25T09:47:47.024-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='win7'/><category scheme='http://www.blogger.com/atom/ns#' term='automatic updates'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>Enable Microsoft Update in Windows 7 via script</title><content type='html'>By default, the Automatic Updates feature of Windows 7 does not include updates to other Microsoft Products such as Microsoft Office.&lt;br /&gt;&lt;br /&gt;In the Windows Update control panel, you can enable Microsoft Update, but I needed to automate this for all of my systems.&lt;br /&gt;&lt;br /&gt;It turns out that you can enable Microsoft Update &lt;a href="http://blogs.technet.com/b/danbuche/archive/2010/01/07/enabling-and-disabling-microsoft-update-in-windows-7-via-script.aspx"&gt;using a simple VBS&lt;/a&gt;.  You can run this script via any means you like (psexec, GPO startup/login script, etc.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-878054135019275705?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/878054135019275705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2011/01/enable-microsoft-update-in-windows-7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/878054135019275705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/878054135019275705'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2011/01/enable-microsoft-update-in-windows-7.html' title='Enable Microsoft Update in Windows 7 via script'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-6558951732446840123</id><published>2010-10-25T10:24:00.001-04:00</published><updated>2011-01-25T09:48:15.364-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='desktop heap'/><category scheme='http://www.blogger.com/atom/ns#' term='debug'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>Increase the maxiumum number of windows in Windows!</title><content type='html'>I tend to keep a lot of windows open on my main desktop (Windows XP).  Right now I have 21 windows -- that's a low number for me actually, because I had to reboot recently after a software install.&lt;br /&gt;&lt;br /&gt;As time goes by, I accumulate more and more windows.  Eventually, when I try to open a new window, I find that either 1) nothing happens or 2) the window opens, but it's missing vital elements (menu bar, icons, etc.).&lt;br /&gt;&lt;br /&gt;It turns out that this is due to Windows running out of space in the "desktop heap" (If I understand correctly!  See &lt;a href="http://blogs.msdn.com/b/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx"&gt;this MSDN article&lt;/a&gt;).  The default size of the heap is 3072 KB in XP (the default is larger in Vista and Windows 7).  Obviously this is not enough for me, so I edited the registry as described in the MSDN article (here's &lt;a href="http://www.mycsharpcorner.com/Post.aspx?postID=50"&gt;another article with more explicit instructions&lt;/a&gt;).  I changed 3072 to 8096.  (note: you must reboot for changes in the heap size to take effect; logging out and back in is not sufficient)&lt;br /&gt;&lt;br /&gt;Now I can open more windows without any of the interface issues I was seeing before.  At least, I haven't run into any issues again since I made the registry edit.&lt;br /&gt;&lt;br /&gt;For the intensely curious, you can see the current size of your desktop heap using a debugging tool from Microsoft called "&lt;a href="http://www.microsoft.com/downloads/en/confirmation.aspx?familyid=5CFC9B74-97AA-4510-B4B9-B2DC98C8ED8B&amp;displaylang=en"&gt;Desktop Heap Monitor&lt;/a&gt;"&lt;br /&gt;&lt;br /&gt;After you unzip the download, you have to install it manually from the CMD prompt: &lt;pre&gt;C:\dheapmon8.1\x86&gt;dheapinst.exe -y %SYSTEMROOT%\Symbols&lt;br /&gt;  dheapinst - Desktop Heap Monitor installed successfully&lt;/pre&gt;&lt;br /&gt;(The installer seems to copy the necessary files to %SYSTEM32%\kktools)&lt;br /&gt;&lt;br /&gt;Then, load the heap driver with "dheapmon -l"&lt;br /&gt;&lt;br /&gt;Now you can see your heap:  &lt;pre&gt;C:\WINDOWS\system32\kktools&gt;dheapmon&lt;br /&gt;Desktop Heap Information Monitor Tool (Version 8.1.2925.0)&lt;br /&gt;Copyright (c) Microsoft Corporation.  All rights reserved.&lt;br /&gt;-------------------------------------------------------------&lt;br /&gt;  Session ID:    0 Total Desktop: ( 10848 KB -    8 desktops)&lt;br /&gt;&lt;br /&gt;  WinStation\Desktop            Heap Size(KB)    Used Rate(%)&lt;br /&gt;-------------------------------------------------------------&lt;br /&gt;  WinSta0\Default                    8096             29.1&lt;br /&gt;  WinSta0\Disconnect                   64              4.5&lt;br /&gt;  WinSta0\Winlogon                    128             17.8&lt;br /&gt;  Service-0x0-3e7$\Default            512             29.6&lt;br /&gt;  Service-0x0-3e4$\Default            512              6.3&lt;br /&gt;  Service-0x0-3e5$\Default            512             10.8&lt;br /&gt;  SAWinSta\SADesktop                  512              0.5&lt;br /&gt;  Service-0x0-2a22a$\Default          512              2.5&lt;br /&gt;-------------------------------------------------------------&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-6558951732446840123?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/6558951732446840123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2010/10/increase-maxiumum-number-of-windows-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/6558951732446840123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/6558951732446840123'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2010/10/increase-maxiumum-number-of-windows-in.html' title='Increase the maxiumum number of windows in Windows!'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-4520443338567637781</id><published>2010-09-21T09:03:00.001-04:00</published><updated>2011-01-25T09:48:38.172-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rhel4'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='dovecot'/><category scheme='http://www.blogger.com/atom/ns#' term='pam'/><title type='text'>using pam_tally2 with dovecot</title><content type='html'>I recently configured some RHEL4 systems to use pam_tally2 to lock an account temporarily after several unsuccessful logins.  This seems to work fine just by adding it to the "auth" section: &lt;pre&gt;auth        required      /lib/security/$ISA/pam_tally2.so deny=5 unlock_time=900&lt;/pre&gt;However, I later found that if you're running dovecot (version 0.99.11-9 -- maybe it's been fixed since then), it doesn't reset the tally on a successful login; i.e. it does not call pam_setcred.  So, if the user is only logging in via dovecot, and they are checking mail at an interval less than your reset time, eventually the account will get locked out!&lt;br /&gt;&lt;br /&gt;To fix this, you have to call pam_tally2 in the "account" section to reset the tally.  You can do this in either the "system-auth" file, or in the "dovecot" file: &lt;pre&gt;account    required     /lib/security/$ISA/pam_tally2.so&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-4520443338567637781?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/4520443338567637781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2010/09/using-pamtally2-with-dovecot.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/4520443338567637781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/4520443338567637781'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2010/09/using-pamtally2-with-dovecot.html' title='using pam_tally2 with dovecot'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-112453453005434721</id><published>2010-06-28T14:46:00.001-04:00</published><updated>2011-01-25T09:49:47.594-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pop'/><category scheme='http://www.blogger.com/atom/ns#' term='ssl'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='openssl'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='mail'/><title type='text'>openssl s_client with POP3 connections</title><content type='html'>Troubleshooting an email checking issue, I decided to connect to the mail server from the command line and try it manually to see what was going on.  I connected with openssl's s_client, and tried to read one of the messages:&lt;br /&gt;&lt;pre&gt;openssl s_client -connect mailserver.domain.com:995&lt;br /&gt;...&lt;br /&gt;+OK DBMAIL pop3 server ready to rock&lt;br /&gt;USER username&lt;br /&gt;+OK Password required for username&lt;br /&gt;PASS password&lt;br /&gt;+OK username has 45 messages (103973 octets)&lt;br /&gt;RETR 1&lt;br /&gt;RENEGOTIATING&lt;br /&gt;...&lt;/pre&gt;A quick search revealed that any command starting with "R" will result in renegotiation.  To prevent it, simply add the -ign_eof switch:&lt;br /&gt;&lt;pre&gt;openssl s_client -connect mailserver.domain.com:995 -ign_eof&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-112453453005434721?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/112453453005434721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2010/06/openssl-sclient-with-pop3-connections.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/112453453005434721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/112453453005434721'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2010/06/openssl-sclient-with-pop3-connections.html' title='openssl s_client with POP3 connections'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-1745707968815433652</id><published>2010-03-08T19:21:00.018-05:00</published><updated>2011-01-25T09:50:33.209-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='password'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='jsp'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='md5'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><category scheme='http://www.blogger.com/atom/ns#' term='tomcat'/><title type='text'>Apache Tomcat - changing password stored in a MySQL database</title><content type='html'>&lt;div align="justify"&gt;&lt;br /&gt;One of the websites at work runs an Apache Tomcat server for a data trending application.  I have been using a &lt;a href="http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#DataSourceRealm"&gt;DataSourceRealm&lt;/a&gt; for authentication, with a MySQL database setup as Tomcat requires it; i.e. a "users" table with two columns -- username and password, where the stored password is an MD5 digest/hash of the user's password.&lt;br /&gt;&lt;br /&gt;The docs for setting authentication up weren't great, but that's another story...  In any case, the docs don't provide any way for you to &lt;span style="font-style: italic;"&gt;change&lt;/span&gt; the stored password for a user.  Up until recently, I've had to change the passwords by "manually" updating the database.&lt;br /&gt;&lt;br /&gt;I just spent the better part of two days figuring out how to allow the users to change their own passwords, through a webpage served by Tomcat.  This basically consisted of a few pieces I had to string together:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Configuring MySQL&lt;/li&gt;&lt;li&gt;Accessing MySQL via JSP&lt;/li&gt;&lt;li&gt;Generating MD5 hashes in JSP&lt;/li&gt;&lt;li&gt;Configuring the Tomcat application&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;u&gt;Configuring MySQL&lt;/u&gt;&lt;br /&gt;For security reasons, we don't want everyone in the world being able to read the whole user database, nor do we want them writing to entries that don't belong to them.  I already had a read-only user setup for Tomcat so that it could do authentication.  Granting additional privileges to that user would be a mistake -- what we want here is that the authentication process is read-only.  Only after a user is authenticated to we want them to be able to write to the database.&lt;br /&gt;&lt;br /&gt;Therefore, I created a separate MySQL user, with SELECT and UPDATE privileges.  Tomcat of course must be configured appropriately, using a separate JDBC resource (see the "Accessing MySQL via JSP" section).&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Accessing MySQL via JSP&lt;/u&gt;&lt;br /&gt;There are a ton of web pages showing you how to embed Java code that accesses MySQL in your JSP.  But it is actually a lot more simple if you use the &lt;a href="http://java.sun.com/products/jsp/jstl/"&gt;JSTL tag library&lt;/a&gt; -- specifically, the &lt;a href="http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSTL7.html"&gt;sql tag&lt;/a&gt;.  Basically, you do two things:  1)  Configure the JDBC Resource in the "context.xml" file for your Tomcat application (alternatively, create a new XML file in conf/Catalina/localhost/) , and 2) use "sql" tags to query or update the database.&lt;br /&gt;&lt;br /&gt;This is actually demonstrated nicely on the &lt;a href="http://wiki.apache.org/tomcat/UsingDataSources"&gt;Tomcat Wiki for using DataSources&lt;/a&gt;, specifically, in the &lt;a href="http://wiki.apache.org/tomcat/UsingDataSources?action=AttachFile&amp;amp;do=view&amp;amp;target=datasourcedemo.war"&gt;war file attached to that topic&lt;/a&gt;.  Of great importance are two files included in the datasourcedemo.war -- jslt.jar and standard.jar.  Supposedly you can get these directly from Sun, but I wasn't able to find them on Sun's web site.  If you know where to get them, please comment!&lt;br /&gt;&lt;br /&gt;Of course, getting a demo of MySQL access working is a &lt;a href="http://www.farcry2.com/"&gt;far cry&lt;/a&gt; from having an application that changes a password.  First, the simple stuff -- an HTML form to allow the user to input the old and new password (plus a confirm field for the password).  There's no SQL code in this first page.&lt;br /&gt;&lt;br /&gt;Note that I'm not asking the user for their username -- I'm using request.getRemoteUser() to get user's login name from the server. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://sites.google.com/site/teridon/password.jsp.txt"&gt;Download password.jsp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And below, the code which the above page calls when submitting the form.  This is the code for actually changing the user's password.  Note again that I'm using request.getRemoteUser() for the user's login name.  We should NOT trust the user's form submission to tell us the correct username.  So, even if some malicious person submits their own form data for the username, the server will ignore it (I think...).  Along similar lines, note the use of parametrized SQL queries, to prevent SQL injection attacks. &lt;br /&gt;&lt;br /&gt;Also note the code at the top for including the JSTL tag library, and for importing the java security and io libraries.&lt;br /&gt;&lt;br /&gt;The code for generating the MD5 hash I got from &lt;a href="http://snook.ca/archives/java/create_md5_hash"&gt;this page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The code first uses an SQL query to get the row matching the user and hashed password.  If the query returns a row, the c:forEach structure (from the JSTL core) executes the sql:update code to change the password.&lt;br /&gt;&lt;br /&gt;I use a counter variable to decide whether to display a success or error message.  The counter only increments if it enters the forEach loop -- which it only does if the SQL query is successful (i.e. the user entered the right old password).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sites.google.com/site/teridon/change_password.jsp.txt"&gt;Download change_password.jsp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Configuring the Tomcat application&lt;/u&gt;&lt;br /&gt;I basically took the datasourcedemo.war and added my two JSP pages, then deployed the application on my Tomcat server to /changepass.  I had to add security stuff to the WEB-INF/web.xml file, so that the changepass application was protected via the authentication already defined on my site.  Of course, I had to edit META-INF/context.xml so that the MySQL resource was defined correctly for my system.&lt;br /&gt;&lt;br /&gt;I think the most interesting/frustrating thing here was that I originally had the url-pattern in the security-constraint section wrong.  Instead of just putting "/*", I had the name of the application -- "/changepass/*".  This turned out to be a Bad Thing!  Not only did it fail to protect the application -- it also somehow prevented the SQL code from working!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sites.google.com/site/teridon/web.xml"&gt;Download web.xml&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;All in all, two full days of work for me.  Most of that was figuring out JSP syntax (which I had never done), and braving the horrible tangled mess that is Tomcat.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-1745707968815433652?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/1745707968815433652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2010/03/apache-tomcat-changing-password-stored.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/1745707968815433652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/1745707968815433652'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2010/03/apache-tomcat-changing-password-stored.html' title='Apache Tomcat - changing password stored in a MySQL database'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-8485932852528596796</id><published>2010-03-03T11:46:00.008-05:00</published><updated>2011-01-25T09:51:57.788-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='command-line'/><category scheme='http://www.blogger.com/atom/ns#' term='multiple columns'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='sort'/><title type='text'>UNIX sort by multiple columns</title><content type='html'>Sometimes the "obvious" stuff isn't so obvious (at least to me...)&lt;br /&gt;&lt;br /&gt;I had a text file with multiple columns of numbers.  I wanted to sort it by the first column, then the second, then the third.  It wasn't immediately obvious to me how to do it.  The man page for 'sort' of course does not mention that you can specify the '-k' option multiple times, and I didn't have the GNU 'info' utility installed:&lt;pre&gt;sort -k1n -k2n -k3n file&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-8485932852528596796?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/8485932852528596796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2010/03/unix-sort-by-multiple-columns.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/8485932852528596796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/8485932852528596796'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2010/03/unix-sort-by-multiple-columns.html' title='UNIX sort by multiple columns'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-7006619659862187638</id><published>2010-01-11T11:09:00.004-05:00</published><updated>2011-01-25T09:52:26.493-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='migration'/><category scheme='http://www.blogger.com/atom/ns#' term='settings'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='fast'/><title type='text'>Windows File and Settings Transfer (FAST) Wizard</title><content type='html'>So, despite being a system administrator for Windows systems for many years, I had never used the Windows File and Settings Transfer (FAST) Wizard to transfer files from one computer to another.  I've always done it manually.  Manual transfer takes more time and thought, but I believed it to be less error-prone.&lt;br /&gt;&lt;br /&gt;My first experience with it has both good and bad points.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The Good&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I didn't have to babysit the thing&lt;/li&gt;&lt;li&gt;You can use a folder on an external hard drive instead of a painfully slow serial cable&lt;/li&gt;&lt;li&gt;The wizard compresses the data&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The Bad&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The total amount of time was probably the same.  Perhaps because the user had 70 GB of data&lt;/li&gt;&lt;li&gt;All that compression takes time.  I'd prefer a performance-increasing option to copy the data without compression.  I had plenty of space on the HD.&lt;/li&gt;&lt;li&gt;There's no option to turn off copying of applications.  I didn't want to clutter up the new system with applications the user didn't actually need anymore.  The user was in the Administrators group on the old system, but not on the new one.  So, the wizard failed on copying a bunch of items to Program Files.&lt;/ul&gt;&lt;span style="font-weight:bold;"&gt;The Ugly&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Instead of just restoring the data from the folder I specified, it copied &lt;span style="font-weight:bold;"&gt;everything &lt;/span&gt;from the external hard drive onto the target system!  I &lt;span style="font-style:italic;"&gt;know &lt;/span&gt;I selected the folder containing the old system's image.  So it ended up copying about 300 GB of data that had nothing to do with the user's original system (software installers, backups from other systems, etc.)&lt;/li&gt;&lt;/ul&gt;I'll probably use it again next time.  Or perhaps I'll try the much more complicated &lt;a href="http://technet.microsoft.com/en-us/library/cc722032%28WS.10%29.aspx"&gt;User State Migration tool (USMT&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-7006619659862187638?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/7006619659862187638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2010/01/windows-file-and-settings-transfer-fast.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/7006619659862187638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/7006619659862187638'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2010/01/windows-file-and-settings-transfer-fast.html' title='Windows File and Settings Transfer (FAST) Wizard'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-2092417680471671523</id><published>2010-01-08T14:35:00.001-05:00</published><updated>2011-01-25T09:53:20.920-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='word'/><category scheme='http://www.blogger.com/atom/ns#' term='open'/><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><category scheme='http://www.blogger.com/atom/ns#' term='slow'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='2007'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>Word and Excel 2007 slow to open documents</title><content type='html'>One of my users had this apparently common problem -- opening either Word or Excel documents in Office 2007 was taking a long time (about 1 minute).  Opening the document from within the application was fine.&lt;br /&gt;&lt;br /&gt;This was the solution:&lt;br /&gt;http://excel2007-slow-open-file.blogspot.com/&lt;br /&gt;&lt;br /&gt;Basically, installing the "Analysis Toolpak" addin "fixed" the excel problem, but Word was still slow.  So I installed "Lookup Wizard" (in Excel) and the Word problem was also fixed.  Awesome, yes?  I LOVE MICROSOFT!!!11!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-2092417680471671523?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/2092417680471671523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2010/01/word-and-excel-2007-slow-to-open.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/2092417680471671523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/2092417680471671523'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2010/01/word-and-excel-2007-slow-to-open.html' title='Word and Excel 2007 slow to open documents'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-3831146086794329428</id><published>2010-01-05T07:59:00.003-05:00</published><updated>2011-01-25T09:53:41.664-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><category scheme='http://www.blogger.com/atom/ns#' term='puttycyg'/><category scheme='http://www.blogger.com/atom/ns#' term='putty'/><title type='text'>Replace Cygwin command prompt with Puttycyg</title><content type='html'>I install Cygwin on every Windows machine that I have to use regularly.  By default, Cygwin uses the Windows Command Prompt for its terminal.  Gross!&lt;br /&gt;&lt;br /&gt;I much prefer putty -- to the point that I would open putty and SSH to localhost, just so that I can use a &lt;span style="font-style:italic;"&gt;real &lt;/span&gt;terminal!&lt;br /&gt;&lt;br /&gt;With &lt;a href="http://code.google.com/p/puttycyg/"&gt;puttycyg&lt;/a&gt;, there's no need to SSH in.  Donwload puttycyg and extract the ZIP.  Then copy the two executables (putty.exe and cthelper.exe) into C:\cygwin (or wherever you have it installed).&lt;br /&gt;&lt;br /&gt;Then, modify your cygwin.bat shortcut to run this target instead:&lt;pre&gt;C:\cygwin\putty.exe -cygterm -&lt;/pre&gt;&lt;br /&gt;(yes that is a dash at the end!)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-3831146086794329428?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/3831146086794329428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2010/01/replace-cygwin-command-prompt-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/3831146086794329428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/3831146086794329428'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2010/01/replace-cygwin-command-prompt-with.html' title='Replace Cygwin command prompt with Puttycyg'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-2846760470008298261</id><published>2009-11-28T20:13:00.005-05:00</published><updated>2011-08-22T00:18:51.553-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='itunes'/><category scheme='http://www.blogger.com/atom/ns#' term='font size'/><title type='text'>Edit iTunes font sizes in Mac OS X</title><content type='html'>People seem to like my &lt;a href="http://mysite.verizon.net/teridon/ituneshacks/"&gt;iTunes font size editor for Windows&lt;/a&gt;.  A few people have asked for the same capability on a Mac.&lt;br /&gt;&lt;br /&gt;Well, I don't have a fancy GUI for it, but I do have a &lt;a href="http://www.pobox.com/~teridon/ituneshacks/itunes_font_size.pl.txt"&gt;command-line perl script&lt;/a&gt;.  The script works for iTunes 10.x (tested up to 10.4).&lt;br /&gt;&lt;br /&gt;There are &lt;a href="http://discussions.apple.com/message.jspa?messageID=10539754#10539754"&gt;instructions here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-2846760470008298261?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/2846760470008298261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2009/11/edit-itunes-font-sizes-in-mac-os-x.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/2846760470008298261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/2846760470008298261'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2009/11/edit-itunes-font-sizes-in-mac-os-x.html' title='Edit iTunes font sizes in Mac OS X'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-8844645471931440792</id><published>2009-10-29T17:27:00.003-04:00</published><updated>2011-01-25T09:54:20.954-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='music'/><category scheme='http://www.blogger.com/atom/ns#' term='funny'/><category scheme='http://www.blogger.com/atom/ns#' term='cartalk'/><title type='text'>Hilarious song</title><content type='html'>I was listening the weekly "&lt;a href="http://www.cartalk.com/"&gt;Car Talk&lt;/a&gt;" podcast.  They take several "breaks" in the show, during which they play car-related songs.  To be completely honest, I always always skip them because the music is typically horrible.  However, on this occasion I instantly recognized the notes of Beethoven's "Moonlight Sonata".  In addition to the expected piano were hilarious lyrics about a driver being stopped at a red light.  The melody of the song turns into drivers "beeps" of their horns.&lt;br /&gt;&lt;br /&gt;It turns out the song is by a group called "&lt;a href="http://www.beethovenswig.com/index.php?page=bio"&gt;Beethoven's Wig&lt;/a&gt;" that turns Classical songs into sing-a-longs (basically for children).  You can preview and/or &lt;a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=285108922&amp;amp;id=285108835&amp;amp;s=143441"&gt;buy the song on iTunes&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-8844645471931440792?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/8844645471931440792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2009/10/hilarious-song.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/8844645471931440792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/8844645471931440792'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2009/10/hilarious-song.html' title='Hilarious song'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-8335342434775082464</id><published>2009-09-28T15:02:00.003-04:00</published><updated>2011-01-25T09:54:33.411-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silly user'/><category scheme='http://www.blogger.com/atom/ns#' term='keyboard'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><title type='text'>The constantly-opening Help window...</title><content type='html'>One of my users came into my office today, complaining that the Microsoft Office "Help" window kept coming up.  Every time she closed it, it would open right up again.&lt;br /&gt;&lt;br /&gt;So I go in there, and sure enough, when I close the Help window, it comes right back up!  But then I look down at the keyboard... it's on a sliding keyboard tray that can go under the desk.  And that's exactly where it is now -- partly under the desk, with the F1 key jammed under there and held down.&lt;br /&gt;&lt;br /&gt;After laughing my head off, I pointed out the problem, lowered the keyboard tray a quarter-inch, and told the user to be more careful!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-8335342434775082464?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/8335342434775082464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2009/09/constantly-opening-help-window.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/8335342434775082464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/8335342434775082464'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2009/09/constantly-opening-help-window.html' title='The constantly-opening Help window...'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-9207475411578333987</id><published>2009-09-22T18:58:00.004-04:00</published><updated>2011-01-25T09:55:15.622-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='ntfs'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ntfsresize'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='resize'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Resizing an NTFS partition with free tools</title><content type='html'>The guy that set up some of the Windows XP systems at work partitioned the drives to theoretically separate the OS (C:) from the data (D:).  However, he didn't complete the process; i.e. he didn't move the default "Documents and Settings" folder, nor the "Program Files" folder to the "data" disk.&lt;br /&gt;&lt;br /&gt;So, of course the "OS" partition eventually filled up with user data.  A few months ago I moved the main user's Documents and Settings folder to the data drive, and used a junction point in the original location to point to it.  That only staved off the disk filling up for a while -- this week I finally got around to deploying Office 2007, and the system didn't have enough space to install it.&lt;br /&gt;&lt;br /&gt;I wanted to delete the "data" partition and consolidate everything into one partition.  The old version of Partition Magic we had wouldn't boot the system for some reason, so I needed to find another tool to do it.&lt;br /&gt;&lt;br /&gt;The answer: a Ubuntu 9.04 Desktop CD.  The process is pretty simple.  In summary, backup the data, delete all the NTFS partitions, recreate a single NTFS partition in the same cylinder space, then use &lt;span style=";font-family:courier new;font-size:85%;"  &gt;ntfsresize&lt;/span&gt; to fix the NTFS partition.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;     Boot the system from the Ubuntu CD. At the boot menu, select "Try Ubuntu".&lt;/li&gt;&lt;li&gt; Open a terminal (Applications, Accessories, Terminal) and sudo to root with &lt;pre&gt;sudo -s&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Figure out which disk is the one you want. Likely candidates are &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;/dev/hda&lt;/span&gt;&lt;/span&gt; (IDE) or &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;/dev/sda&lt;/span&gt;&lt;/span&gt; (SATA). If you're not sure, use &lt;pre&gt;dmesg | less&lt;/pre&gt;to find the disk device.&lt;/li&gt;&lt;li&gt;Start &lt;span style=";font-family:courier new;font-size:85%;"  &gt;fdisk&lt;/span&gt; on the device (e.g. &lt;span style=";font-family:courier new;font-size:85%;"  &gt;fdisk /dev/sda&lt;/span&gt;), and print the existing partition table. Note the cylinder numbers for where the current NTFS partitions start and end (especially the start of the first NTFS partition, and the end of the last NTFS partition).&lt;/li&gt;&lt;li&gt;Delete all of the existing NTFS partitions. Then create a single new partition, starting at the same cylinder as the first partition, but ending at the cylinder number for the last NTFS partition.&lt;/li&gt;&lt;li&gt;Mark the NTFS partition as bootable!  Exit&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt; fdisk&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Resize the partition to its maximum size using &lt;span style=";font-family:courier new;font-size:85%;"  &gt;ntfsresize&lt;/span&gt;. Read the &lt;span style=";font-family:courier new;font-size:85%;"  &gt;ntfsresize&lt;/span&gt; man page to learn how. You may also refer to this page on shrinking an NTFS volume (starting at step 8). For example, if the device size is 32079 MB, you may try &lt;pre&gt;ntfsresize -n -s 32079M /dev/sda &lt;/pre&gt;If you don't get any errors, proceed by removing the -n option. If you get an error that the partition size cannot exceed the device size, reduce the size by 1MB (e.g. 32078M).&lt;/li&gt;&lt;li&gt;Reboot the system with&lt;span style=";font-family:courier new;font-size:85%;"  &gt; reboot&lt;/span&gt;. Windows will run chkdsk, reboot, and then everything should work as before.&lt;/li&gt;&lt;li&gt;Restore the data from the lost partition (D:). &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-9207475411578333987?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/9207475411578333987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2009/09/resizing-ntfs-partition-with-free-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/9207475411578333987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/9207475411578333987'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2009/09/resizing-ntfs-partition-with-free-tools.html' title='Resizing an NTFS partition with free tools'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-3007339222461946094</id><published>2009-07-31T15:45:00.006-04:00</published><updated>2011-01-25T09:55:49.759-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='command-line'/><category scheme='http://www.blogger.com/atom/ns#' term='wiki'/><category scheme='http://www.blogger.com/atom/ns#' term='twiki'/><category scheme='http://www.blogger.com/atom/ns#' term='foswiki'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><title type='text'>command-line edit foswiki topics</title><content type='html'>We use foswiki at SDO for our "Local Operating Procedures" (LOPs).  These many consist of numbered steps, with some metadata attached.&lt;br /&gt;&lt;br /&gt;I recently was tasked to add a document number to the metadata.  Easy, except with hundreds of documents, I didn't want to do this manually.&lt;br /&gt;&lt;br /&gt;Each Wiki topic is a text document.  The text document also stores the metadata (like the document number).  Of course, since it's text it is easy to edit and script the edit with perl. &lt;br /&gt;&lt;br /&gt;However, each topic text file also has an associated RCS file for versioning information.  If you just edit the text file, the web page itself looks fine, but you can't see the change you made in the page's history (unless you make another change using the web interface).&lt;br /&gt;&lt;br /&gt;But it turns out to be very easy to record your direct text file edits in RCS.  Simply do &lt;pre&gt;rcs -l TextFileName.txt&lt;br /&gt;ci -mnone -t-none -wusername -u TextFileName.txt&lt;/pre&gt;&lt;br /&gt;That's it!  Now the edits you made from your terminal are visible in the topic's history.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-3007339222461946094?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/3007339222461946094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2009/07/command-line-edit-foswiki-topics.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/3007339222461946094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/3007339222461946094'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2009/07/command-line-edit-foswiki-topics.html' title='command-line edit foswiki topics'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-3000522382587844790</id><published>2009-07-26T21:11:00.005-04:00</published><updated>2011-01-25T09:56:17.782-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jehovah&apos;s witness'/><category scheme='http://www.blogger.com/atom/ns#' term='delusions'/><category scheme='http://www.blogger.com/atom/ns#' term='religion'/><category scheme='http://www.blogger.com/atom/ns#' term='drive-by'/><title type='text'>WTF: drive-by Jehovah's witnesses?</title><content type='html'>On my way to work, I stopped to get gas.  As I get out, a car pulls up on the other side of the pump, and I see an smiling old lady.  She says "hi" or some other greeting and I replied with some meaningless friendly greeting ("morning", perhaps).  I then proceeded to start pumping gas.  &lt;br /&gt;&lt;br /&gt;As I take my hand off the handle, to turn lean on the car to wait for it to finish, the old lady is RIGHT THERE next to me, trying to hand me a brochure of some kind.  I looked down at it, and it reads "blah blah Jehovah blah blah" (I don't remember what the other words were).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;WTF&lt;/span&gt;?  Since when to Jehovah's witnesses do fucking &lt;span style="font-style:italic;"&gt;drive-bys&lt;/span&gt;?&lt;br /&gt;&lt;br /&gt;I was instantly angry.  It's bad enough knowing these delusional people &lt;span style="font-style:italic;"&gt;exist&lt;/span&gt;, let alone having them come by your home, and now apparently in public as you try to go about your day, to try to spread their bullshit!&lt;br /&gt;&lt;br /&gt;"God does not exist", I said.  "Now get away from me!"   I glared at her, practically daring her to say anything else to me.&lt;br /&gt;&lt;br /&gt;She wasn't a very good Witness, I guess, because she got away.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-3000522382587844790?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/3000522382587844790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2009/07/wtf-drive-by-jehovahs-witnesses.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/3000522382587844790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/3000522382587844790'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2009/07/wtf-drive-by-jehovahs-witnesses.html' title='WTF: drive-by Jehovah&apos;s witnesses?'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-2376043225036049867</id><published>2009-07-16T13:38:00.004-04:00</published><updated>2011-01-25T09:54:51.186-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rhel4'/><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='gpt'/><title type='text'>Setting up a Linux system with a 3.5TB disk</title><content type='html'>As mentioned in my last post, I have this remote linux system with 3.5TB of disk, but broken into two LVMs.  I want most of the storage to be in one big disk.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Today I had my remote monkey put the RHEL4 WS DVD in the machine and rebooted it.  I entered the RAID BIOS (Dell PERC 5/i) to delete the existing virtual disks.  I then created two new virtual disks -- one of 250GB for the OS, and one of the remaining 3.4TB for the data.&lt;br /&gt;&lt;br /&gt;I booted from the RHEL DVD and entered "rescue" mode, because anaconda does not support making GPT disks.  Then I entered &lt;pre&gt;parted /dev/sdb&lt;br /&gt;mklabel gpt&lt;br /&gt;mkpart primary 0 3571900M&lt;br /&gt;quit&lt;/pre&gt;Then: &lt;pre&gt;mkfs.ext3 /dev/sdb1&lt;/pre&gt;Making the EXT3 FS took about 22 minutes.&lt;br /&gt;&lt;br /&gt;That's mostly it!  I rebooted and ran anaconda this time, setting up LVM on /dev/sda (except /boot, of course).  I left /dev/sdb alone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-2376043225036049867?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/2376043225036049867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2009/07/setting-up-linux-system-with-35tb-disk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/2376043225036049867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/2376043225036049867'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2009/07/setting-up-linux-system-with-35tb-disk.html' title='Setting up a Linux system with a 3.5TB disk'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-9166544178917821522</id><published>2009-07-15T20:21:00.005-04:00</published><updated>2011-01-25T09:56:48.795-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KVM'/><category scheme='http://www.blogger.com/atom/ns#' term='MBR'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='gpt'/><title type='text'>Want to convert partition table from MBR to GPT</title><content type='html'>One of the Linux (RHEL4) systems at work has about 3.5 TB of disk in a RAID configuration.  Unfortunately, the guy who setup the system (not me) had apparently never heard of GPT before.  So, he partitioned the RAID into two portions -- one of 2 TB, and the other 1.5 TB.  Each of those partitions is managed by LVM.&lt;br /&gt;&lt;br /&gt;Despite hours of searching, I am unable to figure out a way to convert these to one big 3.5 TB partition.  The operating system is mostly installed on LVM-managed parts of the disk, so I can't destroy the partitions and redo them without reinstalling the OS.&lt;br /&gt;&lt;br /&gt;The best part is that the system is 2,000 miles away.  Fortunately, we recently installed a digital KVM switch to the system.  We also have someone there that can manage to insert the installation CD.  With the KVM I can reconfigure the RAID and reinstall the OS remotely.&lt;br /&gt;&lt;br /&gt;By the way, if you are thinking of getting an Avocent KVM switch, and you want to use LDAP authentication -- well, you better have Active Directory, because Avocent's crappy software does not allow you to configure the LDAP authentication query.  In addition, their tech support seems to be both clueless and illiterate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-9166544178917821522?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/9166544178917821522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2009/07/want-to-convert-partition-table-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/9166544178917821522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/9166544178917821522'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2009/07/want-to-convert-partition-table-from.html' title='Want to convert partition table from MBR to GPT'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7506387393531842150.post-5826109072791222760</id><published>2009-07-10T13:24:00.001-04:00</published><updated>2011-01-25T09:57:11.650-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='scientific mode'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='calculator'/><category scheme='http://www.blogger.com/atom/ns#' term='calc'/><title type='text'>Make the Windows XP Calculator always start in scientific mode</title><content type='html'>&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;I got very tired of having to select "View..Scientific" every time I started the calculator (calc.exe).&lt;br /&gt;&lt;br /&gt;It turns out that if you are a non-administrative user (you're not doing daily work as an &lt;span style="font-style: italic;"&gt;admin&lt;/span&gt;, are you?), then it doesn't save the last-used state.&lt;br /&gt;&lt;br /&gt;To make the calculator start in scientific mode every time, edit &lt;span style="font-family: courier new;"&gt;C:\WINDOWS\win.ini&lt;/span&gt;, and add this:&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;pre&gt;[SciCalc]&lt;br /&gt;layout=0&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you're using Vista, you can &lt;a href="http://blogs.technet.com/askds/archive/2007/08/14/deploying-custom-registry-changes-through-group-policy.aspx"&gt;set it in the registry&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7506387393531842150-5826109072791222760?l=teridon73.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://teridon73.blogspot.com/feeds/5826109072791222760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://teridon73.blogspot.com/2009/07/make-windows-xp-calculator-always-start.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/5826109072791222760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7506387393531842150/posts/default/5826109072791222760'/><link rel='alternate' type='text/html' href='http://teridon73.blogspot.com/2009/07/make-windows-xp-calculator-always-start.html' title='Make the Windows XP Calculator always start in scientific mode'/><author><name>Teridon</name><uri>http://www.blogger.com/profile/06176325422964263101</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry></feed>
