<?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>GBuffer.net &#187; general computers</title>
	<atom:link href="http://www.gbuffer.net/archives/tag/general-computers/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gbuffer.net</link>
	<description>&#62; Sid’s data dump</description>
	<lastBuildDate>Thu, 06 Oct 2011 16:09:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Assigning size quotas to folders on Windows</title>
		<link>http://www.gbuffer.net/archives/343</link>
		<comments>http://www.gbuffer.net/archives/343#comments</comments>
		<pubDate>Mon, 16 May 2011 19:08:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[general computers]]></category>

		<guid isPermaLink="false">http://www.gbuffer.net/?p=343</guid>
		<description><![CDATA[I was recently given a task where I needed to assign quotas to folders on a Windows system. Preferably without creating multiple users. This could be a very useful feature in budgeting disk space to various users or applications. Now if you do some quick searches on Google you will quickly realise that this specific [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently given a task where I needed to assign quotas to folders on a Windows system. Preferably without creating multiple users. This could be a very useful feature in budgeting disk space to various users or applications. Now if you do some quick searches on Google you will quickly realise that this specific feature is not supported by any version of Windows. Well that&#8217;s a shame! But that does not mean that there is no work around. The solution in one line is to create a virtual disk (vdisk) and mount this vdisk onto a path on the system. All applications will see this path as an ordinary folder but will be restricted by the virtual drive&#8217;s size.</p>
<h3>On Windows 7 and Windows Server 2008</h3>
<p>For those who are not sure how this can be done, the answer is a less well known command line utility called diskpart.exe. Diskpart is able to run scripts using the /s switch. Scripts are nothing but text files with a series of diskpart commands. So the script we need to create will need to do the following&#8230;</p>
<ol>
<li>Create a virtual disk</li>
<li>Create a partition on this virtual disk</li>
<li>Format the virtual disk</li>
<li>Map the virtual disk on to a path</li>
</ol>
<p>The script to do this is as follows. If you prefer, you can start diskpart and type these command in line by line.</p>
<pre class="brush: php">create vdisk file=c:\myDisk.vhd maximum=2048  type=expandable
select vdisk file=c:\myDisk.vhd
attach vdisk
create partition primary
format fs=ntfs quick
assign mount=&quot;c:\my folder&quot;</pre>
<p>A line by line explanation of the script is doing is this</p>
<p>Line 1: Creates a vdisk which will be saved as a file at c:\myDisk.vhd with a size of 2048Mb. The type=expandable part makes sure the size of file depends on the amount of data saved in your vdisk. If you skip this parameter the file will take up the entire 2048Mb of space, even if you have not saved a single byte.<br />
Line 2: makes the vdisk current. This way all future operations will target this vdisk.<br />
Line 3: So far we have only created a vdisk. Think of this command as  connecting the vdisk to your computer (virtually) just as you would connect a USB storage device to a USB port.<br />
Line 4: Creates a partition on the vdisk<br />
Line 5: Format the new partition using NTFS<br />
Line 6: Map the vdisk on to a folder. In this case it is c:\my folder, but you can change this to whatever you like.</p>
<p>So that&#8217;s it. I have made a small batch to automate the process for Windows 7. Get it from the link below.</p>
<p>[<a href="http://dl.dropbox.com/u/757277/www/gbuffer/niknaks/quota.bat"><img title="compress" src="/wp-content/uploads/page_white_script.png" alt="compress" width="16" height="16" /><strong> Download quota.bat</strong></a>]</p>
<h3>On older versions of Windows</h3>
<p>If you are using something older than XP, then I&#8217;m afraid you need to WAKE UP and realise we are in 2011. The stuff mentioned in this section will work only on Windows XP and newer versions.</p>
<p>The problem on older versions of Windows is that diskpart does not support virtual disks. We just need to use different tools to do the same thing, so if you skipped the previous section I suggest you go back and read it again. The bad news is that you will need to download some additional software. The good news is that all these tools are free. These are the tools you will need&#8230;</p>
<ol>
<li>vhdtool.exe (<a href="http://archive.msdn.microsoft.com/vhdtool">From here</a>)</li>
<li>vhdmount by installing <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=bc49c7c8-4840-4e67-8dc4-1e6e218acce4">Microsoft Virtual Server 2005</a>. <span style="text-decoration: underline;">Note</span>: When installing use the custom install option and only select vhdmount from the list. The other components are not needed unless you want to play with them.</li>
</ol>
<p>As mentioned previously, the process is the same one as we did for Windows 7. The step by step process is as follows.</p>
<p><strong>Step 1:</strong> Create a vdisk using vhdtool.exe using the following command line.<br />
VhdTool.exe /create c:\myDisk.vhd 2147483648<br />
There are two differences here. 1 &#8211; The size we enetered here is in bytes, so we need to multiply the number of bytes we want with 1048576 and 2- We don&#8217;t have the option of creating an expandable drive. So the vdisk file will take up all the space requested regardless of how much is actually stored in it.</p>
<p><strong>Step 2:</strong> Connect the vdisk (only virtually of course) using vhdmount.exe<br />
vhdmount.exe /p /f c:\myDisk.vhd</p>
<p><strong>Step 3:</strong> Create a partition on the drive using diskpart. But before we do this, we must first start diskpart<br />
1. Identify the disk number using the diskpart LIST command<br />
LIST DISK<br />
Make a note of the disk number. In my case it is 1.<br />
2. Select the disk using the command<br />
SELECT DISK 1<br />
3. Create the partition like we did before using the CREATE command<br />
CREATE PARTITION PRIMARY</p>
<p><strong>Step 4: </strong> Unfortunately old versions of diskpart don&#8217;t have a format command, so we must do this using the good old format.com. But format.exe only works on drive letters, so that is what we need to do using the ASSIGN command<br />
ASSIGN letter=x<br />
Now, you will need to exit diskpart temporarily using the EXIT command and format the drive using good old format.com. If you have never done this or have gotn&#8217; used to the GUI, this is how it is done from the command line&#8230;<br />
format.com x: /Q /FS:NTFS</p>
<p><strong>Step 5</strong>: Now if you don&#8217;t mind using the drive, you can stop here. Otherwise head back into diskpart to un-mount the volume. Unfortunately since we exited diskpart, we need to reselect the right volume. Get a list of volume using the LIST command as follows<br />
LIST volume<br />
Make a note of the volume number.  It will have the drive letter mentioned under the Ltr column. In this case it is x. Then select it using&#8230;<br />
SELECT volume 2<br />
Then remove the drive letter mapping using the REMOVE command as follows<br />
REMOVE letter=x<br />
And finally map it on to your folder using&#8230;<br />
ASSIGN mount=&#8221;c:\my folder&#8221;</p>
<p>And so that is it. Although you may be able to automate the process using a combination of batch files and grep, I successfully implemented a command line PHP script to automate the process on Windows XP as well. You can also probably use a VB script, but that is not something I am very familiar with. The problem is identifying the disk number in step 3 and volume number in step 5. I used the following process to determine the disk number automatically.</p>
<ol>
<li>Make a list of disks before plugging in the vdisk in step 2.</li>
<li>Use a regex pattern match and extract a list of disk numbers.</li>
<li>Mount the vdisk.</li>
<li>Make another list of disks. This time, the list will have the vdisk that you just mounted.</li>
<li>Identify the disk that is in the second list but not in the first one.</li>
</ol>
<p>Identifying the volume number in step 5 if much simpler. Just use a regex pattern to identify the line which has the drive letter x. The number to the left of it will be the volume number.</p>
<p>There are a lot of other cool things you can do using diskpart that is not available via a GUI. If you don&#8217;t mind getting your hands dirty using the command line, then <a href="http://support.microsoft.com/kb/300415">this is a good place to get started</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gbuffer.net/archives/343/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keyboard remap &#8211; Change, disable or remap keys on Windows</title>
		<link>http://www.gbuffer.net/archives/163</link>
		<comments>http://www.gbuffer.net/archives/163#comments</comments>
		<pubDate>Wed, 10 Jun 2009 06:45:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[general computers]]></category>

		<guid isPermaLink="false">http://www.gbuffer.net/?p=163</guid>
		<description><![CDATA[Very often you need to disable or remap keys to new characters on your keyboard. This post explains how I did this without the need for any additional software running in background and a small guide on how you can do this on your own with software that is available free on the internet.]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;">The problem</span>: For a long time I have tried various methods to disable the worst key on the keyboard &#8211; the CAPS lock. In my opinion, it provides no real function and yet is placed in a position where it can be easily be pressed.</p>
<h3><a href="http://www.autohotkey.com/">AutoHotKey</a></h3>
<p><span style="text-decoration: underline;">Attempt 1</span>: Initially I disabled this key using an <strong><a href="http://www.autohotkey.com/">AutoHotKey</a></strong> script. But for some reason, the script would stop working and I would still find CAPS LOCK ON just when I was entering that password or something. Besides every new computer I went to needed to have AutoHotKey or a compiled .exe just for this purpose. Since I am fanatical about keeping 24&#215;7 background apps to a minimal, this was a big no no. And finally, even though I think AutoHotKey is a very useful app, I doubt it can be used as a full scale keyboard  remapper.</p>
<h3><a href="http://webpages.charter.net/krumsick/">KeyTweak</a></h3>
<p><span style="text-decoration: underline;">Attempt 2</span>: After being pushed over the edge with AutoHotKey&#8217;s incompetence in this area, my hunt for a new application continued. After some modified google search terms and fresh hope for luck, I came across <strong><a href="http://webpages.charter.net/krumsick/">KeyTweak</a></strong>, among others which included plain old <strong><a href="http://www.microsoft.com/whdc/archive/w2kscan-map.mspx">registry hacking</a></strong> and several incarnations or AutoHotKey. KeyTweak did just what I wanted. Once initial the configuration was made, it would do all the dirty registry hacing for me and I did not need any software to running in the background.</p>
<p>But now I was faced with a new problem, and this time it was caused due to personal circumstances. I had recently moved to a new country and this meant getting used to a whole new keyboard layout just for one new charecter &#8211; £. I think you know which country I am talking about. Initially I resisted by opening &#8216;Character Map&#8217; and copying the £ symbol from the table. But soon I realized that this was happening more often than not and I needed another solution.</p>
<p>Secondly even if I did give in and decide to get used to a new keyboard layout, I&#8217;d still be stuck with a US keyboard on my laptop. Changing that would be a fairly expensive affair and if I didn&#8217;t it would mean different keyboard layouts on different computers which can get very very irritating. I say this out of experience.</p>
<p>AutoHotKey &#8211; Although this could do the job, I was still against having an app running in the background just so that it could type the £ for me. But until I found a better solution, this was going to be the answer to the problem.<br />
KeyTweak &#8211; Although this could remap keys to others, somehow it was not able to find the £ character for me.</p>
<h3><a href="http://msdn.microsoft.com/en-gb/goglobal/bb964665.aspx">Microsoft Keyboard Layout Creator</a></h3>
<p><span style="text-decoration: underline;">Attempt 3</span>: So once again it was back to google. That is when I found &#8216;<strong><a href="http://msdn.microsoft.com/en-gb/goglobal/bb964665.aspx">Microsoft Keyboard Layout Creator</a></strong>&#8216;. From the depths of Microsoft&#8217;s lair lies this little known app that can do pretty much anything and everything you wanted. Basically you create a whole new keyboard layout, just like the professionals do.</p>
<p><img class="size-medium wp-image-164 alignnone" title="msklc" src="http://www.gbuffer.net/wp-content/uploads/msklc-300x146.png" alt="msklc" width="300" height="146" /></p>
<p><strong>A quick guide to using <a href="http://msdn.microsoft.com/en-gb/goglobal/bb964665.aspx">Microsoft Keyboard Layout Creator</a></strong></p>
<ol>
<li>So once you have done the obvious download and install, run the application.</li>
<li>If you are like me and want to remap change a few keys, then load your current keyboard layout by going to<br />
<strong>File </strong>&gt; <strong>Load existing keyboard</strong></li>
<li>If you are not sure which keyboard layout you are using, you can find this by going to<br />
<strong>Control Panel</strong> &gt; <strong>Regional and Language Options</strong> &gt; <strong>Languages</strong> (tab) &gt; <strong>Details</strong> (button)</li>
<li>Reconfigure the keys to the way you like it</li>
<li>Create a new installation package by going to<br />
<strong>Project</strong> &gt; <strong>Build DLL and Setup Package<br />
</strong>Follow the instructions and create a installation package. Remember to give it a name that you can identify later.</li>
<li>Install the new layout using the installation package</li>
<li>Go to<br />
<strong>Control Panel</strong> &gt; <strong>Regional and Language Options</strong> &gt; <strong>Languages</strong> (tab) &gt; <strong>Details</strong> (button)<br />
Beside the tree view, click <strong>Add&#8230;</strong> and select the new keyboard layout that you just created.</li>
<li>Activate it by selecting the new layout from the drop down menu where is says<br />
&#8216;<strong>Default input language</strong>&#8216;<br />
Alternatively, you can switch between this layout and your old layout by enabling the language bar.</li>
</ol>
<p>I hope this guide helps you get the most out of your keyboard.</p>
<p><em>All links are verified to be valid at the time of writing this post. If any of the links in this article or anywhere else on my blog are broken, let me know via the comments and I shall do my best to fix it.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gbuffer.net/archives/163/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

