Windows Server 2008 R2 takes forever to start up–60 minutes or so

by Syska 21. December 2010 23:17

So a few weeks ago I disabled Ipv6 from the Local Area Connection on my Windows Server 2008 R2. I was changing the gateway and I thought, I’m not going to use it, so I could just as well disable it.

The server is running:

  • Active Directory
  • Exchange 2010
  • TFS 2010
  • DNS
  • IIS

image

BUT I SHOULD NOT HAVE DONE THAT.

Today I decided to install some windows updates. There were about 16 of them, and one for Microsoft Exchange 2010 SP1 Rollup2 ( I think the name was ).

It took forever to install … but finally after 1 hour is was done and I reboot the machine. It took forever to boot up ( Applying computer settings ) … again 1 hour … login took about ½ hour.

I could see it answered on the IP address … so it was not frozen or anything like that. Did a little googling and found a post mentioning NOT to disable ipv6 because some part of Windows Server 2008 R2 can’t function with out it, unless you also do some register editing. Ohh My Freaking God.

image

Microsoft … I’m sending Sons of Anarchy over to do some payback. Smile

Tags:

Adding users to a TFS Project from the server.

by Syska 9. October 2010 23:20

I have a few servers running, but they are all external to me, as they are placed in a data center, so my own computer aren't joined to the domain.

  • SS-Exchange: DC, Exchange
  • SS-SQL: SQL
  • SS-IIS: IIS. FTP, TFS

This haven't been a problem before at all. So the other day one of my friends asked if I could host a TFS Project for him on my server. No problem, so I created the user in the DC, created the project and the last thing to do was just to add him to the project so he would have access to it, and then the problems started. As my own computer was not part of the domain, I could only add local users, from my own computer. I hadn't been a problem before as my user was “TFS Administrator” so I had access to all projects.

So I started binging/goggling the net, but to no avail. I was puling my hair out … ARGHH.

Then I decided to ask a question on serverfault with the title TFS 2010 - Adding users to a Team Project. Is was slow with comments in the start, but there come a few, buy they did not really help me much.

So I thought it was not possible at all, and a BIG #FAIL by Microsoft.

Then a Anthony come with an interesting comment you can read here.

So I started looking around again as I could not make his suggestion work, probably because I did something wrong since it worked for him. But when jumping around in the “Team Foundation Server Administration Console” I found what I had been looking for all the time. Not the first place to look … but here are the details needed.

image

Follow the numbers on the above picture.

image

Again, click the number in the order.

image

Follow the numbers as before.

image

The rest for here should be like a walk in the part. God darn this is a well hidden feature that its done from the “Valid Users” properties on the group. But is was here.

Tags:

Moving a table to another filegroup

by Syska 9. June 2010 16:10

So, how does one move a table to another filegroup.

Say I have the following table:

CREATE TABLE [dbo].[Tests](
    [TestID] [int] NOT NULL,
    [TestInt] [int] NOT NULL,
    [TestBigInt] [bigint] NOT NULL,
 CONSTRAINT [PK_Tests] PRIMARY KEY CLUSTERED 
(
    [TestID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

Since tables are always stored with the clustered index. Moving the clustered index, also moves the table. So if we want to move the table, we can recreate the CLUSTERED index on another storage group. Here we are moving from “PRIMARY” to “PRIMARY2”.

CREATE UNIQUE CLUSTERED INDEX PK_Tests
   ON dbo.Tests(TestID)
   WITH DROP_EXISTING
ON [PRIMARY2]

This can also be done when the table is online and is also moving the indexes. There are some performance diff if you are moving the table while its still online, so consider if its worth the extra overhead.

You can extend the relation index options with the create index command like this, to move it while its still online.

CREATE UNIQUE CLUSTERED INDEX PK_Tests
   ON dbo.Tests(TestID)
   WITH (DROP_EXISTING = ON, ONLINE = ON)
ON [PRIMARY2]

Tags: ,

MSSQL

Working with .NET Micro Framework and Fonts

by Syska 26. May 2010 18:39

So, for a smaller school project I’m going to make a remote controlled twitter client showing off the latest tweets from you the ones you are following or just from a search. So I wanted to make my own font and what a hell that was. Crappy command line tool … the font size if given as a parameter called “height”.

To save memory and space on target, Microsoft is using a new font format, instead of TTF, called tinyfont.

TFConvert overview
TFConvert reference

So I was reading Apress Expert .NET Micro Framework and they linked to this excellent Tiny Font Tool GUI, which makes it a lot easier to make fonts for your application. Instead of using the default fonts.

Now you got all the tools you need to create your own fonts. Hope this saves you some time.

happy I’m just so happy now, this saved my day

Tags:

Windows Mobile 6.5 – HTC HD2

by Syska 20. May 2010 01:16

htc-hd2I just got a HTC HD2. Nice piece of hardware when one is used to this wonder of a phone Nokia 1208:

nokia-1208-00  

But I ran into some problems or lets just call them limitations.

1. The wireless

I needed it to logon to a wireless network using WPA-Enterprise, TKIP & PEAP. It kept saying that my certificate was not valid … and it was right, but there were no ways of turning this off. Then I searched google and found this.

You need to edit this registry key and then it works:

\HKLM\Comm\EAP\Extension\25\ValidateServerCert=dword:00000000

ScreenShot12. The start page

The start page is limited to 3 icons per line and that's awful, what the hell were they thinking when making this. But after installing a little program I get 5 icons per line.

There are links to the cab files for 3, 4, 5 and 6 icons per line. The files names should be self explaining.

 

 

ScreenShot2

3. Home page

The Home tab is ARGHH and crappy, this little cab file will do wonders with it and you can edit it, dran’n’drop icons … you will love it. I know i do.

ScreenShot3Download HomeTab 1.7.1 - Home

Download CHTEditor - Home

Video of Co0kie's Home Tab Mod 1.7 for HTC Sense 2.5

Its required to signup to download but its worth the time.

 

 

 

 

 

 

 

 

ShakeAndSave4. Shake And Save

It's a print screen program for windows mobile. Used to make this blog post.

Download ShakeAndSave

Tips

1. keyboard

Just like the iPhone, if you double tap the space bar on the keyboard after a letter, you will enter a period (full stop) AND a space automatically.

2. Regdb Editor and other utilities

Resco explorer and lots of other great stuff. Try it out, its real nice.

Tags:

IsNullOrWhiteSpace

by Syska 22. April 2010 00:39

Instead of doing

   1: if(s == null || s.Length == 0)
   2:     return;

I normally do

   1: if(string.IsNullOrEmpty(s))
   2:     return;

So, as I would normally do, I started typing: string.Is and intellisense showed me an nice addition to the normal string class in .NET 4.0 … NICE :-).

   1: if (string.IsNullOrWhiteSpace(s))
   2:     return;

Its the little things in life that counts, this saved my evening after messing around trying to move all my projects from SVN to TFS 2010.

Tags:

Starting Cassini ASP.NET App on selected folder

by Syska 16. April 2010 01:57

I get some Web apps in compressed zip files. While its easy to unzip and map it to my local IIS server, its still a very doll job to do over and over again. So I was searching the web and came across ASP.NET 4 Web Server Here Shell Extension by Phil Haack.

A very simple shell extension starting the Cassini webserver on the selected folder:

image

And then just point you favorite browser at: http://localhost:8081/ or what ever port you used in the reg file.

I have attached both reg files for 32 & 64 bit.

32bit

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VS2010 WebServer]
@="ASP.NET 4 Web Server Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VS2010 WebServer\command]
@="C:\\Program Files\\Common Files\\microsoft shared\\DevServer\\10.0\\Webdev.WebServer40.exe /port:8081 /path:\"%1\""

64bit

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VS2010 WebServer]
@="ASP.NET 4 Web Server Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VS2010 WebServer\command]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\DevServer\\10.0\\Webdev.WebServer40.exe /port:8081 /path:\"%1\""

Yes, the Formating is very bad, so to avoid any copy/paste errors, download the attached zip file.

Regs.zip (758.00 bytes)

Tags: , , , ,

ASP.NET MVC 2 bug, misleading exception message

by Syska 29. March 2010 00:11

Today I was making some refactoring to my site made in ASP.NET MVC 2. Created a complex class on my  model, which should be passed to a RenderPartial like this:

<% Html.RenderPartial(“name”, Model.ComplexClass) %>

Corrected the type in the partial view I was expecting but got an odd error I think …

The model item passed into the dictionary is of type 'Model.MyModel', but this dictionary requires a model item of type 'Model.ComplexClass'.

So I started to look around, but got even more confused … recompiled, open and closed Visual Studio 2008, until I found the error. The reference to the ComplexClass was null. I’m not sure why it thinks it got a type of the model instead of the my ComplexClass.

This got to be a bug or something to do with the Reflection methods used to determine the type of the class passed to the PartialRender when trying to cast it and that failed. So when throwing the Exception, the information could be wrong … only guesses.

Update:
Searched the internet, and one person suggested parsing the values to the "ViewDateDictionary" ... but still not a good workaround here.

Tags: , ,

Find duplicate rows in MS SQL

by Syska 17. March 2010 17:51

So, the other day I was reading T-SQL: Why “It Depends” and in the comments section a guys suggested using the “PARTITION BY” in the OVER clause.

I thought was the heck does that do … so i searched the web for an answer … and wow … what a great way to find duplicate post … and possible also a lot of other things it can be used for that I haven’t thought about.

To the code …

WITH Data AS
(
	SELECT 
	ROW_NUMBER() OVER ( PARTITION BY CID ORDER BY Added DESC) AS DupeNumber
	,CID, Added
FROM Servers
)
SELECT * FROM Data Where DupeNumber >= 2

This will check for dupes on the CID column … and then select all the rows where DupeNumber is over or equal to 2. You could then instead of select it … you could delete it.

Fancy way … I like it.

Tags: , , ,

windows 7

Tcpdump – The ultimate tool for traffic analysis

by Syska 9. March 2010 14:50

Hello, so the other day I say that out external IP address was black listed on some black list … I used:
http://www.dnsbl.info/dnsbl-database-check.php
http://rbls.org/
http://whatismyipaddress.com/staticpages/index.php/is-my-ip-address-blacklisted

They are all similar, but maybe they show different result, if there database are outdated or the site could be down. Always a good idea to control the IP address against more sites.

So … we were black listed … but why. Back to the console on the firewall.

eth0 is my internal interface on the 172.17.4.0 network.

tcpdump -i eth1 net 172.17.4
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
08:23:01.219395 IP x.x.x.x.dynamic.altibox.net.63486 > 172.17.4.251.distinct32: . ack 142967821 win 256
08:23:01.335626 IP 172.17.4.113.53814 > 93.152.158.87.47834: . 272803351:272804803(1452) ack 3427659943 win 16139 08:23:01.871096 IP pool-x-x-x-x.chi01.dsl-w.verizon.net.50129 > 172.17.4.251.distinct32: . ack 3979841491 win 62356 <nop,nop,timestamp 14764517 2569468>

This showed way to much information … back to reading the “man” pages for tcpdump. Then I saw that I could use logical operators and bit masking … now its getting fun. Also possible to look in the ip, tcp or udp package.

The DHCP server here only serves address from 100 and up … and as there are SMTP servers below that, we need to filter them out … looking at Figure 1, the source address is the 12byte and the next 4. We got the net address already …not we need to filter on the 4 octet.

tcpdump -i eth1 net 172.17.4 and \(ip[15] \>= 100\)

We can filter the port in 3 ways … either look at the tcp package or use “port 25” or “port smtp” in the name are located in the /etc/services file.

Doing the first … and looking at figure 2, we can see that we need read 2 bytes and have an offset of 2. Like “tpc[offset:bytes] = 25” and append it to the command we end up with the following.

tcpdump -i eth1 net 172.17.4 and \(ip[15] \>= 100\) and tcp[2:2] = 25
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes

This gives endless options … you can detect anything. Look in the data package … I’m amazed, this was not the first time using it, but probably the first time I understand all the options and possibilities it gives you.

Happy tcpdump’ing … :-)

Figure 1. IPv4 header

MJB-IP-Header-800x576

Figure 2. TCP header

MJB-TCP-Header-800x564

Tags: , , ,

Unix/Linux

About the brain

Mikael SyskaMikael Syska

Student at the Engineering College of Aarhus.

Microsoft Student Partner ( MSP )

On this blog I will primarily write about .NET, MSSQL & projects I'm working on ... and of course there will some off topic posts :-)