Tuesday, January 28, 2014

Web Traffic Analysis

While Google Analytics are great for traffic analysis, they show you a particular version of reality. Google tracks using javascript & attempts to track unique visits, which isn’t 100% reliable, but still gives a good idea about real world traffic through your site.

At the other extreme are your web server log files which, if switched on, will contain an entry for every URL request made to your site. This gives a more complete picture of what the server has actually been doing.

Looking at the raw logs isn’t much use, however, being just massive lists of dates, times & URLs. Something is needed to process these and provide an overview. My boss just sent me a link to an old favourite of his that I’ve not used before: Analog is a simple, free log analysis tool that understand IIS log files, for example, out of the box.

It’s simple to get going. Full instructions are in the how-tos, which are also included in the download, but you basically download, unzip & fiddle a couple of settings in a configuration file. The exe then processes the raw logs and burps out an html report file with images.

There might be more sophisticated tools available, but this one’s so easy it’s a good one to begin with.

Tuesday, January 14, 2014

Making Notes

I used to use notepad or notepad++ to take simple notes, but a few months back I converted to Microsoft OneNote. This is part of the Office suite, was included on my Surface RT and has a free store app version for Windows 8 and Windows 8 Phones. It has a simple tabs & pages interface and automatically syncs across my devices via Skydrive.

To Do

You can also mark a paragraph as being a to-do item which gives it a simple tickbox. So Onenote has also become my default to-do list tool, although I use Trello for projects. Ctrl+1 will cycle the current paragraph through the 3 states: tick box unticked; tick box ticked; no tick box.

Screenshots

I often grab screen shots when making notes. I don’t usually want the whole screen, just the relevant part. These will paste into Onenote OK and the desktop version will let me grab a clip via Insert > Screen Clipping, but I often need to grab a clip from a dev box which I haven’t installed Onenote onto.

The old-school route is to use the Print Screen (PrtScn) key found on a standard keyboard. This places a copy of the screen into the clipboard where it can then be pasted into something like Paint, cropped and then saved as a file. Alt+PrtScn will just grab the active window instead.

Windows 7 included a tool called Snip which fits in the middle here. It lets you grab a screen area and then copy it to the clipboard, save it to file or email it. This is ideal to take a clip from a machine without installing anything else.

It’s missing from Windows Server 2012 by default though. You can get it back by activating the feature through PowerShell, for example. Run PowerShell with Administrator rights.

Install-WindowsFeature Desktop-Experience

This required a reboot of the server afterwards in this case. You can use the following to list the features and sub-features and see which are installed:

Get-WindowsFeature

Windows 8 seems to contain the snip tool still, at least it has on the builds I’ve seen. You can also press Windows Key + PrtScr in Windows 8 to take a screenshot and drop it directly into your Pictures > Screenshots folder as *.png files.

Maths

Something I only recently noticed is that OneNote will spot simple maths as you type it and put in the answer for you. I just happened to type the monthly cost of SharePoint Online and multiply by 12. I typed the equals sign and pressed space and OneNote filled in the answer, including the pound sign (it omitted the trailing zero though, so not quite perfect):

£7.80 * 12 = £93.6

Wednesday, December 11, 2013

How to create an open DNS resolver

In previous posts I mentioned how I set up Windows DNS to handle DNS for my internal dev environment. This was internal only, using 2 Windows servers which both host Active Directory and DNS. The next requirement was to handle external DNS queries because I wanted to expose some services, such as email & ADFS, to external clients.

I used a subdomain of our main domain as my internal name for Active Directory. Assume our live external name is example.co.uk and I chose devtest.example.co.uk for my dev environment’s Active Directory name. Internally my account names are fredsmith@devtest.example.co.uk.

I don’t actually want to use that externally so I got another domain from an ISP. Let’s call that anotherexample.com. I want mail.anotherexample.com to be available externally and to land on my internal mail server.

My first move is simple, but wrong. I added anotherexample.com as a forward lookup zone to my existing DNS, populated it with the external aliases, configured our ISP to forward DNS to our servers and then exposed my DNS servers to the internet!

While this works I’m guessing that someone with nslookup, for example, can start sending DNS queries to my server and ask it questions about my internal host names. Not ideal, but it’s a dev environment and making mistakes is allowed.

It turns out to be more serious though, as it allows the server to be used as part of a type of distributed attack against other hosts because I’ve created an Open DNS Resolver. In effect, any external DNS client can now ask my DNS servers to do lookups and the clients can spoof (fake) their IP address. My servers will then attempt to resolve those queries. If they are not answerable locally, then my servers will pass the query up the chain to the wider internet DNS. Eventually the answer(s) will return to the spoofed IP address. If lots of open resolvers are attacked at once using the same spoofed address then they will all start generating traffic back to the target spoofed IP. Or something like that.

Windows DNS, even in Windows Server 2012, can’t be configured to behave differently depending on whether the request originated from inside or outside my environment, so the next move here would be to spin up another pair of DNS servers and use those just for handling any requests for my external DNS zone (anotherexample.com). These can be configured such that they do not recursively resolve, so they will not be Open Resolvers – they will only answer for their configured domain and will do nothing else. You need a pair because most ISPs need you to provide a primary and secondary DNS server. My existing DNS servers can have the external DNS removed and external access removed and return to their original purpose of handling DNS for my internal clients.

In this case though, my external DNS needs are minimal so it’s not worth the effort. Instead I closed the DNS off again, deleted the anotherexample.com zone from my DNS servers, and added the handful of host entries from anotherexample.com directly into the ISP DNS, having also removed the forward to my DNS servers.

As for why Windows DNS can’t do this, I guess you’d have to ask who else, apart from someone messing about as I am, would want to do this? A proper DNS sysadmin wouldn’t even dream of mixing internal and external server roles on the same box in the first place and would have started out with two sets of servers in the first place anyway.

Sunday, November 24, 2013

Surface RT, 1 year on

I bought an original Surface RT back when it launched, about a year ago: http://robaker.blogspot.co.uk/2012/11/surface.html.

I’ve got a desktop for real work and can check emails on my Windows 8 Phone when I’m on the move, but the Surface fits right in the middle: It’s useful for meetings where I might want to make some notes, or for travelling, or for browsing the internet and reading news via RSS from the couch at home. I played a few games from the store, but they’re pretty lame if you’re used to something like the Xbox.

I’ve used Handbrake to rip a few DVDs to MP4 so I’ve got stuff to watch on the handful of occasions I’m away from home.

Surface RT 2 and Surface Pro 2 have just come out, but I’m not sure what benefits, if any, these bring over the originals.

Windows 8.1 was released and was a free upgrade, so I’m now running that. Microsoft continue to fail to talk to their customers so I’ve no idea what benefits I should expect, but here’s a few things I’ve found since the upgrade.

The big news, for me, is that the SkyDrive client is built in to Windows 8.1 and it works on Surface RT so I now have all my files automatically synched to the Surface! The control interface is now through the Windows Store app which is built-in to Windows 8 & 8.1. Note that the earlier client will just vanish from a Windows 8 laptop when you upgrade to 8.1 as the upgrade tidies it away, which is nice, but a little heads-up would have been good. Given that email is a well-understood communications tool, and Windows has a client built-in, it could have sent me a little email or something to let me know.

The start button is back and appears bottom-left of the desktop, in the usual place. This button just brings up the start page, so isn’t useful to me as I’m now used to hitting the Windows key or whatever. I can see how it would have helped Windows 7 users transition though and I’m amazed it took this long for it to arrive.

Searching is slightly different. You can still just start typing on the start page and it flicks into search mode, but the categories are gone now. Instead it searches “everywhere” and gives a you results page which you can switch back to if you want to try different results without having to rekey your search. Handy. Also, when at the start screen you can now swipe down (or click the little down arrow) to find your list of all app that are installed – previously I was searching and clicking the Apps category.

Food and Health & Fitness apps have appeared. These are just additions to the existing built in news apps, such as the Sport and Finance apps. Not useful to me.

A Reading List app has also appeared. This lets you bookmark web pages to remind you to read them later. You do this via the Share charm, so from within IE you share to the Reading List app. Seems like they broke their own metaphor here, but not tried it enough to judge whether it works or not. The list will sync across desktops apparently. It didn’t work from desktop IE though – only the Windows Store IE

Friday, November 22, 2013

The Sims Freeplay

This is a free version of the The Sims which I am playing on my Nokia Lumia 920 which is a Windows Phone 8. It needs a phone with at least 1 GB of RAM and won’t show up in the Store if you have less.

Like many “fremium” games it is technically free, but every action in the game takes time to complete so if you are impatient you have to buy in game currency to speed them up. You don’t have to though – if you’re patient you can play for free.

There’s not much depth to the game though. You can create multiple people (Sims) and houses for them to live in and fill the houses with lots of stuff for the Sims to interact with, but left to their own devices they just find a chair to sit in. Buying the stuff requires in-game currency (Simoleons) and using the stuff takes time. You can easily earn Simoleons by growing plants and getting jobs, for example.

The best stuff, and some actions such as having a baby or advancing a Sim through to adulthood, requires a second in-game currency: Lifestyle Points (LPs). These are harder to earn, assuming you don’t want to pay real money. Initially you can earn them by increasing your overall level and increasing your town value. Doing any action (sleeping, eating, watching TV) generates XP which  increases your level. Longer actions usually provide more XP. Spending Simoleons on building new properties increases your town value. However, both these activities become slower to level up as you increase their levels, which means you run out of LPs, in my case by level 25.

However, there are other (legitimate) ways to earn LPs:

  • Goals. The game keeps generating goals through weekly challenges which will earn LPs.
  • Pets. You can buy pets at the town pet store, although these also cost LPs. I believe more expensive pets find better stuff. Shake Hands with a dog and he’ll dig something up for you. Usually Simoleons, but sometimes an LP. You can Praise the dog afterwards, but I’m not sure if it actually trains the dog to find extra LPs.
  • Sims can win LPs at the town Competition Centre. One Sim can enter one event every 24 hours. Each event uses one of the various hobbies, so get your Sims to practice these.

 

Hobby Stage Compete Practice Venue
Woodworking Adult   Community Centre, first floor
Ghost hunter Adult   Any home – buy items with the red ghost symbol on then use them to Search For Ghosts
Fishing Adult Yes Town park – look for fishing rods on a wooden pier
Fashion Adult   Buy the Fashion Studio item from the town’s Promotions R Us store and then add that to a house from your Inventory
Ballet Pre-teen Yes Community Centre, ground floor
Karate Pre-teen Yes Community Centre, ground floor
Skating Adult   Snow park
Diving Adult Yes Swimming Centre
Music Adult Yes Teen Idol’s can’t compete in this event

Wednesday, October 30, 2013

Windows Server 2012–language & keyboard settings broken

Just installed Windows Server 2012 and selected United Kingdom for language and keyboard layout during the install, just like I have done for every other Windows install in the last 15 years.

Broken. The server comes up in a US timezone and with US keyboard layout.

How does this stuff even get out the door? It’s not released, so much as inflicted upon us.

Wednesday, September 18, 2013

WDS & Windows Embedded Standard 7

I just spent most of a day failing to get Windows Embedded Standard 7 deploying via Windows Deployment Services (WDS). We have some IBASE SI-08 PC’s nailed on to some flat screen monitors which we want to use for digital signage. They came pre-packaged with some truly awful management software running on Windows Embedded Standard 7. We’ve decided to dump the free software and use PADS 4 instead and now we’re thinking about deploying our own Windows Embedded image with PADS instead of the pre-installed image.

I already have WDS installed and running on Windows Server 2012 and have used that to deploy vanilla Windows 7, 8 and Server 2012 images over the network.

After downloading the Windows Embedded 7 Standard ISO from MSDN and adding the WIM file from the Sources folder we tried PXE booting the device and got in as usual (had to fiddle with the BIOS to enable network boot, but wasn’t hard to find). I approved the request on the server via the WDS UI as usual and the boot image then fails to load. 0x00000001. A device connected to the system isn't responding.

This turned out to be a network time out issue, probably caused by incompatible packet sizes. WDS 2012 has an auto-negotiate feature which can be switched off in the WDS server properties. In the TFTP tab clear Enable variable window extension.

This moves us along. The boot image now boots, and we get a Windows Setup GUI, but it errors out with: WdsClient: An error occurred while starting networking: a matching network card driver was not found in this image. Please have your administrator add the network driver for this machine to the Windows PE image on the Windows Deployment Services server.

According to the specs for SI-08 we need a RealTek network driver so we download and unzip that and add it to WDS and apply it to the boot image. Boot again and we get along a little more. We give the setup our locale (English: UK) and admin logon credentials and then get to choose an install image. Or we would except it won’t show us any. The event log on the server shows errors when enumerating the images. We reboot the server. Now the WDS service will not start. We have event ID 257 An error occurred while trying to start the Windows Deployment Server (0xC1020201) in the event log and An error occurred while refreshing the image cache.

I removed and re-added the WDS role, but got the same problem. I did it again and this time I deleted the c:\remoteinstall folder, trashing my handful of install images (the ISOs are still around so adding them back should be simple enough). The WDS service now starts OK. I add the Windows Embedded 7 Standard install image and the x86 boot images again and try to install on a test laptop. It gets through to the Windows Setup OK but can’t offer me an install image. The errors are back again on the WDS server and the service won’t restart again after a reboot.

There’s clearly something fishy about this WIM image file and a bit of googling around WDS and Windows Embedded Standard 7 reveals that the WIMs are not directly deployable via WDS.

It looks like WDS will let me add the WIM, but then breaks when asked to enumerate them for a client or when restarting the WDS service. This time I deleted just the Windows Embedded Standard 7 image via the WDS UI, which works even without the service running, and then the WDS service starts.