Building a system of habits to achieve your goals.

Building a system of habits to achieve your goals.

Since this is the beginning of the New Year, this would be a good time to talk about new years resolutions or goals and how they tie back into IT and software development.

If you chose to be in a learning profession such as IT or Software Development, your habits will help you either get ahead and achieve your goals or just sink you. You learn a new technology stack new people skills or business skills. It would help if it were something you do without much thought, just out of habit.

What does this have to do with Programing, Management, DevOps, etc.?

The principle of “self-improvement” applies to developing a system of incremental improvement over time. If you can apply this principle to yourself, you can apply these in other areas of your life, including your work.

If you are like me you probably have given up on new year resolutions
Because they don’t work… At least not for long… Motivation just sputters out.
Even after you manage to reach your goal… You go back to doing the same stuff you resolve not to do. Instead of working on disjointed tasks, adopt a game plan for developing lasting habits that support ALL of your goals.

A game plan for developing lasting habits.

Small daily habits
1% cumulative improvements
Habit tracking

Small daily habits

Think of the habits necessary to reach your goal.
For instance to be healthy that is your goal, your strategy. Your tactics may be: eating healthy, exercise regularly.

To do those tactics, you need to create new habits such as:

Go to the gym
Learn to cook a healthy meal.

Where I would get in trouble is creating a gigantic LIST of TASKS.
Instead, start small and simple and stay small.

I will go to the gym and do one pushup once a day.
I will make rice with a rice cooker once every other day.
I will read five pages a day.

I found when I start with doing just one pushup, I end up doing more.

I start with making rice, I also end up steaming some vegetables in addition.

On reading five pages a day, after six months, I have read 900 pages or about 3 novels.

Otherwise, with a large number of “tasks” for your “habit” you end up with analysis paralysis… in other words you do nothing.

Inspiration or motivating yourself, those tricks for me don’t work well it’s too much “hit and miss.” However creating a small task habit with minimal willpower, I can make work everyday. The best stuff I’ve done has been when I didn’t even feel like doing it. I just do it out of habit.

The book Mini Habits describes how this can be done.

1% continuous improvement…

“It is not important to be better than someone else, but to be better than yesterday.”

Jigoro Kano
founder of Judo

Instead of working towards “instant discipline” or “instant insane amounts of work” or a long list of tasks that you are unable to sustain, look for small improvements instead. When you start doing things like pushups without inspiration, rather out of habit, add another habit like sit-ups or an additional routine to your workout. Find small ways to improve your habits everyday.

In management, the Kaizen approach  (otherwise known as Lean Management) is based on the belief that continuous, incremental improvement adds up to substantial change over time. This can be done in your daily habits and routine.

Find a better way to organize your workspace
Find a shortcut to work
Try a healthier food option

Little improvements in your routine will improve your life. Do this daily and compound your improvements and you have big changes in a short period of time.

Track your progress

You can use a piece of graph paper and place a check mark for each time you successfully completed your habit for the day. This acts as a way to reinforce the habit you are building.

A habit or goal tracking app also will work. There are several of them out there. I use Goal Tracker & Habit Calendar on Android.

Summary

Instead of focusing on a goal, focus on habits to reach your goals.
Focus on small daily habits that are not big.
Do 1% habits that reinforce each other and work on them every day.

Track your habit progress using a habit tracking app on your smart phone.

It will take anywhere from 20 days to 365 days. Track this until this is automatic.

Books helpful for habits

Mini Habits
Atomic Habits

I like to hear any comments or suggestions you have.
Until then, have a great year.

Windows package management with Chocolatey

What does DevOps have to do with Windows package management?

Good question, since maintaining consistency with software tools is a key principle in Development Operations. You don’t always have a choice on what environment or platform you can run and you are stuck with maintaining a Windows environment. Windows has been a pain for myself and many other people taking care of Window machines because the business needs them. Besides the most common problems in maintaining a Windows machine, installation and management of software is a big pain. It’s very likely that you have to support Windows in a desktop environment and server environment. I always thought, being an old school Unix Sys Admin, “Why can’t we have an automated package manager like apt-get, pkgadd, which are available in Unix/Linux in Windows?”
The answer I and many others found is in Chocolatey.

What is Chocolatey?

Chocolatey is a nuget based Windows package manager. Nuget is a .net framework library manager developed by Microsoft. The mechanisms used in Nuget is used for installing Windows packages.
Chocolatey does the following:
1 – Install software
2 – Upgrades software
3 – Remove software
4 – Installs dependencies
5 – Support unattended installs
6 – Support private repositories
7 – Works with automated provisioning systems (Ansible, Chef, Puppet, etc)
8 – Allows creation of private custom packages

Installing Chocolatey.

First, Chocolatey requires the minimum of Windows 7 sp 1 with Powershell Version 3 or later. Windows 10 on up meets the minimum requirement..

Install via powershell
As administrator, run the following on powershell window:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))

https://chocolatey.org/api/v2/package/chocolatey

After you install chocolatey, you can add any package you want.

$ choco install firefox

It will install the latest version of firefox.

To update firefox,

$ choco upgrade firefox

It will update firefox to the latest version.

To list all of the packages you have installed on your machine.

$ choco list –local-only

Chocolatey v0.10.11
7zip.portable 18.5

yed 3.18.1.1
84 packages installed.

This creates a list of all applications managed by chocolatey.

There are other things you can do with chocolatey such as creating your own packages, running your on repository and use tools like Ansible, Puppet or Chef to deploy these packages to your Windows machines. It’s beyond the scope of this article. I may cover this in a future article, just be aware it’s available.

Until then, have a good day.

Roy

Recommended Reading for DevOps – It’s Your Ship: Management Techniques from the Best Damn Ship in the Navy

So what would a book on management on a Navy ship have to do with DevOps?

Well it’s really a book on how Captain Michael Abrashoff created a collaborating organization on his ship while in the US Navy. As a result, he brought his ship from the bottom 3rd in the Pacific fleet to the best ship in the Navy. He increased his crew re-enlistment rate from 8% to close to 100% during his time on the USS Benfold.

The Military is know for it’s highly rigid command structure and for that matter its traditionally restrictive culture that discourages contribution and change. On top of that, you don’t get to choose your crew or your boss. Does that sound like a place you might be working for?

He created a collaborative culture by doing the following:

1 – See the ship through the eyes of the crew
2 – Communicating often
3 – Create discipline by focusing on purpose
4 – Listen aggressively

He also outlined how he did this in a restrictive military culture.
He would find ways to:

1 -Use dumb rules to his organizations advantage.
2 – Shelter his crew from the higher ups bad policies.
3 – Make his superiors look good and get latitude to run his ship.

Although this book has been out for a while (2002), these ideas presented in this book can give you some ideas on what you can do to implement the collaborative culture of DevOps in your organization.

Soft skills like communications and management are often overlooked by people in Software Development and Technical Operations. Take the time to improve these skills as it will not only enrich your workplace, but enrich your life.

If you have any suggestions or ideas, feel free to let me know.

Until then, have a good day.

Roy

Here is a link to the book:

It’s Your Ship: Management Techniques from the Best Damn Ship in the Navy by D Michael Abrashoff

 

The virtues of Ansible – Running Ansible on Windows

Devops and Ansible

The mantra of DevOps (Development Operations) is Infrastructure is Code.
For those who are not familiar with DevOps, it is a culture and philosophy of computer and network infrastructure management geared around development and delivery of software and services. DevOps uses tools geared towards automation of infrastructure, delivery of software and services.
Ansible is one of those indispensable tools used in DevOps. With Ansible, you can manage your whole network infrastructures , deploy and manage virtual machines, install and configure VMs, provision and update software and services, etc. Written in python, and the configuration files are “programmed” in YAML (Yet Another Markup Language). It is a easy to learn tool for mass provisioning of Linux, Windows, Mac and virtual infrastructure using scriptable command line.
Windows operating system is ubiquitous and is probably one of the easiest, lowest cost hardware/software combinations to get for your testing and development and production environment.

The Windows Dilemma

However if you like me, are running Windows, there is one problem, Ansible does not run on Windows. The developers of Ansible have no intention of porting it to Windows (at this time). Even though, there “is” a way to use Linux like libraries on Windows (using things like CygWin) , however, it’s not very stable. You need a stable platform to do mission critical work. So, how do I run Ansible in Windows?

Introducing Vagrant

The answer to this dilemma is to use Virtualization. “Wait a minute…”, you might say, “Isn’t this a clunky and bulky way to run a tool by getting a clunkier interface to run it on?” This is where a virtualization environment for developers like Vagrant comes into play. Vagrant, from command line allows you to do some cool things:

1 – Use your favorite Windows based editor to edit your playbooks in which you can make changes to your files THEN run them without repackaging the image (as in the case of Docker).
2 – With command line within PowerShell, QUICKLY spin up your Linux VM to run Ansible.
3 – From the same command line, enter the Linux VM command line and run Ansible commands and run your playbooks.
4 – If you want to run the Vagrant VM for a dedicated task involving Ansible, with one command, you can do just that.

For those not familiar with Vagrant, this is a piece of cake.

How to set up Ansible in Vagrant

For the purpose of demonstrating how to do this in Windows, I will show you how to do this in a Windows 7 SP1 machine. I will also assume you are running the latest version of VirtualBox hypervisor. Vagrant will also work with VMWare and HyperV and other versions of Windows (7/8/10), but this will be left (for now) as an exercise you can do on your own.

Also, my preferred way to add software to Windows machines is to use a package manager like Chocolatey. Using automation with package management is the DevOps way. Follow this link for instructions installing Chocolatey.

Steps for setting up Vagrant

1 – Download and install VirtualBox

a – use chocolatey
C:\> choco install virtualbox

b – manually install
Download from here: https://www.virtualbox.org/wiki/Downloads

2 – Download and install vagrant

a – use chocolatey
C:\> choco install vagrant

b – manually install
Download from here: https://www.vagrantup.com/downloads.html

3 – Download this vagrant file from the git repository and unpack it. This is a Vagrantfile template. You can use git to get the file.

4 – Change directory to vagrant directory and run “vagrant up”

5 – Access VM shell, run “vagrant ssh” It will take you into a Linux shell.

6 – To exit out of the VM shell, type ‘exit’ and hit enter. You will be back to the powershell command prompt.

7 – To shut down vagrant and the VM, run “vagrant halt” and it will shut down the VM.

I would recommend reading the README.md file in the directory for additional details.

How do these files work?

This is not a full tutorial on how to work with Vagrant, just enough to get you running with Ansible on Windows. We may cover the particulars of Ansible and Vagrant another time.

What is a Vagrant file?

The Vagrantfile tells vagrant how to provision the VM. The VM will be installed with Python and Ansible. It’s a file written in the Ruby programming language. It’s pretty straightforward how you can configure it to work with your development environment. Anyhow, from here, you can experiment with Ansible on the VM itself.

Once you access Ansible through Vagrant, you can start using Ad Hoc commands and writing playbooks for Ansible and executing them right there. Do some searching on the internet on what you can do with Ansible. It’s a very powerful tool.

That was quite a bit of info, how do I wrap my head around this?

That is the unfortunate nature of any profession, especially the technology profession.  You need to know many different tools and concepts in order to use them, and many of the tools by themselves don’t make much sense until you find a context to use these tools.  Each one of the tools and technologies I used in this intro have their own use in the DevOps area.  You have to dive right in and play with them in order to find out how they can help you to use them in your own particular situation.   I may cover each of these tools  individually in a future article.

Until then, have a good day.

Roy

DevOps vs Systems Administration – Why should I care?

Originally, I was going to write about Ansible and how to run it in a Windows environment using Vagrant, but as I started to write the article, I found that I had to describe how these tools were used and developed around the culture and philosophy of DevOps. Then, it occurred to me, I needed to describe what is DevOps. According to Wikipedia, DevOps is a software development methodology that combines software development (Dev) with information technology operations (Ops). Of course, I’ll use DevOps definition in a broader sense and more oriented towards operations.

Why should I care? Isn’t systems administration and DevOps the same?
Not exactly. Being brought up on old school Unix Systems Administration, I remember when machines consisted of dedicated hardware(CPU, Memory, Framebuffer, hard drive, etc.) software and network switches and routers. I would spend hours configuring individual machines using scripts or installing software (or compiling it) one machine at a time. I would be working with a team of people it seems firefighting. Keeping up with the demands of the users and their needs for additional resources…well was a pain. Then we turned the corner with virtualization where your machine is just a disk image sharing space on high powered hardware, more efficient, easier to use programming languages such as python & ruby (though this can be debated, but these languages are easier than programming c) and working towards automation. Mass on demand Virtualization is now called “cloud computing” or what I call Commoditized Virtualization. You can get VMs on demand and pay for what you need even by the hour. Out of these merging of technologies and software development methodologies (such as Agile) is where DevOps finds its origins.

Contrasting Systems Administration with DevOps.

Systems Administration tends to focus on being a tech…that is a power user who loads and configures software and plugs in hardware into the system. DevOps on the other hand focus on programming and automation of the system and network infrastructure. The mantra is “Infrastructure is Code” where you write and run code to make running the systems and network infrastructure more predictable and controlled.

System Administration tends to be reactive. That is you plug in the hardware/software and find out if it works and fix it as you go. DevOps is proactive in its approach. Use automation in a consistent and predictable way by using tools to test in a development environment before releasing it into a production environment.

System Administration tends to follow a “waterfall” approach to planning, getting requirements and deployment. You tend to make big expenditures of capital, time and resources up front. You fix it as the complaints come in. DevOps approach is more “agile” with many smaller changes to the system with plenty of user feedback BEFORE it’s all rolled out as well as DURING and AFTER the rollout.

While your company or organization may not be a software development house, i.e. you may be a web design company or your supporting your own companies internal network, you WILL benefit from adopting a DevOps approach as this can be applied to:

1 – Rolling out new software to your internal desktop users and keeping them current.
2 – Keeping your customers websites updated using automation tools.
3 – Being able to show management (and other stakeholders) what is accomplished and what is needed. You keep them in the loop.

While this is not ment to be an exhaustive treatise on DevOps, this should open your eyes to what is useful and what is possible.

In the meantime, have a good day.

Roy