Monday, January 18, 2016

Fix for Unable to verify GPG Signatures

I've used GPG in some capacity for many years, but not enough to ever really be comfortable with it at the command line. Recently, I've had a rough time getting trust configured properly so I could  verify some file signatures, and found the solution to an issue that has haunted me for some time.

After moving to a new PC and importing my existing keys, even after verifying fingerprints, trusting, and signing the public key I needed to verify a signature with, GPG just would not verify signatures. Below I'm trying to verify the signature of the latest PuTTY release as of this post:

C:\test>gpg --verify putty.zip.gpg putty.zip
gpg: Signature made 11/07/15 05:28:00 Eastern Standard Time using RSA key ID B43434E4
gpg: Good signature from "PuTTY Releases " [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 0054 DDAA 8ADA 15D2 768A  6DE7 9DFE 2648 B434 34E4

But I trust it! I signed it! I tediously verified the fingerprint from multiple sources! Why do you still not know it belongs to them?!

  A look at gpg --list-keys has the answer:

C:\test>gpg --list-keys
C:/Users/******/AppData/Roaming/gnupg/pubring.gpg
----------------------------------------------------
pub   2048R/D34D1337 2011-09-21 [expires: 2018-06-13]
uid       [ unknown] Joshua McKinnon

pub   4096R/29C17558 2013-12-29
uid       [ unknown] Steffen Land (Apache Lounge)
sub   4096R/BC11F6FE 2013-12-29

pub   2048R/B43434E4 2015-08-31 [expires: 2018-08-30]
uid       [ unknown] PuTTY Releases
 ...
That's not right! My own key is unknown, even though it's the first key I imported, has a matching private key and everything. I was so focused on the other certs I wanted to trust, I didn't see that GPG didn't even trust my _OWN_ cert. The chain of unknown -> something else stays unknown. Now, I don't know why this happened (aside from a possible BUG), but the circumstances have occurred on 2 or more computers. I manage and import my certificates with Kleopatra on Windows, so it's possible that when you re-import your existing private key on a new computer, it does not set trust even though it should - it certainly appears this way, but I have not tried to reproduce this again yet. Creating a new key does set trust of that key to ultimate, as expected. (If you don't trust yourself, you've got bigger problems ;)

Let's fix it:

C:\test>gpg --edit-key
gpg (GnuPG) 2.0.26; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Secret key is available.

pub  2048R/D34D1337 created: 2011-09-21  expires: 2018-06-13  usage: SCE
                     trust: unknown       validity: unknown
[ unknown] (1). Joshua McKinnon

gpg> trust
pub  2048R/D34D1337 created: 2011-09-21  expires: 2018-06-13  usage: SCE
                     trust: unknown       validity: unknown
[ unknown] (1). Joshua McKinnon

Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)

  1 = I don't know or won't say
  2 = I do NOT trust
  3 = I trust marginally
  4 = I trust fully
  5 = I trust ultimately
  m = back to the main menu

Your decision? 5
Do you really want to set this key to ultimate trust? (y/N) y

Now let's look at it again:

C:\test>gpg --verify putty.zip.gpg putty.zip
gpg: Signature made 11/07/15 05:28:00 Eastern Standard Time using RSA key ID B43434E4
gpg: Good signature from "PuTTY Releases " [full]

That's more like it. Now that my own key is trusted, the chain of trust from me verifying and signing other certificates is properly passed down. Now I can extract and begin using this version of PuTTY.

This could also be fixed in the Kleopatra GUI, and in fact, if you right click your own Certificate and choose "Change Owner Trust", in the situation I found myself in, _nothing_ was select, despite the only valid option being "This is my certificate". That's what I noticed before I saw the "unknown" in my own cert at the command line, which I had glazed over initially. This probably re-affirms that this is a bug.


Hopefully this post helps at least 1 person figure out how to properly verify a GPG signature...even if that person is a just a future version of me.

Tuesday, March 4, 2014

Enabling Remote Volume Management with PowerShell

I run a build server that's fully virtualized using Microsoft Hyper-V Server 2012 Standalone, and I'm in the process of upgrading to Hyper-V 2012 R2.

One step I've always had to do is to enable Remote Volume Management. I could probably do this in AD, but old habits die hard.

I went into "netsh advfirewall" on the new server and it gave me a message:

In future versions of Windows, Microsoft might remove the Netsh functionality
for Windows Firewall with Advanced Security.

Microsoft recommends that you transition to Windows PowerShell if you currently
use netsh to configure and manage Windows Firewall with Advanced Security.

Type Get-Command -Module NetSecurity at the Windows PowerShell prompt to view
a list of commands to manage Windows Firewall with Advanced Security.

Visit http://go.microsoft.com/fwlink/?LinkId=217627 for additional information
about PowerShell commands for Windows Firewall with Advanced Security.

Certainly, there must be a way to do this with PowerShell.

My translation of the trusty:
netsh firewall advfirewall set rule group="Remote Volume Management" new enable=yes

Is the following:

Get-NetFirewallRule -DisplayGroup "Remote Volume Management" | Set-NetFirewallRule -Enabled True


Wednesday, November 6, 2013

PowerShell script for finding iOS 6.1 devices using ActiveSync your Exchange server

NOTE: I originally wrote but never finished this entry back in February, when iOS 6.1 came out.

iOS 6.1, released earlier this month (in February) (and also 6.1.1), had a fairly severe bug in how it interacts with Exchange 2010 SP1 and later.This is documented by both Apple and Microsoft.This caused Exchange logs to grow very quickly, as well as additional CPU load and memory use.

My Exchange deployment is fairly small, 75 users.Even still, I took a look and was surprised just how fast our logs were growing. About 1/2 GB per hour with only 10-15 devices on iOS 6.1, and I'm not even sure all of them were causing the problem.

I decided to take this opportunity to see if I could use PowerShell to find a list of users with iOS devices running version 6.1. A quick search, and some simple filtering, and here's a one-liner that can be run from the Exchange Management Shell (EMS) in Exchange 2010. Note this cmdlet will not work in Exchange 2007.

Get-ActiveSyncDevice | Where-Object -FilterScript {$_.DeviceUserAgent -like "Apple*" -and $_.DeviceOS -like
"iOS 6.1 *"} | Sort-Object UserDisplayName | Format-Table DeviceType,DeviceOS,FriendlyName,UserDisplayName -AutoSize



I chose to sort by UserDisplayName, the best user-identifying field I could find on an Object returned by Get-ActiveSyncDevice, since some users have an iPad and iPhone. I'm sure someone with better PowerShell-fu could pipe this to something that would spit out a list of email addresses, or maybe even send out an email to upgrade.

This allowed me to inform only those users causing the problem, rather than the whole company. It also enabled me to easily verify once everyone had updated.

PowerShell rocks. Haven't used it? I strongly suggest checking out the following on Microsoft Virtual Academy:
- Getting Started With PowerShell 3.0 Jump Start
- Advanced Tools Scripting with PowerShell 3.0 Jump Start

The first series starts off a little slow for experienced command shell users, but these videos are well worth your time (as is learning PowerShell).

Tuesday, March 27, 2012

A quick openvpn "oops" moment

I learned a quick, silly lesson today. I run some servers that tunnel using openvpn to facilitate our single sign on. I've migrated one before, and at the time, I foolishly did not create a new certificate/key pair for the new server and re-used the old one. During the point of the migration where I had both servers online at once, the two openvpn clients kept fighting - one connected, the other disconnected, and so forth, until I figured it out.

This time - I did things right - I generated a new certificate. HOWEVER, The subjects of the certificates were still the same, so they were being assigned the same IP address. This caused basically the same situation. Fortunately this time I was a bit quicker to realize. Make sure you differentiate your subject names when using openvpn. In general, you would already be doing this, but in the case of moving a server hosting a given domain from one box to another, since the domain name being served is the same there is an inclination to just type the same domain name in...don't do it. Make sure it's unique. Thanks for the forum post which lead to my answer, Jan Just Keijser!

I'm not sure if just the OU or CN must be different, or if both should be different. I erred on the side of caution and made sure both were distinct. I falsely assumed only the certificate itself had to be unique, but that's not the case.


This is a self-reminder blog post / post of shame. DOH!

Tuesday, March 20, 2012

World Time Buddy - an awesome timezone website

As the company I work for grows and has more users in remote areas of the globe, knowing what time it is for everyone gets tricky. We're in the US on the East Coast, but have employees in California, Hawaii, Germany, France, India, Ukraine, and other locations. A very simple site I found that does the best job I've seen is www.worldtimebuddy.com - hands down.

 Here is a sample of one I configured in around a minute and then bookmarked and shared:

















 I couldn't get a larger image to work well in this theme so to see this for yourself use this link.

It may not have the fanciest name or super sleek graphics, but its display of information is amazing. Above we see that:
  • It displays current times clearly for all timezones I care about in an easy to read/compare way. 
    • Everything is vertically aligned with readable values for easy comparison
    • I see whole-hour times for a 24 hour period
    • I see current exact times
    • I see offsets (+4, -6, etc) from my home time zone
    • It shows the current date in each time zone in an easy to follow way
    • It shows business hours, night hours, and late night hours in different colors
  • It alerts me to upcoming time changes - in this case, Europe's daylight savings equivalent happens 4 days from now
  • I can remove a timezone I no longer need with one mouseclick
  • I can change my home timezone with one mouseclick
  • Not visible in the above screenshot, but visible with the mouse cursor is the ability to drag and drop re-order timezones in any way I choose. I put mine in ascending order, but that isn't enforced, it was my preference. 
  • I can click link icon in the top right corner to get a link to the site containing my customizations, easily bookmarkable and shareable with coworkers.
  • New timezones can be added by using an autocompletable field (just start typing a city or country name)
I love the simple yet useful way it displays the timezones.If there is one area for improvement it would be a customized interface for mobile devices - you get the same, full webpage from a mobile device. It's still usable but the hover-able timeline does not work. Since it displays all of the hours it isn't strictly necessary, as you can still see the same information it just doesn't give it that extra focus if you want to pick a time for a meeting for people in vastly different timezones.

If you deal with multiple time zones a lot, definitely check out World Time Buddy.

Thursday, January 26, 2012

How to Ruin a Perfectly Good Evening

Open your brand new SSD (Samsung 830 series 128GB)

Marvel with excitement at the iPhone-like packaging and eagerly image your old drive (Intel 80GB G1 SSD) onto the new one with Clonezilla - 15 mins and booted into Windows 7 on the new SSD. This is where I should have stopped - oh what a fool I was to continue.

Side-track to find out why PC basically hangs for 1-2 mins after login and discover it is Microsoft Security Essentials misbehaving - story for another day - 20 mins ...


Everything has gone smoothly so far - run AS SSD and ogle the new benchmark numbers. Uh oh. offset 31K bad? Great. I recall that I never fixed this on my Intel SSD and that is why, so I foolishly decide to try and fix it. I find an answer at lifehacker.


Download GParted and install on my trusty multiboot USB drive - I actually already had a GParted livecd on there but decided to throw Parted Magic on there to see what that was like.

Create a Windows 7 Repair Disc (directly from my copy of Windows 7 Home Premium I'm running at home). Wait, no, side-track and test out lightscribe to make a fun label for it first.

Discover that lightscribe software service needs to update. Do that. Find a label maker software - oh, already had one in some software suite - great. Hmm, it won't let me select my CDRW as my lightscribe driver...it will apparently only accept the lowest lettered optical disc drive. Wow. That's good engineering (Cyberlink LabelPrint). Re-map drive names so DVDRW drive comes first. Burn lightscribe label - remember why I haven't burned a lightscribe label in 6 years - because it takes way too long. Finally, let Windows create/burn a windows 7 repair disc.

Boot into Parted Magic and shift my partition forward a few MB, wait 15 mins, then shift back 1 MB, per Lifehacker instructions. Success - now, Windows will no longer boot because it's confused. (This is expected)

Boot up my freshly burned Windows 7 repair disc. I'm greeted with the following:







The windows recovery disc I burned from the copy of windows I am trying to repairing is incompatible with itself. Yes, that's right - incompatible with itself.

Do some quick searches and come up short. Decide screw it - I'll just reinstall Windows 7 on my SSD. Insert my Windows 7 Upgrade DVD (Family Pack - likely the source of all my pain!) Format the drive, select it - realize that Windows 7 RTM does not create "100MB" partition which has possible side-effect of aligning partition properly (same issue w/ original SSD install I think...). Decide to try and manually create partitions back in GParted and then let Windows 7 try to install.

Nope - Windows 7 will not install on it. Error 80300024. Excellent. No real useful info found.

Remove fancy new SSD and put back in old Intel one. Admit defeat for now.




4 hours after I started - blog about it, back at square one.

Thursday, November 3, 2011

20 Years of VIM

VIM has now been out for 20 years. Ars has a nice article on it. It is my editor of choice on *nix based systems, but things weren't always that way. I remember when I first used vim (it may have even been an earlier clone, but probably not vi itself) , I hated it - it didn't make any sense. I was in highschool at the time, probably 14 years old. At the time I used pico since it was similar to MSDOS' EDIT.

It wasn't until I was in college that I truly got an appreciation for vim. I saw one of my professors using it to write code, and he was so incredibly fast it amazed me. It got me interested in how to use vim. Once you take the time to learn a few things about how it works, it's very useful. I still am a vim novice, I know enough to "miss" certain features when I am not using vim, but not enough to be a jedi master of vim (I'm a long ways away from that).

I'm going to take this anniversary as an opportunity to learn some new tricks in VIM. I wouldn't be surprised if I sum up some of the most frequent commands I use in a future post.

While I don't think software should generally have a steep learning curve, in the context of an editor for highly technical users, it makes sense to invest your time really learning an editor. The Pragmatic Programmer tells us to Use A Single Editor Well for a reason - there are real productivity benefits. I'm curious how many users take the time to learn an advanced editor like vim, emacs, or the ins and outs of something like Textmate. 


I think being under active development after 20 years is a pretty awesome accomplishment in software. How many projects have that kind of life span these days? A toast to you, VIM! To another 20 years of active development!

Tuesday, November 1, 2011

It's PragProWriMo again

It's November 1st. That means it's Pragmatic Programmer Writing Month (PragProWriMo) time again. Itself a spin off of National Novel Writing Month (NaNoWriMo).This will be my third year trying to participate in my own way.

My goal for the month is not to write a book. I take this as an opportunity to encourage myself to blog about technical topics every day for the month. Over time, my blog has become at the very least a resource for myself to find solutions or answers to simple problems I've encountered previously. I find writing every day for a month is both challenging and rewarding.

I lot has happened since last year. My job role has changed, my whole life has been changing (thanks to Jesus Christ), and I just got married last month. I've yet to determine what I will write about this month.

For tonight, I will just state a simple piece of technology that improves my world. Technology often advances just for the sake of advancement, and I'm not always sure a given new technology noticeably improves my life. Occasionally, I'll see something and go wow - why didn't this happen earlier. Why isn't this a feature of every widget? What's one of those things? The dripless pour spout on my new electric kettle. How many times have liquids (hot or otherwise) been spilled on countertops, on hands, everywhere, because a container has a spout that's prone to dripping everywhere? Somebody took the time to design one that DOES NOT DRIP regardless of how slow you tilt it. No messes because you poured too slow, or poured too fast to avoid a drip from pouring too slow.

And where is it on the features list? Not even listed on the vendor's website. It was listed on the box somewhere, though. (but isn't why I bought it - I wanted the programmable temperatures as I'm an avid tea drinker and boiling isn't enough flexibility)

Why doesn't every pitcher-like container have a no-drip spout? How many years do you think it will be until every new product has it? It saddens me that it may be quite some time. (5 years, 10 years, more?)

I find this "small touch" feature that is easily overlooked since the user can just deal with having to tread carefully and pour exactly right, or drip and spill liquids, maps over fairly well into the software world. Too often we let the user just deal with stupid, simple, easily fixable problems. We could fix them, but we don't spend the time. These type of problems agitate me more and more as I work with technology. Focusing on the small stuff MATTERS. It makes an IMPACT. This no-drip spout pitcher impresses me more than any other piece of technology I've seen this year - even more than Siri (which is really, really cool). I think more companies need to focus on the small details - it's something I believe Apple does quite well. Focus on no-drip pour spouts. Delight users with that simple, saves-you-10-seconds every day type of boring feature. Nothing frustrates me more than wasting my time on something easily fixed or automated.

I bet not a lot of people get excited about no-drip pour spouts - but I do. That's how I roll.


Wednesday, June 29, 2011

A Proper Emphasis on User Experience in Software: Example 1

I found myself thrilled the other week by how awesome and helpful the messages in ImgBurn are. I was slipstreaming some files on a Windows 7 DVD and wanted to keep it bootable, obviously. I figured I probably should do something but wasn't really sure what, so decided to just try and burn. The cost nowadays of a coaster is minimal.

ImgBurn nicely informed me of my error:

That is one of the best dialogs I have ever seen. Ever. It's not just evidence of smart logic, but also properly presenting it to me, and in an entertaining way to boot.. All developers dealing with UIs should learn from this great example.

That wasn't it though, being out of practice I also forgot to create a volume label! Not to worry, ImgBurn also let me know about that:




This great usability and functionality exists in a FREE program! I love it. This type of excellence should be rewarded - and can be (there's an option to donate on the website).

That's about it, really, I am seriously impressed by ImgBurn - it's a great tool and deserves attention.

Tuesday, June 28, 2011

Don't Use "Duplicate" button to add a new JRE/JDK in Eclipse

You may be tempted to use the "Duplicate..." button to add a new version of a JRE/JDK in Eclipse. Save yourself some potential hassle and use the "Add..." button instead. Manually copy and paste any Default VM Arguments you may have set afterwards.

The problem with using "Duplicate" is that all of the system library links remain at the old JRE/JDK after you update the "JRE Home". This can cause very strange errors, such as the following:

ZipFile.open(String, int, long) line: not available [native method]   
JarFile(ZipFile).(File, int) line: 114     
JarFile.(File, boolean, int) line: 135  
JarFile.(String) line: 72         
URLClassPath$JarLoader.getJarFile(URL) line: 646              
URLClassPath$JarLoader.access$600(URLClassPath$JarLoader, URL) line: 540        
URLClassPath$JarLoader$1.run() line: 607             
AccessController.doPrivileged(PrivilegedExceptionAction) line: not available [native method]    
URLClassPath$JarLoader.ensureOpen() line: 599  
URLClassPath$JarLoader.(URL, URLStreamHandler, HashMap) line: 583          
URLClassPath$3.run() line: 333   
AccessController.doPrivileged(PrivilegedExceptionAction) line: not available [native method]    
URLClassPath.getLoader(URL) line: 322   
URLClassPath.getLoader(int) line: 299     
URLClassPath.getResource(String, boolean) line: 168        
URLClassLoader$1.run() line: 194    

Some coworkers did this, and it caused a lot of headaches trying to figure out what was happening. Practically half the dev team has tried it at one point and learned the painful lesson, and it is an easy mistake to make.

If you insist on using "Duplicate...", then there is an easy fix. After you've updated the JRE location, if you use the "Restore Default" button it will update your JRE library entries. It's still very easy to forget this step, which is potentially a lot more work than just copy pasting your Default VM Arguments. If you forget to copy those, diagnosing out of heap errors is a lot simpler.

Wednesday, May 4, 2011

Creating a Multi-boot USB drive

Creating a bootable USB thumb drive from a single ISO is handy, but not on its own any big advantage over a bootable CD. A multi-boot USB thumb drive with every bootable ISO you want? That's something that is extremely useful, if you tend to need that kind of stuff frequently. It can also be a real time-saver - both by saving you time hunting through your stack of burned CDs, and because a modern USB thumb drive will load files dramatically faster than a CD-ROM will.

I had kind of found a few ideas in the past, but last week I set out to start creating a multi-boot USB drive with all of the tools I frequently use. I picked up a 32GB thumb drive that should have plenty of room. To make my USB drive multi-boot, I used the YUMI Multiboot USB Creator.

It is basically an NSIS installer that lets you select a USB drive, make it bootable, and select what ISOs you want to load. It will format it FAT32 for you if you want. (I'm not positive, but I suspect FAT32 may be required for some boot CDs/floppy images). It will even initiate the download of all of the ISOs it has in its prebuilt list. I found this really useful, though occasionally a newer version of a tool would be out and it wouldn't directly find it. It was still very easy to use. It also allows you to add unlisted bootable ISOs, which it will add to a separate list. I tested this with 2 vendor diagnostic boot CDs and they both worked - your mileage may vary with some ISOs.

A point of confusion for me was how to add MULTIPLE ISOs. YUMI Multiboot USB Creator is designed to be run once per ISO. Don't try to add all of them at once, or you may end up scratching your head for a few minutes. Add them one at a time. At the end of each addition, it will ask you if you want to add another or not. Clicking yes, or running it again will add an additional bootable ISO while maintaining any that are already installed.It doesn't currently provide a way to remove a bootable ISO, so if you accidentally load the same one twice or otherwise want to remove one, you will have to edit the menu files by hand. This does appear to be a planned feature, though, so that may cease to be the case at some point. The version as of the time of this post is 0.0.1.1 - this version came out a couple of weeks ago, so it appears to be actively in development.

Here are some of the ISOs I loaded on mine:
  • Clonezilla
  • GParted
  • DBAN
  • Memtest86+
  • FreeDOS
  • Ubuntu
  • Vendor Hardware Diagnostic CDs
Be sure to read the known issues list. If you load a Windows 7 install CD on there it may interfere with Ubuntu-based distros loading, and there are a few other minor caveats. I am very impressed with this though and look forward to utilizing YUMI Multiboot USB Creator to add more ISOs in the future.

Tuesday, May 3, 2011

Easily create an ISO image of a CD/DVD

I occasionally find myself needing to create an ISO from a CD/DVD at work. Whether it's of some volume media, a diagnostics CD, or other CD that is created by a vendor. Today I found myself searching for a simple, free tool that does this. In particular, I recently burned a Lenovo diagnostics CD - it would not let me just create an ISO. I want an ISO so it can be a part of my multiboot USB drive with every ISO I frequently use.

Thanks to a question on superuser I located and the corresponding answers, I found LC ISO Creator, a 14KB (KB!!!) freeware tool from Lucersoft. It's as simple as it gets, and it works great.

Wednesday, April 13, 2011

Browser Behavior Audit: Mailto: links

I don't run a desktop mail client any more at home. I'm sure most users don't. It's because of this that I have no default mail client installed. Occasionally I click a mailto: link. Maybe I want to email someone from their contact page, or sign up for a mailing list.

I was a little surprised when I tried this in Chrome and nothing happened. No error, no dialog, no beep. NOTHING.



Let's do a quick audit of the current browsers:

Chrome 10: nothing happens. This sucks.

IE9: Error dialog:

This sucks, but at least it tells me.


Safari (latest as of this writing):
Similar to IE9...

Opera 11:


Much better. However, if I choose system default, nothing will happen once I click on links. It at least prompts me with options though - it receives a passing grade. Note: Gmail is not currently a web mail service option, or I would be more excited that it offers "web mail service" options. The built in mail client is nice, though, so it is a valid option.

Firefox 4:


Gold star Firefox. Gold. Star. Firefox not only prompts me, it has a gmail option. I'm already logged into my gmail in my browser anyway - if I am, it will directly open a compose mail for me. If not, it will bring me to a gmail login page. GIANT HIGH FIVE!!! Usability Win!

I was so delighted to see this screen with a gmail option, I drew a trophy for Firefox 4:
My drawing skills are lacking, but Firefox 4's user experience skills certainly aren't. I'm impressed. In fact, the more I toy with Firefox 4, the more I like it.

We live in a webmail age - I bet most people don't have desktop mail clients any more. Why is such basic functionality seriously lacking? Does nobody ever click a mailto: link? (I admit I only do so a couple of times a year). It may be a minor qualm, but I expect these types of simple usability cases to just work.

Monday, April 11, 2011

Port test websites rock

So you're at home, and you want to connect with a friend online. Maybe it's some Minecraft and you start your own server. Maybe it's an XMPP server for a little pair programming with Saros. Whatever the case, you've likely got multiple barriers to success. Your OS firewall. Your router firewall. NAT.

You try one thing, then hope it works. Then try again. How do you know it will work? An external port tester.

That's when a website like http://www.canyouseeme.org/ comes in. It will check if your port is open from the web or not, and save you time. Saving time is good. I think in the future routers should offer this functionality themselves. Let me pretend I'm outside, and I'll tell you if I can reach you. That would be sweet.

Thursday, April 7, 2011

Hyper-V Server 2008 R2 Remote Disk Management from Windows 7 on a Domain

I'm in the process of migrating a build machine to a Hyper-V Server 2008 R2 SP1 setup. I'm relatively new to Hyper-V, and may also be comparing with other options. The Hyper-V Server is joined to the domain, all standard remote management options from the console are turned on. I could connect with the Hyper-V Manager from a Windows 7 machine fine, but could not remotely manage the disks in Windows 7. I read this post and here is what worked for me.

On the connecting machine, Windows 7, I had to add the following firewall rule:

netsh advfirewall firewall set rule group="Remote Volume Management" new enable=yes

Remote management of Services was working, and I had enabled Virtual Disk Service on the Hyper-V box. Following a reboot, I could finally manage the disks remotely.

Prior to this, I believe any servers on the domain could manage them - just not my Windows 7 workstation.


This is only the beginning of my hypervisor adventures, as I try to convert 10 physical build machines running Jenkins masters into a fully virtualized fleet, double the amount of builds that occur, and centralize to 1 hudson master. I'll try to chronicle my findings here on this blog.

Tuesday, March 22, 2011

Why add-ons suck

This dialog, that's why:



Firefox 4.0 is officially out. I think it's great that Firefox has such a huge array of add-ons. They make a lot of people happy, and are often a justification for why people like the browser. The problem is when I upgrade to a new version and I can no longer use an add-on that is part of my core usage... This has happened a great many times...and every time it is less and less cool.



I'm probably in the minority for considering mouse gestures mandatory capability - but I do, and that requires an add-on in Firefox. There is hope, though.

The Firefox team seems to be taking a nod from Chrome's release cycle, and have vowed much faster, smaller releases going forward. From the "How to ship faster" section of the 2011 priorities/roadmap there is the following bullet point:
we must provide binary compatibility for Add-ons 
If that happens in 6-8 months (or whatever the timeline), it would remove my single biggest irritation with Firefox. Aside from the above dialog, Firefox 4 seems to bring an aweful lot of good to the table. I continue to happily keep 4 browsers installed on my machine...

Friday, December 17, 2010

Trogdor login screen

I think in general, it is bad security practice to display a lot of identifiable information at an SSH login prompt. If there's a known exploit for distro X version XYZ, you don't want to give someone a fast path to utilizing it.

I was setting up a new test VM at work, so I decided to have fun...and came up with (possibly) one of the greatest things ever. The trogdor ASCII art login screen.

Step 1 - search alt.ascii-art for "trogdor" on google groups
Step 2 - copy paste and save to a file on your server
Step 3 - configure SSH server to display a banner





The only down side is that my PUTTY window needs to be long enough to see the full awesomeness of this trogdor ascii art. I take zero credit for the ascii art, which you can find by clicking the google groups link above.

I'm kind of a newbie at configuring SSH, so I'm not sure if banners always display after you type your username...

Thursday, November 18, 2010

Solution to a slow syncing iPad

I noticed sometimes my iPad takes FOREVER to sync. Specifically, my ipad takes forever to backup before it starts syncing. I recently stopped syncing it to my macbook pro and began syncing it on a windows 7 system - iTunes has been behaving awesome for me on Windows, contrary to frequent opinion. At first, I was careful, and only ever used my iPad cable... but it's just a USB cable, so eventually I slipped and starting using my iPhone cable.

I'm not sure what's special about the iPad cable, aside from combined with the iPad charger it is a higher power charger, but it appears that backing up your iPad (even when it has practically nothing on it - as I recently cleaned mine out) can take ages if you use the wrong cable. Facepalm. It took some reading up on this to realize what I as doing wrong. It's a double facepalm for this even being an issue - I am not sure why an iPhone 3G or 4 cable would cause slow syncing...but it looks like it does. In my case it's slow backing up...like 30 mins to an hour when nothing has even changed. Problem solved though - use the iPad cable.

Wednesday, November 17, 2010

Oracle: How to find the service name of a database instance (SID)

At work I ran into a surprising issue. It's hard to find a service name for an Oracle database when all you know is the SID if you don't know exactly where to look. Hard, even for large, corporate Oracle deployments with DBAs you can ask. I found it hard to believe, but we've had issues several times now where it has been difficult for customers to determine a service name for their oracle database instance. Now, of course our application lets you enter SID or Service Name and handles URL formats for you and everything - that is not the problem. The problem is when administrative work needs to be done. It usually isn't an oracle DBA handling administrative tasks for our software at a customer site, since the DBAs are a precious resource.

Now, first a quick refresher:

SID - System Identifier uniquely identifying a database instance. Each database instance has an SID - one and only one.
Service Name - An alias to one or more INSTANCES (useful for clustering, failover, without changing end-user configurations) - introduced in Oracle 8.

One SID could have a hundred service names pointing to it if you wanted to...but I'm pretty sure at a minimum it will have one. When you create an instance, Oracle makes you name them both. The 10g Configuration Assistant on Windows has a field named Global Database Name, which maps to Service Name. The SID is
frequently, but not always, the same as the initially specified Global Database Name.

After the creation of a database instance, Oracle tools refer strictly to the SID - after all, that is the name of the instance you'd be configuring. Since Service Name is just an alias, you wouldn't configure the character set or memory options of an alias.


Why do I care what the service name is if I have the SID?

Because knowing it lets me avoid relying on properly configured tnsnames.ora on each client machine. Sometimes, tnsnames.ora files appear to be controlled by a dark magic - the same tnsnames.ora file works fine on one machine, but fails inexplicably on another client machine. Sometimes TNS doesn't work right - and for a Java application that's going to be using JDBC, needing to configure tnsnames.ora is unnecessary work. For the command line tools like SQLPLUS and the import/export tools, you can use the EZCONNECT URL format and avoid TNS completely. There's a catch - EZCONNECT only accepts Service Names.

So, how do you determine the service name? Here's one way...

This assumes you have access to the oracle server. Provided you do, simply use the command:

lsnrctl status

This will print out various status information, as well as a compact listing of configured service names and which instances they point at. You could also use lsnrctl services for slightly more verbose services output - but depending on how many service names and instances there are, it may be harder to look at.

It's kind of anti-climatic, but that simple command ended the confusion. I thought Service Name was preferred (as it is more flexible than directly specifying the SID), but apparently it isn't always the case.

Booklist updated, no Tuesday post

No Tuesday post, but I did spend time working on a longer post that just isn't quite ready yet. Sleep is more important...

I did update my bookshelf the other night though. Eventually I'll better separate it into a recommendation section, what I've read, and my current queue of books awaiting reading. I often have bigger eyes purchasing books than I do reading, so I always have a long backlog.