Friday, August 27, 2010

Erase an area in Paint.Net using the Paint Bucket

There might be an easier way to do this but I couldn't find it and it took me forever to work this out so I hope that it helps someone else as well.

Using the excellent and free Paint.Net image editing software I wanted to erase an area but I wanted to do it with the paint bucket so that it would would erase all the complicated edges that I couldn't get to.

Start off by selecting a small area that you're going to erase with the Rectangle Select tool and hitting the delete key. You now have a small checkered section.

Select the Color Picker tool and click in the just deleted area and this will set your color to transparent (deleted/erased).

Now click on the Paint Bucket tool and click in the area(s) that you want to erase with this tool and it will use the Paint Bucket to erase the area(s).

Please let me know if there's an easier way to do this.


Wednesday, August 25, 2010

Myers Briggs Type Indicator ENTJ Executive Fieldmarshal

I just took the Myers Briggs Type Indicator assessment and discovered that I'm an ENTJ. This is how my score pairs panned out:

E=18 & I=3

S=7 & N=15

T=28 & F=0

J=24 & P=5

Without reading any further about what an ENTJ personality type is I can only assume that we do not have a problem exposing our scores or writing about our type, otherwise I wouldn't be doing this.

In reading what wikipedia has to say about this I discovered the Keirsey Temperaments which classifies me as a Fieldmarshal. The personality page calls me The Executive. I'm now starting to feel pretty full of myself and without reading what The Executive is all about I give it to my wife to read to me.

She slows down, reads extra loud, and repeats some of the passages:

"...they are not naturally tuned in to people's feelings, and more than likely don't believe that they should tailor their judgments in consideration for people's feelings. ENTJs, like many types, have difficulty seeing things from outside their own perspective. Unlike other types, ENTJs naturally have little patience with people who do not see things the same way as the ENTJ..."

"...sentiments are very powerful to the ENTJ, although they will likely hide it from general knowledge, believing the feelings to be a weakness. Because the world of feelings and values is not where the ENTJ naturally functions, they may sometimes make value judgments and hold onto submerged emotions which are ill-founded and inappropriate, and will cause them problems..."

I read that other ENTJs include Margaret Thatcher and Bill Gates.

Wednesday, August 11, 2010

C# Script to list local users and disabled status on Windows Servers

The following script will list all local users and their disabled status on each of the windows servers that you put into the "servers" array variable. This code is written in C# and you will need to include the System.DirectoryServices assembly.

using System;
using System.DirectoryServices;

namespace ConsoleApplication1
    class Program
        static void Main(string[] args)
            string[] servers = { "ServerName1", "ServerName2", "ServerName3" };
            DirectoryEntry de = new DirectoryEntry();

            foreach (string server in servers)
                de.Path = "WinNT://" + server + ",computer";

                Console.WriteLine("Server: " + server);
                foreach (DirectoryEntry d in de.Children)
                    if (d.SchemaClassName == "User")
                        int userFlags = (int)d.Properties["UserFlags"].Value;
                        bool disabled = (userFlags & 2) == 2;
                        string name = (string)d.Properties["Name"].Value;
                        Console.WriteLine(name + " (" + disabled + ")");