Tuesday, November 26, 2013

Watching a VM Sleep

I sometimes find myself putting a VM in "Save" mode or "Sleep" mode. Invariably, I'm curious as to how long these VMs end up being down- for example, when a Linux VM is hosted on Hyper-V and backed up with DPM, the VM is paused for a few seconds while a snapshot is taken. I've seen these VMs take between 20 and 55 seconds to go down and come back up. How do I know how long they were down?

while true; do date | tee -a ~/date.txt; sleep 1; done

Enabling a Self-Signed Certificate on Apache2 on Debian 7.1 Squeeze

It's always useful to configure SSL whenever you make a web site that needs to be in any way secure. And let's face it; if it's something you yourself are setting up, an SSL certificate of any kind is fine. It doesn't need to be expensive or verified by a "trusted" SSL provider.

And besides, once you have everything working with a self-signed certificate, making a "real" certificate is as easy as making a request, fulfilling it, and putting the files in the right places.

How I enabled a self-signed certificate:

a2ensite default-ssl
a2enmod ssl
service apache2 restart

Monday, May 20, 2013

Fixing AnyConnect Problems

I was connected to my AnyConnect SSL VPN a few days ago when our data center had an outage. When my connection was available again, my VPN would no longer log in. AnyConnect simply complains that:

The VPN client driver has encountered an error when connecting through Cisco AnyConnect Client.

 So far, no troubleshooting steps that I've found anywhere online have helped except this one:

http://www.cisco.com/en/US/products/ps6120/products_tech_note09186a00809b4754.shtml#e21

And I quote:

This issue can be resolved when you uninstall the AnyConnect Client, then remove the anti-virus software. After this, re-install the AnyConnect Client. If this resolution does not work, then reformat the PC in order to fix this issue.

I don't have antivirus software installed. Yes, I ended up *reformatting my PC*. And this is the third time in as many years that I've had to do it.

Wednesday, February 8, 2012

How To Time Things

I’ve found myself in several situations lately where I have VMs being paused for various reasons. Since this means there will be some measure of downtime, people often ask how much downtime they can expect.

How do you figure that out?

I use a script that writes the current date / time once every second to a file. I start running this script just before pausing the VM, then take a look at the file once the VM is back online to see how big the time gap is.

Here is my script for Linux:

while true; do date >> datelist; sleep 1; done

And for Windows, I create a BATch file:

@echo off
:again
date /t >> datelist
time /t >> datelist
goto again

You could easily adapt these simple scripts to time a lot of different things by combining them with ping, checking the status of another file, starting / killing this script via another script to see how long something runs, or just running these scripts as-is to eyeball a timing on something.

Sunday, December 11, 2011

How To Make a Domain Controller Authoritative

What happens when you want to recover a large amount of accidentally deleted AD data but all the backups you have to recover from are full system / bare metal backups? No problem.

You might be worried that restoring a single DC will result in the restored DC getting the latest data from other DCs, and in doing so, replicating the deletion of the data you want to recover. Here’s how to get around that.

1) Use whatever backup you have of a DC from a point in time when the data in AD was good (or at least better than it is now that you are missing data).

2) Start the recovered machine without network access.

3) Log in, fire up a CMD prompt and type: ntdsutil

4) Type: active instance ntds

5) Type: authoritative restore

6) Type: restore subtree <container DN>

For example, I typed: restore subtree “dc=domain,dc=com”

7) Re-enable network access.

8) Watch as all AD data for the whole tree is pushed to other domain controllers.

Special thanks to my man Jeff Barnett for figuring this out!

Wednesday, November 23, 2011

Error Message Instead of List Content After Upgrading SharePoint 2010 to Service Pack 1

After upgrading a SharePoint 2010 installation to Service Pack 1, my public-facing site, to which Anonymous users should have full access to the Entire Web Site, started showing the following message anywhere it should have been showing content pulled from lists:

Access denied. You do not have permission to perform this action or access this resource.

We literally fixed this by logging in, going to Site Permissions and editing Anonymous Access:

image

Don’t change anything. Click OK.

Voila, everything worked again.

In our case, we had custom permissions applied on several other lists and pages. To fix these, we simply went to the affected page(s) and clicked “Edit Page.” This simple action fixed our issues and the site displayed correctly thereafter.

Saturday, October 8, 2011

Configuring a Dell PowerConnect 28xx Switch

I recently came into possession of a pair of PowerConnect 2824 switches. These are 24 port gigabit switches that support either managed or unmanaged use, jumbo frames, up to 64 VLANs and up to 4 Link Aggregation Groups. In spite of all their excellent functionality, they’re quite cheap, too, costing under $300 last I looked.
The pair I was given were both configured for unmanaged use. This means that they act as layer 2 only switches. Port multipliers, if you will. I wanted to specify some VLANs and use the jumbo frames feature for my iSCSI configuration. To that end, I needed to configure these switches to be managed.
However, the manual is down right lacking in information about how to do this. I called Dell tech support and got the instructions on how to change these switches to managed mode and I’m putting the instructions here so that you don’t have to call support:
1) Connect a machine to the switch.
2) Configure the connected NIC on said machine to use an IP address in the 192.168.2.0/24 subnet. E.g., 192.168.2.105.
3) Press the “managed” button on the front of the switch for 10 seconds. This is a pinhole button so ensure you have a paperclip or the like ready for this step.
4) Upon releasing the button, the “Managed” light should turn on.
5) Fire up a web browser and navigate to http://192.168.2.1. This should connect you to the switch’s management interface.
6) Enter the username as “admin”. Leave the password blank.
7) On the next screen, don’t change anything; just click “OK” or “Apply” or whatever it is.
8) The switch will reboot and it will now be ready to configure as a managed switch!
I tested this on a PowerConnect 2824. However, as Dell’s documentation for this switch covers everything in the 28xx series, I imagine these instructions should work for any switch in the series.