Fixing the gigantic header on Twenty Eleven WordPress theme

Out of the box, the 2011 WordPress default theme is very visual… but it also requires a heavy bit of scrolling to reach the content.

Have a look at a sample:

image

That banner image is 1000 x 288 pixels.

The first step I took toward reigning in this space consumption was to use a shorter banner image – mine is 1000 x 170:

hd_header2
(It is a macro photo of the inside of an old 2gb SCSI hard drive)

This helps, but now the banner is about the same height as the white space above.

The first step toward fixing this comes from a blog post here: http://www.throwingabrick.com/wordpress/customizing-twenty-eleven-theme-banner.html

Essentially, you customize the css for the site (which can be done without creating a fullblown child template by clicking the “Edit CSS” link from the Manage Themes page. You then paste this in:

#site-title {
position: absolute;
left: 7.2%;
top: 0.125em;
}
#site-description {
position: absolute;
left: 7.6%;
top: 6.625em;
color:white;
}
#branding #searchform {
background-color:white;
}
}

Note: I modified Roy’s code a little to force the search box to have a white background, and the description text to be white.

You can change the Title text from the Themes Page –> Header.

 

With the applied changes, my header now looks like so:

image

Much shorter.

AT&T is having a DNS outage 8/15/2012

Noticing that you cannot access quite a few websites? Emails bouncing? Is your site traffic lower than it should be?

Is your domain’s DNS hosted with AT&T?

As of 12:21 pm EDT (we first noticed at 11:20 EDT) AT&T is experiencing a massive DNS outage.

 

This morning we started getting reports from users that inbound emails were bouncing. I soon discovered that I could not resolve our MX records externally, then that I could not even ping our website.

According to the Twitterverse AT&T is having a massive DNS outage presently. Our AT&T rep said it might be a DOS attack, and there was no estimate as to when it will be fixed.

 

UPDATE: 12:25 PM – (Glad I said something)

No sooner did I post this than our AT&T hosted DNS started responding again.

 

UPDATE 12:46 PM

Looks like it was only up long enough for my test server to get a cache – the authoritative DNS is still unresponsive.

 

UPDATE 2:20 PM

AT&T has informed some customers (including us) that the issue is resolved. Testing our site using the free Uptrends availability tool shows that it is somewhat responsive… however inbound email is still not working reliably and http://www.mxtoolbox.com says our DNS servers are still timing out.

According to a comment on this post, this outage started at 9:30 am, and it is still causing problems for us 6 hours later.

Miyota 1M12 stem removal

I was trying to remove the movement from a Hugo Boss watch with a twist setting stem. The movement is a Miyota 1M12 (helps to be near-sighted sometimes) and while other have asked, I could find no explanation for how to remove the stem.

Turns out, if you look reeeeealy close, you might get lucky and see a tiny arrow pointing to a tiny hole. You must push in this hole (with the stem fully depressed) then pull on the stem and it comes right out.

 

Visual Aides – red arrow points to the stem release hole.

image

Close-up of the hole

image

 

Make sure the crown is pressed in, then use a pin to push down in the hole, and the stem should just be loose. Don’t push too hard, and don’t hold me responsible if you break your watch!

System Center 2012 RC–And the verdict is

If you didn’t like System Center 2010, you won’t like System Center 2012 – simple as that.

The System Center suite of products seems to be designed for large organizations with very large data centers and very large numbers of users. Large enough to justify the steep hardware, license, and manpower requirements to run SC2012. (I should point out that this is nothing new – several people have told me that System Center requires a team to manage it)

System Center 2012 is indeed very powerful and flexible, but that comes at a cost – it is also very complex. While each component has a similar-looking “user friendly” interface, a quick browse through the documentation sets any illusions of simplicity aside.

 

Lets take System Center Service Manager as an example. This component provides helpdesk functionality, as well as the ability to automate / document / standardize IS processes. It sounds like exactly what we need. Now have a look at the documentation:

Service Manager

Here are the major sections of this massive document collection

  • Planning Guide
  • Deployment Guide
  • Administrator’s Guide
  • Operations Guide
  • Authoring Guide
  • Disaster Recovery Guide

So I just installed the thing and I want to get started. Where do I go? As far as I can tell, there is no “Getting Started.” The documentation is broken up so that the Installation team has a set of docs, the administrators have a set of docs, the Operators have a set of docs, etc, etc. This is not bad per se – it is just bad if you don’t have a lot of time, and you don’t have multiple teams (much less even one team) to manage the thing.

Google’s privacy policy changes are no big deal

The internets are in a tizzy – Google recently announced major changes to their privacy policy that allows for the sharing of data between Google owned services. People are claiming this paves the way for the privacy apocalypse. Pretty soon it will start raining targeted ads, as humanity drowns in a giant lake of fire…

Don’t believe me? Here’s some headlines:

Google announces privacy changes across products; users can’t opt out

Google Privacy Policy Update Challenged by Lawmakers

Google privacy policy unleashes criticism from regulators

How to close your Google Account

Not to mention the fear inducing coverage by major media outlets – Fox News and NPR alike.

 

There are a couple problems with this hype.

  1. Google has gone to great lengths to be sure people are aware of the changes, and to make them understandable.

    Every couple months, Apple surreptitiously updates their terms of service and privacy policies – requires you to agree to the changes, and expect you to sift through pages of legalese to see what changed . Quite often these changes are indeed far reaching, like banning access to competing technologies so Apple can take a totally unneeded 30% cut, or Apple essentially owning your iBooks content. But where is the outrage? It’s Apple. Evil is in their nature.

    Instead Google does it right – I personally read about the changes from Google before hearing about it on the news. They have a notice on the search page, a popup in Gmail, in Youtube…
    Some examples:
    image
    image 
    And the page itself is written for human consumption, not lawyers:
    image

  2. If Google wasn’t sharing your data between services, they were the only ones.

    The other day, I was searching for some IT Helpdesk software. One of the products I looked at was HEAT. Ever since then, I have been seeing ads for Heat HelpDesk almost everywhere I go on the web. The other day I was looking for deals at Disney World, and wouldn’t you know it, I start seeing ads to that effect… everywhere I go. Yeah it’s creepy. What’s even creepier is that I don’t know who has this information or where they got it, and I sure don’t know anything about their privacy policy. Which leads to 3
  3. Google Dashboard lets you take control of the data stored about you

    Google dashboard is a single destination to review your information from all Google services. The Web History is a big one – perhaps the biggest. Surprise surprise, Google keeps a record of everything you search for while logged in, and sometimes even site visits. If you searched for something you would rather there be no record of (that rash on your leg, for example), you can delete individual entries, or you can clean it out altogether. You can also turn it off.

  4. Integration requires data sharing

    In order for Google to improve the integration between services – such as enabling unified messaging between Google Voice and Gmail – they must freely share data between the two services. Obviously a major motivation for such sharing would be targeting advertisements, but as I mentioned in #2 that has become the standard everywhere else.

 

Google has been doing things lately that I would argue border on evil (contrary to the “Don’t be evil” motto) – closing services that aren’t a huge success but that people still rely on, not releasing Android source code as promised, muscling out competing social networks in search results…

This policy change is not evil, it nothing to be “outraged” about, and they are doing it right. The sky is not falling; the world is not coming to an end.

Using Process related API calls in VB.NET

I’m working on an app that will monitor the number of GDI Objects of another process (in this case, the spooler)

To do this in VB.NET requires an API call to GetGuiResources. While testing, I was using Process.GetProcesses to get a list of all the available processes, passed the handle of each process to the API function, and writing the result to a textbox.

Problem was, all process that I did not own throw security errors, even when I set the app to run with elevated privs. The internet once again failed me, and I stumbled across the solution while browsing the system.diagnostics.process documentation on MSDN.

The solution is to call Process.EnterDebugMode() before getting your process list and calling the API, then calling Process.LeaveDebugMode() when you are done.

MSDN EnterDebugMode Documentation

Here is an example. remember to run with elevate privs, and create a multiline textbox called txtOut.

Public Class Form1
  Declare Function GetGuiResources Lib "user32" (ByVal hProcess As Long, ByVal uiFlags As Long) As Long
  ' uiFlags: 0 - Count of GDI objects
  ' uiFlags: 1 - Count of USER objects

  Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
    Dim procList As Process()

    Dim TYPE_GDI As UInteger = 0

    Process.EnterDebugMode()
    procList = Process.GetProcesses

    For Each proc As Process In procList
      Dim objCnt As Long
      Try
        objCnt = GetGuiResources(proc.Handle, TYPE_GDI)
      Catch ex As Exception
        objCnt = -1
      End Try

      txOut.AppendText(proc.ProcessName & vbTab & "GDI: " & objCnt.ToString & vbNewLine)
    Next proc

    Process.LeaveDebugMode()


  End Sub
End Class

Getting Active Directory info for the current user in VB.net in 2 lines

Don’t listen to the internet – getting account information from active directory for the current user is simple and easy in Visual Basic .NET – particularly if you are using Framework 3.5 or higher

Note: if you are using ASP.NET, there is a different way to do it – see the update below

You don’t need to do any stinking LDAP queries, or lookups, or credential passings – it’s all made simple using System.DirectoryServices.AccountManagement. Observe.

First, go to the references tab in project properties, click add reference, and find “System.DirectoryServices.AccountManagement” – no need to add “System.DirectoryServices”.

Now, in your application, add the following lines:

Dim currentADUser As System.DirectoryServices.AccountManagement.UserPrincipal
currentADUser = System.DirectoryServices.AccountManagement.UserPrincipal.Current

(It’s even simpler if you import the namespace)

Poof. That’s it! You are done.

currentADUser is a strongly typed object containing attributes for most of the active directory properties you need = such as display name, email address, primary group membership, exchange mailbox info, etc, etc.

Say you want to get the current user’s email address. You could do it like so (after the previous code):

Dim userEmail as string = currentADUser.EmailAddress

That’s it. 1 additional line.

How about a concrete example – here is the problem I wanted to solve. Send an email message from the current user for error reporting – Make sure to change the To: email address, and the smtp server name, and this should be a drop-in solution:

  Private Sub report_error(ByVal errorMessage As String)
    Dim currentADUser As System.DirectoryServices.AccountManagement.UserPrincipal
    currentADUser = System.DirectoryServices.AccountManagement.UserPrincipal.Current
    Dim mailClient As New System.Net.Mail.SmtpClient("smtpserver.company.local")
    mailClient.Send(currentADUser.DisplayName & " <" & currentADUser.EmailAddress & ">", _
                    "notifications@company.com", _
                    "ERROR REPORT: Application error for " & currentADUser.DisplayName, _
                    errorMessage)
  End Sub

Hope this helps!

Update – ASP.NET
The “better” way to get this info in an ASP page is to take advantage of the “User” object available to the ASP.NET Page class. User.Ientity can be cast to a System.Security.Principal.WindowsIdentity, giving you access to the User attribute (yes, User.Identity.User essentially) which is the domain SID. You use this SID to lookup the user in AD.

You check the User.Identity.IsAuthenticated to make sure that IIS has taken care of verifying the identity of the user.

Imports System.Security.Principal
Imports System.DirectoryServices.AccountManagement

Public Class WebForm1
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not User.Identity.IsAuthenticated Then
            Throw New InvalidOperationException("Specified user is not authenticated")
        End If

        If Not User.Identity.Name.StartsWith("DOMAIN\") Then
            Throw New InvalidOperationException("Specified user is not member of Domain")
        End If

        Dim userSid As String = CType(User.Identity, WindowsIdentity).User.Value

        Dim adContext As PrincipalContext = New PrincipalContext(ContextType.Domain, "Domain.local")

        Dim adUser As UserPrincipal = UserPrincipal.FindByIdentity(adContext, IdentityType.Sid, userSid)

        emaillbl.Text = adUser.EmailAddress



    End Sub

End Class

This example is c# (I switched…) – hopefully you can translate?

using System.Security.Principal;
using System.DirectoryServices.AccountManagement;
 ...
 
if (!User.Identity.IsAuthenticated) throw new InvalidOperationException("Specified user is not authenticated");
 if (!User.Identity.Name.StartsWith("Domain\\")) throw new InvalidOperationException("Specified user is not member of Domain");
 
string userSid = ((WindowsIdentity)User.Identity).User.Value;
 PrincipalContext adContext = new PrincipalContext(ContextType.Domain, "Domain.local");
 UserPrincipal adUser = UserPrincipal.FindByIdentity(adContext, IdentityType.Sid, userSid);
 ...
 

Virgin Mobile Broadband2go installer hangs

If you have purchased a Virgin Mobile Broadband2Go pay as you go aircard (actually a novatell wireless ovation MC760), and find that the driver installation hangs on Windows 7, you will also find that the internet is little help.

The solution is to disable USB Selective Suspending until Virgin Mobile releases a driver version later than 2.02.04.002

http://shup.com/oqo/OQO%20Drivers/02+/2009.01.15/WWAN/Drivers/Novatel/Driver%20Installer%20Release%20Notes%20v2.02.04.002.pdf

Here is the link to the release notes for the OQO drivers – which are newer that either the Virgin Mobile or Novatel generic drivers.

You disable USB selective suspend from the advanced power settings screen.

Installing VMware ESXi 4 vSphere from USB Drive

If you need to install Vmware ESXi (or possibly ESX) 4 on a server without an optical drive – that is, install FROM a USB drive (not “to”), here is how to do in in Windows:

1. Download and extract syslinux: http://syslinux.zytor.com/wiki/index.php/Download

You will want syslinux-3.XX.zip – the latest at time of writing is syslinux-3.83.zip and it works fine.

Extract it somewhere – lets say c:\syslinux

2. Insert the USB drive if you have not already, make sure it is formatted fat32, and make note of the drive letter. For our example, we will use k:.

3. Open a command prompt. (In windows Vista or 7, make sure to Run as Administrator)
Change directory to the place you extracted syslinux \ win32.

cd c:\syslinux\win32
syslinux -m -f -a {drive}:
where {drive} is the drive letter of the USB drive.

4. Extract or copy the contents of the ESX iso image to the USB drive (you can use 7zip or winrar – no need to burn it)

5. rename ISOLINUX.CFG to SYSLINUX.CFG

That should do it.

This is based on info from the following sites – I didn’t really change anything except the version, so if this doesn’t work, they these:
http://www.squishnet.com/?p=17
http://www.vm-help.com/esx40i/ESXi_USB_install.php