<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>overclockedtech.com</title>
	<atom:link href="http://overclockedtech.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://overclockedtech.com</link>
	<description>A blog for sysadmins and tech enthusiasts</description>
	<lastBuildDate>Mon, 29 Mar 2010 16:29:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Change the color and format of the Bash prompt</title>
		<link>http://overclockedtech.com/?p=385</link>
		<comments>http://overclockedtech.com/?p=385#comments</comments>
		<pubDate>Sun, 31 Jan 2010 04:57:23 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[change color]]></category>
		<category><![CDATA[change color of bash prompt]]></category>
		<category><![CDATA[export PS1]]></category>
		<category><![CDATA[PS1]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=385</guid>
		<description><![CDATA[Recently I got bored with the standard prompts and colors of the Bash shell in Linux, and decided to tweak them a bit.  What I decided to do was to make the root user account have a red prompt, mainly so I wouldn&#8217;t forget to log out once I was done and also to distinguish [...]


Related posts:<ol><li><a href='http://overclockedtech.com/?p=287' rel='bookmark' title='Permanent Link: How to prevent yourself from accidentally deleting files in Unix/Linux'>How to prevent yourself from accidentally deleting files in Unix/Linux</a> <small>Everyone at some point has faced that horrible moment when...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Recently I got bored with the standard prompts and colors of the Bash shell in Linux, and decided to tweak them a bit.  What I decided to do was to make the root user account have a red prompt, mainly so I wouldn&#8217;t forget to log out once I was done and also to distinguish it from normal user accounts.</p>
<p><span style="text-decoration: underline;"><strong>Editing the Bash Prompt</strong></span></p>
<p>In order to change the color of the bash prompt, you need to edit the PS1 environment variable.  You can do this by typing the following in the bash shell:</p>
<p><span style="color: #0000ff;"><em><code>export PS1="\e[31;1m[\u@\h \@ \W]# \e[0m"</code></em></span></p>
<p><span style="color: #0000ff;"><em><a href="http://overclockedtech.com/wp-content/uploads/2010/01/changing-the-bash-prompt-color1.jpg"><img class="size-full wp-image-396 alignnone" title="changing the bash prompt color" src="http://overclockedtech.com/wp-content/uploads/2010/01/changing-the-bash-prompt-color1.jpg" alt="" width="600" height="114" /></a><br />
</em></span></p>
<p>This will temporarily change the color of the bash prompt to red, and some other parts of the prompt as well.</p>
<p><span style="text-decoration: underline;">Here is a basic breakdown of each part of the command:</span></p>
<p>The <span style="color: #ff0000;"><code>export  PS1=</code></span> is telling the shell that you are changing the PS1 variable</p>
<p><code>The </code><code><span style="color: #ff0000;">\e[31;1m</span> </code>controls what foreground and background the prompt will have. <code> </code>31 = Red foreground, 1 = black background.</p>
<p>The <span style="color: #ff0000;"><code>"[\u@\h \@ \W]#"</code></span> means &#8220;your username&#8221;@&#8221;hostname&#8221; &#8220;localtime&#8221; &#8220;working directory&#8221;.</p>
<p><span style="text-decoration: underline;"><strong>Making PS1 Environment Variable changes Permanent</strong></span></p>
<p>If you want to make the changes permanent, you will have to append this line of code to the end of your &#8220;.bashrc&#8221; file in your home directory. You can do this with by editing the .bashrc file with any text editor in linux (nano, vi, vim, gedit) and manually add in the following line <em><code><span style="color: #0000ff;">export  PS1="\e[31;1m[\u@\h \@ \W]# \e[0m"</span> </code></em>or this way:</p>
<p>1.  Put export  PS1="\e[31;1m[\u@\h \@ \W]# \e[0m" into a text file called "filenamehere"<br />
2.  Then type the following command:</p>
<p><span style="color: #ff0000;"> cat filenamehere &gt;&gt; ~.bashrc</span></p>
<p>3.  Then type exit in the terminal<br />
4.  Open up a new terminal and you then should see the changes to the bash prompt.</p>
<p>This effectively uses cat to pint the export PS1 command to standard output in the shell, then with the append operator "&gt;&gt;" it will redirect the export PS1 command and add it to the end of the .bashrc file.  It's a fun and simple shell script! <img src='http://overclockedtech.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   <span style="color: #ff0000;"><em><span style="text-decoration: underline;">CAUTION!!  Make sure you use the append operator "&gt;&gt;" and NOT the redirection "&gt;" operator which will delete everything in the .bashrc file and replace it with what ever you redirected.</span></em></span></p>
<p><span style="text-decoration: underline;"><strong>Reverse changes to PS1 Environment Variable</strong></span><br />
If you ever want to reverse the changes you have made to your PS1 environment variable, do the following:</p>
<p><a href="http://overclockedtech.com/wp-content/uploads/2010/01/vim-bashrc.png"><img class="size-full wp-image-410    alignnone" title="vim bashrc" src="http://overclockedtech.com/wp-content/uploads/2010/01/vim-bashrc.png" alt="" width="348" height="128" /></a></p>
<p>1.  Open a new terminal window<br />
2.  Type "vim .bashrc"<br />
3.  Use the arrow keys on the keyboard to scroll down to where it has the "Export PS1=" line.<br />
4.  Press the letter "d" twice on the keyboard to delete the whole line.<br />
5.  Press escape<br />
6.  press ":"<br />
7.  after the colon, type "qw" for quit and write.  This will quit vim and save the file.<br />
8.  Exit the terminal<br />
9.  The next time you open a terminal for that user, you will have the default PS1 settings again.</p>
<p>If you would like to get more details and info about editing PS1 environment variables, visit the site in the references section below.  It has a wealth of info on the subject.  Enjoy!!</p>
<p><span style="text-decoration: underline;"><em><strong>References:</strong></em></span><em><br />
<a href="http://www.funtoo.org/en/articles/linux/tips/prompt/" target="_blank">http://www.funtoo.org/en/articles/linux/tips/prompt/</a></em></p>


<p>Related posts:<ol><li><a href='http://overclockedtech.com/?p=287' rel='bookmark' title='Permanent Link: How to prevent yourself from accidentally deleting files in Unix/Linux'>How to prevent yourself from accidentally deleting files in Unix/Linux</a> <small>Everyone at some point has faced that horrible moment when...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=385</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Check if a certain user is logged on the Terminal Server using Powershell</title>
		<link>http://overclockedtech.com/?p=340</link>
		<comments>http://overclockedtech.com/?p=340#comments</comments>
		<pubDate>Mon, 28 Dec 2009 19:52:58 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[check if a user is logged in]]></category>
		<category><![CDATA[e-mail notification]]></category>
		<category><![CDATA[nwt]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[quser]]></category>
		<category><![CDATA[Server 2003]]></category>
		<category><![CDATA[System.Net.Mail]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=340</guid>
		<description><![CDATA[NWT is logged in!" echo "--> NWT is logged in! [ $date ]" > ./nwt.log } }else{ write-host "--> [ Problem ] NWT is not logged in!" $emailFrom = "administrator@example.com" $emailTo = "youremail@example.com" $subject = "NWT is not logged in" $body = " The NWT user account is not logged in on Termserver. This was [...]


Related posts:<ol><li><a href='http://overclockedtech.com/?p=246' rel='bookmark' title='Permanent Link: Powershell built-in GUI Editor!!'>Powershell built-in GUI Editor!!</a> <small>Many of you have probably been on the look for...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://overclockedtech.com/wp-content/uploads/2009/12/powershell2xa4-300x234.jpg" alt="" title="powershell" width="230" height=200" class="alignleft size-medium wp-image-367" /></p>
<p>Just recently I have been developing a Powershell script to determine if a specific user on a Windows Terminal Server is logged in or not.  If the user happens to not be logged in, It will e-mail a message to me and another co-worker to log that user in immediately.</p>
<p></p>
<p>It basically uses the quser command to get a list of the currently logged in users on the terminal server and stores that info into the variable $nwt.  I then setup a if statement to see if it matches &#8220;nwt&#8221; which is the username I want to make sure is logged in at all times.  If it does not find the string nwt in the $nwt variable, it will then send an e-mail to myself and a co-worker notifying us that he is not logged in.  This is possible via the &#8220;System.Net.Mail&#8221; .net object in the .net framework.  Here is a site with more information on the System.Net.Mail object, that helped me add a CC address to the e-mail, here is the link: <a href="http://www.systemnetmail.com/" target=blank>systemnetmail.com</a>.  And that&#8217;s really all there is too it!  </p>
<p> So far the script has been a success, since it has alerted us as to when this critical user account logs out so we can quickly log him back in. <i><u>(We have some software that needs this specific user account to run properly.. it&#8217;s really crappy software..)</i></u></p>
<p>
Below is the code:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<font color=blue></p>
<p><code></p>
<p>$nwt = invoke-expression -Command "quser nwt"</p>
<p>$date = date</p>
<p>if($nwt -is [Array]){</p>
<p>if($nwt[1] -match "nwt"){</p>
<p>write-host "--> NWT is logged in!"</p>
<p>echo "--> NWT is logged in! [ $date ]" > ./nwt.log</p>
<p>}</p>
<p>}else{</p>
<p>write-host "--> [ Problem ] NWT is not logged in!"</p>
<p>$emailFrom = "administrator@example.com"</p>
<p>$emailTo = "youremail@example.com"</p>
<p>$subject = "NWT is not logged in"</p>
<p>$body = "</p>
<p>The NWT user account is not logged in on Termserver.  This was detected at:[ $date ]"$smtpServer = "mail.example.local"</p>
<p>$msg = new-object System.Net.Mail.MailMessage $emailFrom, $emailTo,</p>
<p>$subject, $body</p>
<p>$msg.CC.Add("co-worker@example.com")</p>
<p>$smtp = new-object Net.Mail.SmtpClient($smtpServer)</p>
<p>$smtp.Send($msg)</p>
<p>}</p>
<p></code></p>
<p></font><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>


<p>Related posts:<ol><li><a href='http://overclockedtech.com/?p=246' rel='bookmark' title='Permanent Link: Powershell built-in GUI Editor!!'>Powershell built-in GUI Editor!!</a> <small>Many of you have probably been on the look for...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=340</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows &#8211; No Disk</title>
		<link>http://overclockedtech.com/?p=327</link>
		<comments>http://overclockedtech.com/?p=327#comments</comments>
		<pubDate>Fri, 11 Dec 2009 15:41:48 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Corrupted USB Drivers]]></category>
		<category><![CDATA[Windows - No Disk]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=327</guid>
		<description><![CDATA[The other day a client calls up and says she keeps getting a &#8220;Windows &#8211; No Disk&#8221; window, that will not go away no matter how many times she closes it.  I then asked when did this problem appear, in which she replied &#8220;after I pulled out the USB Flash Drive&#8221;.  So at this point [...]


Related posts:<ol><li><a href='http://overclockedtech.com/?p=301' rel='bookmark' title='Permanent Link: NTBACKUP error &#8211; &#8220;End of Media encountered while backing up to non-removable media.&#8221;'>NTBACKUP error &#8211; &#8220;End of Media encountered while backing up to non-removable media.&#8221;</a> <small>Today I was investigating why some ntbackup jobs were failing...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">The other day a client calls up and says she keeps getting a &#8220;Windows &#8211; No Disk&#8221; window, that will not go away no matter how many times she closes it.  I then asked when did this problem appear, in which she replied &#8220;after I pulled out the USB Flash Drive&#8221;.  So at this point I was thinking that some files she was working on, wanted to save themselves to the usb flash drive and could not since the drive was not present, thus causing the annoying &#8220;No Disk&#8221; error.  I then instructed her to save her work elsewhere on the hard drive and restart her workstation.  <a href="http://overclockedtech.com/wp-content/uploads/2009/12/Windows-No-Disk-Error.png"><img class="size-full wp-image-326  alignleft" title="Windows - No Disk Error" src="http://overclockedtech.com/wp-content/uploads/2009/12/Windows-No-Disk-Error.png" alt="Windows - No Disk Error" width="483" height="128" /></a>Unfortunately however, after she restarted her workstation and logged in the error continued to pop up!</p>
<p style="text-align: left;">Since the restart didn&#8217;t solve the issue, I knew it was time pull out my best tool in the shed &#8220;Google Search&#8221;.  After a couple google searches and a couple forums,<span style="color: #ff0000;"><em> I found out that the reason for this error is due to a usb driver that became corrupted during installation. </em><span style="color: #000000;">The solution is to uninstall the usb drivers and reinstall them.</span></span></p>
<p style="text-align: left;"><span style="color: #ff0000;"><span style="color: #000000;">Once I had uninstalled all the usb drivers in Computer Management and restarted the workstation, the &#8220;Windows &#8211; No Disk&#8221; error appeared no more.  Mere mortals can only guess why the usb driver became corrupted in Windows, but thanks to google and a post on technet this XP annoyance was solved!<br />
</span></span></p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>References:</strong></span></p>
<p style="text-align: left;"><a href="http://social.technet.microsoft.com/Forums/en/itprovistahardware/thread/d5f38918-d11b-45c4-861d-b53aa3dbdaed" target="_blank">http://social.technet.microsoft.com/Forums/en/itprovistahardware/thread/d5f38918-d11b-45c4-861d-b53aa3dbdaed</a></p>


<p>Related posts:<ol><li><a href='http://overclockedtech.com/?p=301' rel='bookmark' title='Permanent Link: NTBACKUP error &#8211; &#8220;End of Media encountered while backing up to non-removable media.&#8221;'>NTBACKUP error &#8211; &#8220;End of Media encountered while backing up to non-removable media.&#8221;</a> <small>Today I was investigating why some ntbackup jobs were failing...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=327</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NTBACKUP error &#8211; &#8220;End of Media encountered while backing up to non-removable media.&#8221;</title>
		<link>http://overclockedtech.com/?p=301</link>
		<comments>http://overclockedtech.com/?p=301#comments</comments>
		<pubDate>Fri, 13 Nov 2009 22:44:13 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[End of Media cencountered while backing up to non-removable media]]></category>
		<category><![CDATA[fat32]]></category>
		<category><![CDATA[filesystem limits]]></category>
		<category><![CDATA[ntbac]]></category>
		<category><![CDATA[NTBACKUP]]></category>
		<category><![CDATA[ntbackup error]]></category>
		<category><![CDATA[ntfs]]></category>
		<category><![CDATA[Server 2003]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=301</guid>
		<description><![CDATA[Today I was investigating why some ntbackup jobs were failing on a remote server, and came across this error message in the logs : &#8220;End of Media encountered while backup up to non-removable media&#8221;. So I googled the error, and came up with a couple forums talking about how backups being saved to tape drives [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Today I was investigating why some ntbackup jobs were failing on a remote server, and came across this error message in the logs :<span style="color: #ff0000;"> &#8220;End of Media encountered while backup up to non-removable media&#8221;.</span> So I googled the error, and came up with a couple forums talking about how backups being saved to tape drives get this error when the tape runs out of space.  In my situation however, I was not using a tape drive for the backups, I was using an external hard drive.</p>
<p style="text-align: left;">Below is a screenshot of the NTBACKUP log</p>
<p style="text-align: left;"><a href="http://overclockedtech.com/wp-content/uploads/2009/11/NTBACKUP-log-error.png"><img class="size-full wp-image-302   alignnone" title="NTBACKUP log error" src="http://overclockedtech.com/wp-content/uploads/2009/11/NTBACKUP-log-error.png" alt="NTBACKUP log error" width="558" height="410" /></a></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">As you can see in the NTBACKUP log, when it tried to backup the files to the external hard drive it encountered the &#8220;End of Media&#8221; error.</p>
<p style="text-align: left;">So at this point I was hitting my head against the wall wondering why in the *(#$ is this happening!!?  The external hard drive had plenty of free space for the backups, it just didn&#8217;t make any sense!!  As a usual Sysadmin response I decided to dig dipper into the issue.  After thinking it though a bit, I had some inspiration to check &#8220;Computer Management&#8221; and take a look at the partition and filesystem setup of the external hard drive.  Below is a screenshot of what I discovered in Computer Management:</p>
<p style="text-align: left;"><a href="http://overclockedtech.com/wp-content/uploads/2009/11/computer-management-bestsrv.png"><img class="size-full wp-image-304  alignleft" title="computer management - bestsrv" src="http://overclockedtech.com/wp-content/uploads/2009/11/computer-management-bestsrv.png" alt="computer management - bestsrv" width="515" height="412" /></a></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">If you look volume E: in the top right, under filesystem it reads<span style="color: #ff0000;"> &#8220;fat32&#8243;!</span> <span style="text-decoration: underline;"><em>Once I saw that it occurred to me that the backups were failing because they exceeded the 4GB file size limit of the fat32 filesystem</em></span>.  Sure enough after checking the backup sizes It was just barely over 4GB which would explain why NTBACKUP reported that the disk was out of space.  After discovering the true cause behind the failing backups, I backed-up all the data on the Western Digital MyBook, reformatted it with NTFS, and transferred all the data back onto the external drive.  That effectively solved the issue and allowed the customer to continue to backup the server without buying any additional hardware.</p>
<p style="text-align: left;"><strong><em>It just comes to show that most problems are simple to fix and easy to overlook. </em></strong></p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>References:</strong></span><a href="http://www.experts-exchange.com/Storage/Misc/Q_20710438.html" target="_blank"></p>
<p>http://www.experts-exchange.com/Storage/Misc/Q_20710438.html</a></p>
<p style="text-align: left;"><a href="http://en.wikipedia.org/wiki/File_Allocation_Table" target="_blank">http://en.wikipedia.org/wiki/File_Allocation_Table</a></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=301</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to prevent yourself from accidentally deleting files in Unix/Linux</title>
		<link>http://overclockedtech.com/?p=287</link>
		<comments>http://overclockedtech.com/?p=287#comments</comments>
		<pubDate>Mon, 09 Nov 2009 23:36:37 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[prevent accidental deletion]]></category>
		<category><![CDATA[rm]]></category>
		<category><![CDATA[rm -i]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=287</guid>
		<description><![CDATA[Everyone at some point has faced that horrible moment when you realize that you just deleted a critical file, and start scrambling to find ways to recover it before it is too late.  If you haven&#8217;t faced this situation yet, you are the lucky few who have been spared from this horrible experience so far.  [...]


Related posts:<ol><li><a href='http://overclockedtech.com/?p=257' rel='bookmark' title='Permanent Link: Understanding Unix/Linux Load Averages'>Understanding Unix/Linux Load Averages</a> <small>I was looking at some linux server the other day,...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Everyone at some point has faced that horrible moment when you realize that you just deleted a critical file, and start scrambling to find ways to recover it before it is too late.  If you haven&#8217;t faced this situation yet, you are the lucky few who have been spared from this horrible experience so far.  Just the other day, I found a really creative solution in Linux that will prevent you from accidentally deleting files by mistake.  It&#8217;s actually not that complicated either, and I am sure you will be using this technique to protect your most valuable files after your through reading my how-to.</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Step 1 &#8211; Choose a Directory</strong></span></p>
<p style="text-align: left;"><a href="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete.JPG"><img class="size-full wp-image-288 alignnone" title="HOWTO-prevent-accidental-delete" src="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete.JPG" alt="HOWTO-prevent-accidental-delete" width="596" height="158" /></a></p>
<p style="text-align: left;">As you can see, I have created a directory called &#8220;test&#8221; and have created a ton of empty files and directories for testing purposes.  It was fun writing the Perl script to create all those &#8220;crap&#8221; files.</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Step 2 &#8211; Create a empty file call &#8220;-i&#8221; in the chosen directory</strong></span></p>
<p style="text-align: left;"><a href="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete-2.JPG"><img class="size-full wp-image-289 alignnone" title="HOWTO-prevent-accidental-delete-2" src="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete-2.JPG" alt="HOWTO-prevent-accidental-delete-2" width="356" height="21" /></a></p>
<p style="text-align: left;">To do this simply use the touch command to create the empty file &#8220;-i&#8221;, as such: &#8220;touch ./-i&#8221;</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Step 3 &#8211; Verify that &#8220;-i&#8221; exists in the current directory</strong></span></p>
<p style="text-align: left;"><a href="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete-3.1.JPG"><img class="size-full wp-image-291 alignnone" title="HOWTO-prevent-accidental-delete-3.1" src="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete-3.1.JPG" alt="HOWTO-prevent-accidental-delete-3.1" width="522" height="161" /></a></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">To make sure &#8220;-i&#8221; was created successfully, list the directory contents by invoking the &#8220;ls&#8221; command as show above.  Once you do that you will notice a new file called &#8220;-i&#8221; listed in the current directory.</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Step 4 &#8211; Try to delete the files in the current directory</strong></span></p>
<p style="text-align: left;"><a href="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete-3.9.JPG"><img class="size-full wp-image-293 alignnone" title="HOWTO-prevent-accidental-delete-3.9" src="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete-3.9.JPG" alt="HOWTO-prevent-accidental-delete-3.9" width="334" height="19" /></a></p>
<p style="text-align: left;">Try deleting all of them at once by using &#8220;rm *&#8221;.</p>
<p style="text-align: left;"><strong><span style="color: #ff0000;">WARNING</span></strong><span style="color: #ff0000;"> &#8211; make sure you have the &#8220;-i&#8221; the the directory before you try to remove any files!  Without the &#8220;-i&#8221; file there will be nothing to stop the rm command from removing your precious files!!</span></p>
<p style="text-align: left;">Below is a screenshot of what should happen when you try to delete any file in that directory.</p>
<p style="text-align: left;"><a href="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete-4.JPG"><img class="size-full wp-image-292 alignnone" title="HOWTO-prevent-accidental-delete-4" src="http://overclockedtech.com/wp-content/uploads/2009/11/HOWTO-prevent-accidental-delete-4.JPG" alt="HOWTO-prevent-accidental-delete-4" width="457" height="494" /></a></p>
<p style="text-align: left;">Did you notice what happened?  When we tried to delete any file in that directory, It would prompt us to confirm if we really wanted to delete each file.  <span style="text-decoration: underline;"><em>This happens because the &#8220;-i&#8221; file is immediately interpreted by the Unix/Linux command line as a option for the &#8220;rm&#8221; command</em></span>, <span style="text-decoration: underline;"><em>which prompts before deleting a file</em></span>.  If you man rm and look through the man page you will find the following entry:</p>
<pre style="text-align: left;"><strong>  -i, --interactive
	      prompt before any removal</strong></pre>
<p>So that is the magic behind creating the empty &#8220;-i&#8221; file and how it helps prevent you from deleting file by mistake.  Now don&#8217;t forget that if you use the rm -f command, it will delete the file no matter what!! That&#8217;s why it&#8217;s called the FORCE option!</p>
<p>Use this technique to your advantage and spread the word!</p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">


<p>Related posts:<ol><li><a href='http://overclockedtech.com/?p=257' rel='bookmark' title='Permanent Link: Understanding Unix/Linux Load Averages'>Understanding Unix/Linux Load Averages</a> <small>I was looking at some linux server the other day,...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=287</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Unix/Linux Load Averages</title>
		<link>http://overclockedtech.com/?p=257</link>
		<comments>http://overclockedtech.com/?p=257#comments</comments>
		<pubDate>Wed, 07 Oct 2009 18:23:39 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Load Averages]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Top]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=257</guid>
		<description><![CDATA[I was looking at some linux server the other day, and was taking a look of the load averages using the &#8220;top&#8221; command.  After staring at the load averages for a while, I thought to myself &#8216;What does that mean exactly?&#8221; and &#8220;How do they get those numbers?&#8221;.  Well after some research I have found [...]


Related posts:<ol><li><a href='http://overclockedtech.com/?p=287' rel='bookmark' title='Permanent Link: How to prevent yourself from accidentally deleting files in Unix/Linux'>How to prevent yourself from accidentally deleting files in Unix/Linux</a> <small>Everyone at some point has faced that horrible moment when...</small></li>
<li><a href='http://overclockedtech.com/?p=385' rel='bookmark' title='Permanent Link: Change the color and format of the Bash prompt'>Change the color and format of the Bash prompt</a> <small>Recently I got bored with the standard prompts and colors...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I was looking at some linux server the other day, and was taking a look of the load averages using the &#8220;top&#8221; command.  After staring at the load averages for a while, I thought to myself &#8216;What does that mean exactly?&#8221; and &#8220;How do they get those numbers?&#8221;.  Well after some research I have found out that the load average is not a % of cpu usage, <span style="color: #ff0000;"><em>but is a representation of the load on the CPU by processes waiting for their time to use the CPU. </em></span></p>
<p>Below is a screenshot of the top command for reference.  Notice in the top right are the load averages &#8220;1.23&#8243; 1.17&#8243; &#8220;1.05&#8243;.  The first load average is for 1 minute, the middle is for 5 minutes, and the last one is for 15 minutes.</p>
<p><a href="http://overclockedtech.com/wp-content/uploads/2009/10/top1.png"><img class="alignleft size-full wp-image-259" title="top and load averages" src="http://overclockedtech.com/wp-content/uploads/2009/10/top1.png" alt="top and load averages" width="499" height="76" /></a></p>
<p>Now the important thing to remember about Unix/Linux load averages is that it is not a % of cpu usage, but how many processes are waiting to use the cpu.  The higher the load average, the more load the server in under.  Right about now you are probably wondering &#8221; well what is a normal load average?&#8221; or &#8220;What is a high load average?&#8221;, the easiest way to determine if your load average is normal or high is to look at it in the following way:</p>
<table border="1">
<tbody>
<tr>
<td>CPU Cores</td>
<td>Normal Load Average</td>
</tr>
<tr>
<td>1</td>
<td>1.00</td>
</tr>
<tr>
<td>2</td>
<td>2.00</td>
</tr>
<tr>
<td>3</td>
<td>3.00</td>
</tr>
<tr>
<td>4</td>
<td>4.00</td>
</tr>
<tr>
<td>8</td>
<td>8.00</td>
</tr>
<tr>
<td>16</td>
<td>16.00</td>
</tr>
</tbody>
</table>
<p>As you can see a normal load average for a single core cpu is 1.00 while a dual core cpu can handle a load average of 2.00.  If it helps you out, you can think of 1.00 to be %100 for a single core and 2.00 be %100 for a dual core, and so on.</p>
<p><a href="http://overclockedtech.com/wp-content/uploads/2009/10/top2.png"><img class="alignleft size-full wp-image-275" title="top showing each individual core (8 Cores)" src="http://overclockedtech.com/wp-content/uploads/2009/10/top2.png" alt="top showing each individual core (8 Cores)" width="505" height="177" /></a></p>
<p>Above is a screenshot of top showing each individual cores ultilization.  This is an 8 core cpu, so it&#8217;s normal load average is 8.00.  You can see this output in top by pressing &#8220;1&#8243; on the keyboard.  Also, if you were wondering how I got top to display different colors, just press &#8220;z&#8221; on the keyboard.</p>
<p>The key thing to remember is that load averages in Unix/Linux are not % for cpu utilization, it is merely a representation of how many processes are waiting for their turn to use the processor.</p>
<p><span style="text-decoration: underline;"><strong>References</strong></span><a href="http://www.linuxjournal.com/article/9001" target="_blank"><br />
http://www.linuxjournal.com/article/9001</a><a href="http://www.linuxjournal.com/article/9001" target="_blank"></a></p>
<p><a href="http://blog.raamdev.com/2008/11/22/understanding-the-linux-load-averages" target="_blank">http://blog.raamdev.com/2008/11/22/understanding-the-linux-load-averages</a></p>


<p>Related posts:<ol><li><a href='http://overclockedtech.com/?p=287' rel='bookmark' title='Permanent Link: How to prevent yourself from accidentally deleting files in Unix/Linux'>How to prevent yourself from accidentally deleting files in Unix/Linux</a> <small>Everyone at some point has faced that horrible moment when...</small></li>
<li><a href='http://overclockedtech.com/?p=385' rel='bookmark' title='Permanent Link: Change the color and format of the Bash prompt'>Change the color and format of the Bash prompt</a> <small>Recently I got bored with the standard prompts and colors...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=257</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Powershell built-in GUI Editor!!</title>
		<link>http://overclockedtech.com/?p=246</link>
		<comments>http://overclockedtech.com/?p=246#comments</comments>
		<pubDate>Mon, 05 Oct 2009 21:54:28 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Powershell GUI editor]]></category>
		<category><![CDATA[Powershell Integrated Scritping Environment]]></category>
		<category><![CDATA[powershell_ise.exe]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=246</guid>
		<description><![CDATA[Many of you have probably been on the look for a gui editor for the new windows powershell, well look no more!  Microsoft has included a built-in gui editor for powershell (I didn&#8217;t even know until now), and all you need to do to run it is follow one of the 2 ways below. Method [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Many of you have probably been on the look for a gui editor for the new windows powershell, well look no more!  Microsoft has included a built-in gui editor for powershell (I didn&#8217;t even know until now), and all you need to do to run it is follow one of the 2 ways below.</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Method 1</strong></span></p>
<p style="text-align: left;"><span style="color: #ff0000;">1. Click Start<br />
2. Type &#8220;Powershell ise&#8221; and hit enter<br />
3.  The Powershell integrated scripting environment will then start!</span></p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Method 2</strong></span></p>
<p style="text-align: left;"><span style="color: #ff0000;">1.  Open powershell<br />
2.  In the console type: &#8220;powershell_ise.exe&#8221;<br />
3.  Hit enter.</span></p>
<p style="text-align: left;"><span style="color: #ff0000;"><span style="color: #000000;">Below are some screenshots for reference:</span><br />
</span></p>
<p style="text-align: left;"><img class="alignleft size-full wp-image-247" title="powershell - run ise" src="http://overclockedtech.com/wp-content/uploads/2009/10/powershell-run-ise.JPG" alt="powershell - run ise" width="578" height="194" /></p>
<p style="text-align: left;">Below is a screenshot of what the Powershell ISE looks like.  Check it out!</p>
<p style="text-align: left;"><a href="http://overclockedtech.com/wp-content/uploads/2009/10/powershell-editor.JPG"><img class="size-medium wp-image-248 alignleft" title="powershell editor" src="http://overclockedtech.com/wp-content/uploads/2009/10/powershell-editor-300x268.jpg" alt="powershell editor" width="300" height="268" /></a></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">The powershell gui editor basically works like this:  The top area is your script editor, the middle area is where you will see the output/results of your powershell script and commands.  The bottom area is where you can enter powershell commands as if you were on the powershell command prompt.</p>
<p style="text-align: left;">Once you start using it, I am sure you will see a increase in productivity while creating/testing scripts.  This is because it allows you to edit a script, run it, see it&#8217;s output, and even run commands as if you were at the command prompt.  It&#8217;s streamlined everything you could want or need into one program!  +1 point for Microsoft! (we&#8217;ll see how long that lasts lol).</p>
<p style="text-align: left;">Well what are you waiting for?  Lets get scripting!</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Powershell Download Links</strong></span></p>
<p style="text-align: left;">1. <a title="Powershell 2.0 CTP" href="http://www.microsoft.com/downloadS/details.aspx?familyid=60DEAC2B-975B-41E6-9FA0-C2FD6AA6BC89&amp;displaylang=en" target="_blank"> Powershell 2.0 CTP</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=246</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unattended FTP script to download files</title>
		<link>http://overclockedtech.com/?p=243</link>
		<comments>http://overclockedtech.com/?p=243#comments</comments>
		<pubDate>Sun, 30 Aug 2009 04:49:50 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[Batch]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[FTP Modes]]></category>
		<category><![CDATA[FTP script]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Server 2003]]></category>
		<category><![CDATA[unattended FTP script]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=243</guid>
		<description><![CDATA[Looks like I also found a nice quick way to download files off my webserver using a ftp script.  It&#8217;s so simple that I don&#8217;t know why I didn&#8217;t even think of it before!  Before I had this script, I had to manually download my sysadmin-tools from my website onto the remote servers I was [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Looks like I also found a nice quick way to download files off my webserver using a ftp script.  It&#8217;s so simple that I don&#8217;t know why I didn&#8217;t even think of it before!  Before I had this script, I had to manually download my sysadmin-tools from my website onto the remote servers I was doing maintenance on that particular day.  That took about 3-5 minutes each time I had to download the tools I had in a zip file on my webserver, which as you can imagine get really repetitive and annoying after a while.  So after about the 50th time downloading the sysadmin-tools, I decided to automate it!</p>
<p><span style="text-decoration: underline;"><strong>This is how I approached creating the script:</strong></span></p>
<p>1.  It has to work out of the box with Windows (I administer and maintain Windows Server 2003 boxes)</p>
<p>2.  It had to connect to my webserver using my username and password</p>
<p>3.  It had to change directories on the server to the download directory</p>
<p>4.  K.I.S.S (keep it simple stupid!)</p>
<p><span style="text-decoration: underline;"><strong>Decisions:</strong></span></p>
<p>After reviewing the script requirements, <em><span style="color: #ff0000;">I decided to write a simple batch script using the built in FTP command in windows</span></em>.  I didn&#8217;t know windows had a built in FTP command to tell you the truth until I starting writing the script.</p>
<p><span style="text-decoration: underline;"><strong>Unattended FTP Script:</strong></span></p>
<p>Below are the contents of the batch file:</p>
<p><span style="color: #ff0000;">@echo off</span></p>
<p>ftp -s:ftpscript.txt</p>
<p><span style="color: #000000;">Below are the contents of the ftpscript.txt file:</span></p>
<p><span style="color: #ff0000;">open<br />
yourserver.com<br />
username<br />
password<br />
cd &#8220;/public_html/yourdownloadfolder&#8221;<br />
binary<br />
get &#8220;sysadmin-tools.zip&#8221; &#8220;C:\Users\username\Desktop\sysadmin-tools.zip&#8221;<br />
quit</span></p>
<p><span style="text-decoration: underline;"><strong>Explanation:</strong></span></p>
<p>It&#8217;s pretty straightforward, the batch file using the ftp command to start the built-in ftp program in windows.  After that the batch script calls the &#8220;ftpscript.txt&#8221; file to supply the ftp command to execute.  In the ftpscript.txt file it basically says to connect to a server, enters a username and password, then changes directories to the directory that contains the file you wish to download, switches the FTP mode to binary so it will download the .zip file correctly, downloads the file to somewhere on my Desktop, and finally quits FTP.</p>
<p><span style="text-decoration: underline;"><strong>FTP Modes:</strong></span></p>
<p>Make sure you are downloading in the right FTP mode!! I was getting corrupted files at first when I was making the script because I was downloading the .zip file in the wrong mode.  Once I changed to binary it downloaded successfully without any corruption issues.</p>
<p><span style="color: #ff0000;">Text files (html, php, css, java) &#8212; use text mode<br />
Multimedia files (images, audio, video) &#8212; use binary mode<br />
Programs (.exe, .class, .jar, .swf) &#8212; use binary mode</span></p>
<p><span style="text-decoration: underline;"><strong>References:<br />
</strong></span><a href="http://www.robvanderwoude.com/ftp.php" target="_blank">http://www.robvanderwoude.com/ftp.php</a><br />
<a href="http://www.bluehostforum.com/showthread.php?t=9311" target="_blank">http://www.bluehostforum.com/showthread.php?t=9311</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=243</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using scp with spaces in the file path</title>
		<link>http://overclockedtech.com/?p=216</link>
		<comments>http://overclockedtech.com/?p=216#comments</comments>
		<pubDate>Fri, 28 Aug 2009 16:24:14 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[upload to server]]></category>
		<category><![CDATA[using scp with spaces]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=216</guid>
		<description><![CDATA[I just recently learned how to upload a file from my linux box to my webserver using scp the other day. Normally its pretty straightforward to use scp to upload or download a file to a server, however I was having the hardest time uploading this one file that had spaces in the file path. [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I just recently learned how to upload a file from my linux box to my webserver using scp the other day.  Normally its pretty straightforward to use scp to upload or download a file to a server, however I was having the hardest time uploading this one file that had spaces in the file path.</p>
<p>Here is what it looked like:</p>
<p style="text-align: left;"><span style="color: #ff0000;">scp -r /home/username/Desktop/Sysadmin\ Tools/sysadmin-tools.zip user@website.com:public_html/somefolder/</span></p>
<p>When i would run this command, the following error would be displayed:</p>
<p><span style="color: #ff0000;">zip warning: name not matched: /home/username/Desktop/Sysadmin<br />
zip warning: name not matched: Tools/*</span></p>
<p>As you can see, it was breaking up the file path at the space in &#8220;Sysadmin Tools&#8221; folder, and breaking it up into different arguments.  The solution to this problem is to do the following:</p>
<p><span style="text-decoration: underline;"><strong>Solution:</strong></span></p>
<p style="text-align: left;"><span style="color: #ff0000;">scp -r /home/username/Desktop/Sysadmin\\ Tools/sysadmin-tools.zip user@website.com:public_html/somefolder/</span></p>
<p>All I needed to add was an extra &#8220;\&#8221;  backspace character after &#8220;Sysadmin&#8221;.  This is because when the file is uploaded to the remote server, the &#8220;\&#8221; escape character will disappear (I am not sure why), and will cause this kind of error.  However if you double escape the space &#8220;\\&#8221;, the first escape character will be removed but the second will remain, thus keeping the correct file path.</p>
<p><span style="text-decoration: underline;"><strong>References:</strong></span><a href="http://www.thingy-ma-jig.co.uk/blog/14-05-2007/how-to-scp-a-path-with-spaces" target="_blank"></p>
<p>http://www.thingy-ma-jig.co.uk/blog/14-05-2007/how-to-scp-a-path-with-spaces</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=216</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shutdown script did not shutdown the sever! Exit Code 0x4f7</title>
		<link>http://overclockedtech.com/?p=188</link>
		<comments>http://overclockedtech.com/?p=188#comments</comments>
		<pubDate>Tue, 18 Aug 2009 17:22:02 +0000</pubDate>
		<dc:creator>General Mills</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[0x4f7]]></category>
		<category><![CDATA[4f7]]></category>
		<category><![CDATA[failed shutdown]]></category>
		<category><![CDATA[force shutdown]]></category>
		<category><![CDATA[net helpmsg 1271]]></category>
		<category><![CDATA[Server 2003]]></category>
		<category><![CDATA[shutdown script]]></category>
		<category><![CDATA[shutdown.exe]]></category>
		<category><![CDATA[system locked]]></category>

		<guid isPermaLink="false">http://overclockedtech.com/?p=188</guid>
		<description><![CDATA[Well recently a shutdown script that I wrote did not shutdown a server successfully for some odd reason.  The script looks like the following: shutdown -r -t 20 -c &#8220;Shutting Down to Install Windows Updates&#8221; So until now this script has been working flawlessly on multiple servers.  I&#8217;ve been able to schedule automatic reboots of [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Well recently a shutdown script that I wrote did not shutdown a server successfully for some odd reason.  The script looks like the following:</p>
<p><span style="color: #ff0000;"><strong>shutdown -r -t 20 -c &#8220;Shutting Down to Install Windows Updates&#8221;</strong></span></p>
<p>So until now this script has been working flawlessly on multiple servers.  I&#8217;ve been able to schedule automatic reboots of remote servers easily using this script in combination with windows scheduled tasks as well.  It comes in handy when you need to reboot the server at a specific time, such as 5:25PM or 1:26AM, which is great for me since I do a lot of remote server maintenance and do not have physical access to these servers.</p>
<p>Anyway, after trying to reboot this one server it gave me a exit code of (0x47f) which showed up in the scheduled tasks log.</p>
<p style="text-align: center;"><a href="http://overclockedtech.com/wp-content/uploads/2009/08/scheduled-tasks-0x4f7.png"><img class="size-medium wp-image-197 aligncenter" title="scheduled tasks 0x4f7" src="http://overclockedtech.com/wp-content/uploads/2009/08/scheduled-tasks-0x4f7-300x202.png" alt="scheduled tasks 0x4f7" width="300" height="202" /></a></p>
<p style="text-align: left;">After Looking up the exit code, I found a website that directed me to convert 47f to decimal and enter the decimal value &#8220;net helmsg&#8221; in the command line.  The command I entered was <span style="color: #ff0000;"><strong>&#8220;net helpmsg 1271&#8243;<span style="color: #000000;">, which gave me the following answer: &#8220;The machine is locked and can not be shut down without the force option&#8221;.<br />
</span></strong></span></p>
<p style="text-align: center;"><a href="http://overclockedtech.com/wp-content/uploads/2009/08/net-helpmsg-12711.png"><img class="aligncenter size-full wp-image-211" title="net helpmsg 1271" src="http://overclockedtech.com/wp-content/uploads/2009/08/net-helpmsg-12711.png" alt="net helpmsg 1271" width="518" height="252" /></a></p>
<p>Well isn&#8217;t that great!  A error code that is easily understandable from Microsoft!</p>
<p>The solution to this problem was to edit my script to include the force option.  Here is the updated script below:</p>
<p><span style="color: #ff0000;">shutdown -r -f -t 20 -c &#8220;Shutting Down to Install Windows Updates&#8221;</span></p>
<p>And that should do the trick.</p>
<p><span style="text-decoration: underline;"><strong>References:</strong></span><a href="http://www.tech-archive.net/Archive/Windows/microsoft.public.windows.terminal_services/2006-08/msg00331.html" target="_blank"></p>
<p>http://www.tech-archive.net/Archive/Windows/microsoft.public.windows.terminal_services/2006-08/msg00331.html</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://overclockedtech.com/?feed=rss2&amp;p=188</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
