Wednesday, 23 December 2015

An Introduction to the Point-to-Point Protocol for Windows Protocol Engineers

The PPP is used to establish point-to-point links for systems transporting multi-protocol datagrams.  It is an amalgam of several sub-protocols.

Part of the protocol is an LCP or link control protocol for establishing, configuring and testing the data-link connection, as well as other network control protocols. Amongst other uses, one of the LCP's jobs is to agree encapsulation format options.

A background to the intellectual development and design criteria behind the PPP can be analysed in RFC 1547 (put together by Drew Perkins of Carnegie Mellon in December 1993, who also founded Infinera) entitled "Requirements for an Internet Standard Point-to-Point". In it he highlights that while many protocols then existed for the data-link layer, none were sufficiently complete and versatile enough to be accepted as an Internet Standard.

Wireless Authentication for Windows Bods

The Wireless Networking and Authentication World

Wireless networking has a technical lingo all of its own. The following guide gives an overview of the terms and techniques a Windows programming bod may encounter in the field of wireless networking.

What is the EAP framework? (Hint: the E stands for Extensible)

The EAP or Extensible Authentication Protocol is an authentication framework (in the sense that it supports multiple authentication methods) commonly used in wireless networks.

What is UMA?

Unlicensed mobile access.

What is Pre Shared Key?

A pre-shared key (PSK) is a shared secret between two users of a communications channel.  A PSK is used in Wifi encryption methods such as WEP (Wired Equivalent Privacy), WPA (where there term WPA-PSK and WPA2-PSK is used) and also in EAP-PSK.

What is WPA?

WPA is the recommended authentication method for IEEE 802.11 devices. It stands for Wi-Fi Protected Access and became available in 2003. WPA2 came about in 2004.

What is a WNIC?

A WNIC is a wireless network interface controller. It connects to a radio-based computer network rather than a wire-based network such as Ethernet.

What is a Service Set in the IEEE 802.11 standard?

A Service Set consists of all devices on a WLAN. A service set consists of an SSID or Service Set identifier. The technique of network cloaking inhibits broadcasting of SSIDs and is a form of security by obscurity.

What is a WMN?

A WMN is a wireless mesh network made up of radio nodes arranged in a mesh.  Mesh networks relay messages either by routing or flooding.

Thursday, 10 December 2015

What is a SID in Windows? How does it relate to Security Principals? How does it apply to ACLs?

An SID refers to Security Identifier in the Windows NT line of operating systems. It can belong to a user, user group or other Security Principal. The SID remains attached to the principal even if the object is renamed. Access Control Lists (ACLs) use SIDs to determine which objects can access what resources.

Follow on questions:

What is a security principal? A principal in Computer Security is an entity that can be authenticated by a computer system or network, it is an "authenticable object". It is referred to as security principal in the world of Java and Microsoft.

Basics of AD Groups

An AD Group aggregates together user and computer accounts into a single unit. Their goal is to simplify administration by applying common permissions to multiple accounts at once.

A group can be local to a particular computer, as described here. However, for a group to be valid over the network, it has to be a directory object within Active Directory. The groups are then known as AD groups.

AD groups can be nested- in other words, one group can be made a member of another group.

Saturday, 28 November 2015

WMIC - The "Instrumentation" Command Line

Ever heard to WMIC ("Wemmick")?  It is a great tool that can be used at the command prompt.

To view all the logical drives on a Windows machine you can do:

>wmic
wmic:root\cli> logicaldisk
wmic:root\cli> get caption

Will print out the caption column of the logicaldisk output.

Thursday, 26 November 2015

Deploying Prerequisites for 64 bit Applications

The following page gives you the low-down on the 64 bit redistributables that you may need when deploying your 64 bit app of awesomeness. Bring on the MSVS2010RuntimeLibraries - IA64 style! Saddle up for MAINFRAME style reliability.

What does it mean to "Embed Interop Types"?

As of .NET 4, the CLR supports embedding type information for COM types direct into managed assemblies, rather than requiring managed assemblies to request COM types via Interop assemblies. The embedded type information is usage-based, it will omit methods and types that are not used by Monsieur Managed Assembly. The feature is used to simplify deployment.

Saturday, 21 November 2015

Turn off Automated Spelling Correction in Excel

Automated spelling correction in Excel is a nuisance especially when dealing with stock tickers. To turn if off do the following:

File -> Options -> Proofing -> Auto-correct Options -> Disable "Replace Text As You Type."

Hide Dotted Lines in Excel Showing Page Breaks

Dotted lines showing page breaks are useful to see how adjusting your spreadsheet impacts the printed copy. However, they are not always aesthetically pleasing. To remove them, do the following:

File -> Options (last item)  -> Advanced (middle item) -> Display Options for this Worksheet (appears below Display) -> Deselect Show Page Breaks.

Saturday, 14 November 2015

Keyboard Shortcuts - Add Footnotes and Endnotes

Control-Alt-F   - will add a Footnote
Control-Alt-D  - will add an Endnote

Thursday, 12 November 2015

What Types of Thread Priority are there in .NET?

ThreadPriority is specified by the ThreadPriority enumeration. It's an "old-school" enum having originated in .NET 1.1. BelowNormal means that the thread can be scheduled after threads with Normal priority. To make it above normal priority, use AboveNormal or Highest. There is also a ThreadPriority.Lowest for anything non-urgent. The algorithm to select which thread runs next is operating system dependent. The thread state must be Running before the OS can schedule it.

Sunday, 25 October 2015

Rotate a Scanned Document in Adobe

Control-Shift-Plus     Rotate Clockwise
Control-Shift-Minus Rotate Anti-Clockwise

Don't forget to re-save the document if appropriate!

Sunday, 11 October 2015

tt2 files in Root

Downloading a new Microsoft Office could create some tt2 files in your root directory. These are created by the Office installer and can be deleted manually. They should be cleaned up on reboot.

Saturday, 10 October 2015

RAID Logs for Software Projects - How to Practically Use Them

RAID logs are a useful tool in complex projects.  They should be kept regularly updated after team meetings.

  • Risk - records negative impact events, and plan to manage them. 
  • Assumptions - what you assume is in place for your project to be a success.  This warrants a description of the assumption, and rationale for making the assumption. Is the assumption based on prior experience or other evidence. Are there any validating actions to determine if the assumptions are valid or remain valid throughout the project. At what stage is that validation required or feasible to execute. The impact if the assumption is incorrect is also important to understand.
  • Issues -  a problem in your project that needs managing - need to record description, impact, and actions. Issues should have an owner and current status.
  • Dependencies - either your project depends on those, or others depend on you. Log who you are dependent on, what they need to deliver and when

Monday, 5 October 2015

Know your PowerShell

PowerShell was introduced in 2007 as a scripting language for Windows administrators. It was invented by Jeffrey Snover. To PowerShell is to know the lingo of PowerShell. Start your journey here!

There are a few useful guides:

Getting Started with PowerShell by Michael Shepherd (August 2015) from Packt Publishing is a good starter guide.

Also check out the following blogs:

PowerShell Blog (part of Server and Tools blogs)

And here are a few useful commands:

get-verb               - displays list of verbs (commands)
get-verb | more    - displays verbs with pagination
get-date
get-childitem       - does a directory listing. dir is aliased to get-childitem
get-help               - gets help on a specific verb

Commands are also known as cmdlets in PowerShell lingo.

Monday, 21 September 2015

Find the Path for Embedded Resources using Reflection

This is a useful technique to find out the path of embedded resources (you need the path to access the resources).

System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames()

Sunday, 20 September 2015

Managing Mailbox Size in Outlook

If you are close to your maximum storage limit in Outlook, and can't think of what to delete, consider Archiving mails. Archiving basically means moving old emails to an Outlook data file (.pst file) or other storage structure.

Saturday, 19 September 2015

Agile Information Management Policies for Software Development in Dynamic Environments

In Project Detailed Developer Notes

When running a software project, very detailed notes may necessarily be kept on various technical issues, including detailed debugging information and technical planning. Detailed written notes may be kept to help visualise and isolate technical problems.  This is very useful to gain a precise understanding of technical issues, and communicate clearly to other stakeholders in the project.

Post Project Clean up of Detailed Developer Notes and Development Case Studies

When the project is done, much of the detailed "running" documentation is useless and should be destroyed - whilst retaining any useful lessons learned at the project level. This process may be best described as "post project drill-down clean-up".

Criticisms of Above Approach - "I'm Afraid to Lose My Notes and Accumulated Knowledge"

Knowledge deleted is lost. However, it can easily be re-derived if needed in future projects. Retaining too much information rapidly leads to information overload can lead to confusion and in each project a different section of what you have studied needs to be focused on .. rather than losing yourself in details from one specific project. Note: this applies to detailed, technical documentation on the project. See below for a suggested approach to non-technical project documentation.

Retention of Non-Technical Project Documentation and "Lessons Learned" Narrative

The latest version of the completed project documentation should be retained and uploaded to a document management system and local copies deleted. This document should record "lessons learned". These lessons should be incorporated into new projects.

Thursday, 10 September 2015

Hard Debug

When debugging multi-threaded, multi-process applications, sometimes the only option is "hard debug". Debugger.Break(). This has been around since .NET 1.1. The user will be prompted if they want to attach a debugger.

Sunday, 9 August 2015

How to Debug a Spawned Process from Visual Studio?

Trick question, you can't!!  This is a requested feature. You may need to resort to Attach to Process. This might not work though if the process executes fast.

The Limits of Visual Studio

Visual Studio has its limits. But those limits will be pushed. To vote for which limit you want busted, vote on User Voice. Use your "User voice"!!

Is your Windows Laptop Working or Sleeping - G0 or G1?

Welcome to the World of the Hardware Software Interface on Windows. And how did we get here? How else, except through Device Manager.

Investigating your PC's Power Management Functions Via Device Manager

Anyone who has pulled up Device Manager on a laptop computer running Windows 98 or above, will have seen references to ACPI (Advanced Configuration Power Interface) which is the successor to APM. An example entry in Device Manager would be Computer defined as "ACPI x64 based PC".

The ACPI Specification and Involvement of Various Vendors

ACPI is a thousand page specification that allows Windows to communicate with the BIOS and instruct the BIOS to power down peripherals (the details of the specification are mainly of interest to Independent Hardware Vendors, or IHVs). 

ACPI is a joint effort between Hewlett Packard, Intel, Microsoft, Toshiba, and BIOS entrepreneur Phoenix Technologies Incorporated.

Four Basic States of a Component as Defined by ACPI

Working (G0), Sleeping (G1), Soft Off (G2) and Mechanical Off (G3). Within these global states are various sleep states.

Related Jargon like OSPM and AML

ACPI enables OSPM (Operating System-directed configuration and Power Management). AML is the machine language for ACPI.

The Riddle of the RAM - How Much RAM For Windows? Is 8GB Not Enough?

Let's say a starter computer comes with 8GB RAM, and a more high-end gaming PC comes with 16GB RAM. Windows 8 supports up to 128GB RAM. The more RAM you have, the less you rely on "Virtual Memory"- the magic utilization of hard disk which allows several "heavy memory" applications to run in memory at the same time. "Virtual Memory" is usually implemented as a file, such as pagefile.sys or swapfile.sys.

What causes "PInvokeStackImbalance was detected"?

You are happily debugging your C# code, perhaps forgetting it is interfacing with C libraries, when suddenly a most perplexing "StackImbalance" exception is detected. This is often due to signature mismatch between the DLL code and how it is being interpreted in the managed world. A good tip is to review the CallingConvention used. Common conventions include Cdecl and StdCall depending on whether the caller or callee cleans the stack.

Thursday, 30 July 2015

Other net commands

Apart from oft-used net use, there are also other great commands like:

net accounts
net computer
net config
net continue
net group (Only available on a Windows domain controller)

net use

Type net use at the command line and you get a list of network connections.

Suppose you want to delete a mapping for the K: drive. Simply do:

net use K: /delete

Then you can map again to another directory/resource on the same machine.


Developing understanding of the runtime element of the app.config (and why it is useful)

Utlizing the Runtime Settings Schema in your app.config is (primarily) about customizing run-time execution of your program to facilitate optimal performance.

Introduction to the runtime element and implementation in .NET 1.1

The runtime element of the app.config file appears as a sub-element of the configuration element. It defines how the .Net runtime should behave when running your application. The exciting thing is you can change the runtime behaviour of your application, insofar as it relates to the .Net runtime, by customising the runtime element of your app.config file, without recompiling your application.

The Runtime Settings Schema was first introduced in .Net 1.1 with the feature of being able to enable or disable garbage collection on a separate thread (gcConcurrent enabled="true"). The setting in app.config overrides the corresponding setting in the machine.config. A simple use case for this feature would be a GUI application with significant user interaction, which you wouldn't want interrupted by gc pauses. Therefore, you would set gcConcurrent to true.

The runtime element also supported from an early stage, assembly binding redirection, henceforth referred to as ABR. This was (and still is) done via the assemblyBinding child element of runtime.

To explain ABR (and how it relates to strong-named assemblies) -

Assume you have built your .Net application against a specific version of a strong-named .Net assembly. Note: you cannot redirect versions of assemblies that are not strong-named.

The application will surely use that assembly at runtime!

Suppose you want to refer to a newer version of this assembly. Yes you can via the app.config runtime->assemblyBinding element. In addition to app.config, machine.config or publisher policy file are also valid ways of implementing ABR for your application.

With gcConcurrent and assemblyBinding elements fully described, we conclude our discussion on .NET 1.1 features implemented in the runtime element of the Configuration File Schema.

.NET 2.0 Features of the runtime element (Recognition of Multicore)

With .Net 2.0 the gcServer element came into being. This specifies whether the Common language runtime runs server garbage collection. This makes sense when you have more than two CPUs.

.NET 4.0 UseSmallInternalThreadStacks

This is a request to the CLR to reduce memory usage by using explicit stack sizes (instead of the default stack size it uses internally).

Saturday, 25 July 2015

app.config Quiz -BASIC LEVEL - What is the TOP-LEVEL element of an app.config file for a .NET application?

This is a test for the .NET app.config aficionado.

The ROOT element in EVERY configuration file used by the .NET runtime i.e. EVERY app.config,  is <configuration>. After the OPENING XML ELEMENT, the next most likely thing you'll see is  <configuration>.  And at the end, the most likely thing you'll see is </configuration>.

Sunday, 24 May 2015

Excellent News on Windows 10 - Conquering the "Internet of Things"

The Windows 10 kettledrum keeps banging with the latest news flow for developers released by Microsoft.  It is an awesome "Internet of Things" oriented golden API strategy to maximise developers' learning investments to reach across a multitude of connected devices. It's called the Universal Windows Platform.

Friday, 1 May 2015

Technocreia

Plato believed (as detailed in his Politeia) in rule by aristocracy, where his definition of aristocrat was not "hereditary peer" but more akin to "philosopher-king".

A true Windows programming master, is not just empowered in programming skill, but also multi-versed in opinion on programming language direction, platform/ecosystem direction and so forth.

Such a technology-oriented "philosopher-king" is also deeply motivated to share their power (knowledge=power) with others and is constantly improving.

Tuesday, 21 April 2015

IntelliSense's Second Cousin IntelliTrace - Strictly for Users of Visual Studio "Ultimate" Edition

Do you use IntelliTrace (TM)? (or any other "Ultimate" feature such as UML modeling?).

IntelliTrace (TM) was a feature introduced in Visual Studio 2010 "Ultimate" - it collects data while a program is executing. This collected data is stored as IntelliTrace (TM) events (these are part of the DEFAULT debugging experience in "Ultimate").

Less well known than IntelliSense but interesting nonetheless.

A word to the wise on Visual Studio versions, in the 2010 series Professional is the base case, Premium adds performance profiling, static code analysis and testing features such as user-interface test automation.

Ultimate adds IntelliTrace (TM) as well as UML modeling and an "Architecture Explorer".  (Side note - some term these product categories as the "SKU model" (SKU = Stock Keeping Unit)).

Thursday, 2 April 2015

git on Windows

git can be installed on Windows so that it is accessible from the command-line, full information is available on the git website.  When installing you can select "Checkout Windows style, commit Unix-style line endings".