Posts

Rasberry Pi, Z-Wave and Domoticz: Setup Part 2

Image
This article is about using Z-Wave with a Raspberry Pi.  Z-Wave and ZigBee are the two big wireless players in the Home Automation automation market.  A single z-wave wireless controller can communicate with a large number of devices.  These devices include outlet switches, power meters, alarm sensors, remote controlled light bulbs and other accessories. The USB stick on the left is a Z-Wave Z-Stick S2 that acts as an interface between a computer and a network of wireless devices. It can be controlled via COTS software open source libraries like openzwave .  The outlet on the right is a Z-Wave wireless controlled outlet that reports back power consumption and state. I received this controller / switch pair at the Microsoft Build conference a couple years back.  They were one of the "prizes" you could buy when you earned conference credits for running through the labs.  I really had no idea what they were for a couple years until I took the time to do ...

Maven Lifecycle Phases - Fitting in Code Analysis and Other Tools

Image
The build management portion of Maven operates on a type of Template Pattern. Maven moves from lifecycle-phase to lifecycle-phase until there a step failure or until all steps are complete. The following diagram lists the build lifecycle phases. The orange squares represent the main targets that people run. Every phase is executed starting with Validate until the requested end phase is reached. For example "mvn validate"  runs just the Validate  phase. " mvn compile" runs Validate, Initialize, Generate Sources, Process Sources, Generate Resources, Process Resources and Compile. Each Maven Plugin  executes with in a phase. The Surefire  unit test plugin, as an example, typically runs the tests in the Test  phase.  This means that unit tests don't run if Validation, Compilation, class processing or any of the other preceding phases run with errors. Maven plugins can execute in their default phase or in any phase of your choosing.  Lifecy...

Static Analysis from IDE to CI with IntelliJ

Image
Static program analysis  is the  analysis of computer software  that is performed without actually executing programs (analysis performed on executing programs is known as  dynamic analysis ). [1]  In most cases the analysis is performed on some version of the  source code , and in the other cases, some form of the  object code . [2]   Static analysis provides a low cost way of automating code review of certain types of source code errors and standards.  Static code analysis, automated tests and code coverage are staples of the Continuous Integration process replacing manual effort with automation. Full featured IDEs implement their own integrated static analysis and test measurement tools. IntelliJ comes with a comprehensive set of integrated static analysis tools and rules.  It can run the rules in an incremental fashion updating results as code is edited.  Rule violations are immediately reflected in the user interface. CI...

Time Warp: Business Cycle Testing

Image
"Let's do the time warp again..." Video A video version of this blog Business Cycle with Time dependencies? What is a business cycle and why do I need to test it?  I'm really talking about any type of business process that has time based business rules.  The rules can periodic in that they fire on a regular basis or they can one-time based on some time based criteria.  Most of the ones I've worked with are contract oriented or billing cycle oriented. Examples include telecom contracts, home mortgage servicing systems, term based insurance to just name a few.   They usually have some time based sequence of operations, date based rules and may have some type of state machine.   Testing is complicated by the fact that data may need to be of a certain age before processing begins.  Loan payments may need to be delinquent.  An insurance policy may start the renewal process some time before expiration.  Collateralize debt may have payment, ...

AWS Relationships between EC2, ELB and ASG

Image
This post describes the basic relationships of ELBs (now ALBs), EC2 instances and ASGs.  I used AWS for over a year before I realized how Auto Scaling Groups actually interacted with ELBs and EC2 instances. Terms EC2: An Amazon virtual machine used to host applications and services.  EC2 instances can be pooled for scale or failover.  EC2 instances can be based on any of the Amazon EC2 machine types. Elastic Load Balancer (ELB): The basic load balancer provided by Amazon.  They are used as a reverse proxy servers for pools of EC2 instances.   ELBs determine instance health via basic health check operations. Auto Scaling Group (ASG): A control mechanism that manages how many EC2 instances make up a pool. ASGs will create new EC2 instances based on configured pool sizes. They can also auto-scale up and auto-scale down the pool sizes based on load.  ASGs can register created EC2 instances with associated ELBs. Availability Zones (AZ): An Amazo...

A Chrome Plugin: IsItUp serverless service dashboard

Image
A coworker created a Chrome Extension that acts as a zero-infrastructure dashboard. It provides a simple home page that displays service health and support or documentation links related to that service.  The plugin reads JSON file/text to make service calls and build the dashboard. The following picture shows 5 services across up to 6 environments.  The top service does not have a Production environment. The bottom service represents a 3rd external service that has one test environment and one production environment. The  IsItUp  chrome executes health checks via HTTP/HTTPS calls.  The extension requires connectivity to the services being monitored. Video Walk-through The video explains various cell examples and describes how the extension might be used. The plugin used for the video was downloaded from the  Chrome Web Store  . Video created with version available Jan 21 2017 Cell Explanation Each cell contains one Service Status plu...

A Chrome Plugin: Highlighting your AWS Account

Image
I'm working on a set of projects based in AWS. Our projects have somewhere between 7 and 9 different environments representing different levels of software maturity.  Production is the most restricted.  Development is the least restricted.  The rest fall somewhere in between. The company partitions the different levels of their SDLC into separate AWS accounts. Each account can have multiple environments that are of similar concerns and access controls. AWS account isolation makes it easy to identify and implement security rules and vary developer , dev-ops and operations access based on the account. The diagram at right shows a typical 3 account set-up where some of the accounts contain multiple environments. Our company actually has over 20 accounts used for various pre-prod, prod and partner purposes The AWS Console. The AWS console lets a user operate in a single account at one time.  Enterprise users log into the AWS console with Federated User ids tha...

Protecting Data in Transit: Trust Chains

Image
Web traffic is protected in-flight  when it is transferred via TLS encrypted links using HTTPS.  HTTPS is a protocol that is based on encryption algorithms using asymmetrical keys.  Asymmetrical keys are managed, packaged and distributed via certificates. Browsers, applications and servers trust certificates and their associated encryption keys based on their trust of the issuing parties known as Certificate Authorities (CA). Public web sites are identified by public/private certificates pairs that are purchased from one of the well known CAs. Their certificate pairs contain an identity component signed by the Certificate Authority and an encryption key that is encrypted by the CA. Server identity is encrypted in the server certificate with the Certificate Authority public key.  Server traffic is encrypted by the server using the private encryption key embedded in the Server's private certificate.   Server traffic is decrypted by clients using the public ...

Protecting data in-transit. Encryption Basics

Image
Web traffic is protected in-flight when it is transferred via TLS encrypted links using the HTTPS protocol. HTTPS is a protocol for payload encryption that is based on algorithms using encryption asymmetrical  keys.  Asymmetrical keys are managed, packaged and distributed with via certificates Encryption Basics Asymmetrical encryption relies on a key pair where one key can decrypt any data that is encrypted by the other.  Data encrypted with Key-A can be decrypted with Key-B only.  Key-A cannot be used to decrypt data encrypted with Key-A.  Key-B cannot be derived by knowing Key-A. Internet encryption relies on asymmetry and key anonymity in order to create secure links over a public and untrusted Internet.  A server or party can publish a public key  that other parties can use to encrypt their data.  The server then can decrypt the message using the corresponding private key . Encrypted messages are secure as long as the server keeps ...