HowTo: TrueCrypt automount (system-) favorite devices

This tutorial shows how to mount a (system-) favorite volume on system boot.

To automount a volume on system boot your system partiton must be encrypted. I don’t wanna tell you how to do it.

In this case I want to protect the second volume (“Datenträger 1”) with TrueCrypt. This volume contains no data.

Ensure that the volume is an MBR volume (don’t use GPT). Using GPT TrueCrypt can’t recognize this volume an system boot and would not mount it.

image

 

Create a new partition on this volume. Ensure that you don’t assign a drive letter to the new partition:

image

Next step in volume creation wizard:

image

Now we have a new partition:

image

Open your TrueCrypt Software:

image

In the TrueCrypt menu select “Volumes”. The select “Create new volume”.

Then select “Encrypt a non-system partition/drive”:

image

Click “Next >”.

Select “Standard TrueCrypt volume”:

image

Click “Next >”.

In the next wizard page please click on “Select Device…”:

image

A new dialog appears. Here you have to select the first partition on Harddisk 1. Don’t select the whole harddisk!

image

Click “OK”.

image

Click “Next >”.

Select “Create encrypted volume and format it”. Thats the fastest way. In case you have data on it, you should use the second option.

image

Click “Next >”.

image

Click “Next >” twice.

Your password have to be the same like the system partition password!

image

Click “Next >”.

If you want to store files larger than 4 gigabyte in this volume select “Yes”:

image

Click “Next >”.

Move the mouse as randomly as possible in this window.

image

Click “Format”.

Wait until the volume is created:

image

To be continued…

wget loop example

This example shows how to call wget ten times in a loop.

#!/bin/bash

for i in $(seq 10)
do
    ec=1
    while ((ec != 0))
    do
        wget_output=$(wget –retry-connrefused –output-document=/home/user/Downloads/$i.html –tries=30 http://www.test.com/?page=$i)
        if [ $? -ne 0 ]; then
            ec=1   
        else
            ec=0
        fi       
    done
done

Remove an assembly from the global assembly cache (GAC)

You can manage your global assemblies with the gacutil.exe which comes with Microsoft SDK. You can find this tool for instance in folder "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\".

This is an example about removing one assembly:

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe" /u Assembly.To.Uninstall

Outputdebugstring in .NET / Visual Studio / C# / WPF

In my old Delphi developer days I used OutputDebugString() to track problems or elapsed time.
In .NET you can use the System.Diagnostics.Debug class.

You have to run the project in debug mode.

Code Snippet
  1. private void ReadFirstFile(string filename1)
  2. {
  3.     StatusText = "Reading file 1";
  4.     Stopwatch watch = new Stopwatch();
  5.     watch.Start();
  6.     using (StreamReader file1 = new StreamReader(filename1))
  7.     {
  8.         while (!file1.EndOfStream)
  9.         {
  10.             sc1.Add(file1.ReadLine());
  11.         }
  12.     }
  13.     watch.Stop();
  14.     System.Diagnostics.Debug.WriteLine("Time spent reading file 1: " + watch.Elapsed);
  15. }

MSDN link: http://msdn.microsoft.com/en-us/library/6x31ezs1.aspx