j steven perry, The Bloghttps://jstevenperry.wordpress.com
All Your Base Are Belong To UsThu, 25 Jan 2018 16:13:21 +0000enhourly1http://wordpress.com/https://jstevenperry.files.wordpress.com/2017/04/cropped-steveperry-headshot-001.png?w=32j steven perry, The Bloghttps://jstevenperry.wordpress.com
3232How to get MacOS to show hidden fileshttps://jstevenperry.wordpress.com/2018/01/25/how-to-get-macos-to-show-hidden-files/
https://jstevenperry.wordpress.com/2018/01/25/how-to-get-macos-to-show-hidden-files/#respondThu, 25 Jan 2018 15:28:11 +0000http://jstevenperry.wordpress.com/?p=1753As a developer, in Finder I need a way to see all my files.

Open Finder

Type Shift + Cmd + .

Enjoy seeing your hidden files and directories

It works as a toggle, so typing Shift + Cmd + . again hides the files.

Here’s a GIF (pronounced “jiff” – a topic for another post perhaps). It shows me toggling back and forth.

Enjoy!

–jsp

]]>https://jstevenperry.wordpress.com/2018/01/25/how-to-get-macos-to-show-hidden-files/feed/0jstevenperryMake: Please Cancel My Subscriptionhttps://jstevenperry.wordpress.com/2018/01/23/make-please-cancel-my-subscription/
https://jstevenperry.wordpress.com/2018/01/23/make-please-cancel-my-subscription/#respondTue, 23 Jan 2018 14:54:55 +0000http://jstevenperry.wordpress.com/?p=1856I don’t know what has happened to Make Magazine over the years. When I received my first issue in 2004 I was very excited about the content, the projects (Mousebot!).

And this great editorial focus continued for years. Robots? Check. Circuit design? Check. Tesla coil? Van deGraff generator? Check. Check.

But something has happened in the past couple of years or so. The occasional article about “wearable blinking jewelry” (W.T.F?) has become the norm.

Back in the day, my Make subscription was a nice complement to my Nuts and Volts subscription (which has stayed true to its editorial focus since I’ve been a subscriber in 2005). Now, they are nothing alike.

You can’t go many places these days without hearing about blockchain. It is a truly disruptive technology that will change the way people do business with each other. If you have wanted to learn more about Blockchain but think the barrier to entry is too high, I have good news: Hyperledger Composer. Yes, that’s the good news. Read on.

What is Hyperledger Composer again?

Hyperledger Composer is a set of tools that allows you to quickly build, test, and manage blockchain applications. One of several projects under the Hyperledger umbrella, Composer provides:

A Domain-Specific Language (DSL) called CTO that lets you model a blockchain network

A sandbox – called Playground – that lets you quickly prototype a blockchain application

A command line interface (CLI) for managing and interacting with blockchain applications

Security through the use of ACL-style permissions

Tools

Lots more!

Using Composer, you can quickly build, test, and then manage blockchain applications that run on the Hyperledger Fabric.

Composer lowers the bar to building Fabric applications. How? Composer provides a framework that includes many common features of production-quality blockchain applications like management and security. So you spend your time writing business logic, not infrastructure.

Now, before going any further, if you haven’t checked out Part 1 or Part 2 of this series, you should do that now.

How do I work with a real blockchain network?

In Parts 1 and 2 you get your feet wet working with Hyperledger Composer:

The CTO modeling language

Tools (like composer-cli and VSCode)

Unit testing with Cucumber

Using Composer Playground in the IBM Cloud

But surely there’s more to Composer than that, right? You bet! What about Hyperledger Fabric? Check. Working with the Composer CLI? I’ve got you covered. Security? Absolutely!

You’ll also install more tools and generate a Loopback-based REST interface that you can use to interact with the sample network blockchain application.

Part 3 also includes a detailed discussion of Hyperledger Composer security concepts. This part concludes with steps to pull it all together and extend the iot-perishable-network to create a more “real world” version of the Perishable Goods network.

How do I learn more?

Check out these links to learn more about Blockchain and Hyperledger Fabric and Composer:

You can’t go many places these days without hearing about blockchain. It is a truly disruptive technology that will change the way people do business with each other. If you have wanted to learn more about Blockchain but think the barrier to entry is too high, I have good news: Hyperledger Composer. Yes, that’s the good news. Read on.

Wait, what the heck is Hyperledger Composer?

Hyperledger Composer is a set of tools that allows you to quickly build, test, and manage blockchain applications. One of several projects under the Hyperledger umbrella, Composer provides:

A Domain-Specific Language (DSL) called CTO that lets you model a blockchain network

A sandbox – called Playground – that lets you quickly prototype a blockchain application

A command line interface (CLI) for managing and interacting with blockchain applications

Security through the use of ACL-style permissions

Tools

Lots more!

Using Composer, you can quickly build, test, and then manage blockchain applications that run on the Hyperledger Fabric.

Composer lowers the bar to building Fabric applications. How? Composer provides a framework that includes many common features of production-quality blockchain applications like management and security. So you spend your time writing business logic, not infrastructure.

How do I work with a real blockchain network?

In Part 1 of the tutorial series, I showed you about the CTO language, and how to model, deploy, and test a simple blockchain network application using Composer Playground.

Surely there’s more to it than that, right?

Of course. You’ll need tools in order to use Composer to work with real blockchain networks. Tools like:

Node.js

The Composer CLI

VSCode

What about unit testing your chaincode transactions? Composer has you covered. Through Cucumber steps written specifically for Composer, you can test every inch of your blockchain network (okay, maybe not every inch, but Cucumber is super-extensible).

How about a tutorial?

So, you’re convinced Composer is THE tool to use for building Hyperledger Fabric applications. Now what do you do? Sounds like you need a tutorial. Don’t worry, IBM developerWorks and I have you covered.

I’ve written a three part tutorial series on how to use Composer. When you’re finished with this tutorial series, you’ll be ready to build the next hot blockchain application. I talked about Part 1 of the series in a previous blog post. So be sure to check that out if you haven’t already.

In Part 2 of the series, called Hyperledger Composer Basics, Refine and deploy your blockchain network, available at IBM developerWorks, you’ll install the necessary tools to work with real Hyperledger Fabric applications running on your computer, including unit testing your chaincode using Cucumber. Part 2 is all about the development process for building blockchain applications. If you want to be a serious blockchain developer, you owe it to yourself to check it out.

How do I learn more?

Check out these links to learn more about Blockchain and Hyperledger Fabric and Composer:

You can’t go many places these days without hearing about blockchain. It is a truly disruptive technology that will change the way people do business with each other. If you have wanted to learn more about Blockchain but think the barrier to entry is too high, I have good news: Hyperledger Composer. Yes, that’s the good news. Read on.

What is Hyperledger Composer?

Hyperledger Composer is a set of tools that allows you to quickly build, test, and manage blockchain applications. One of several projects under the Hyperledger umbrella, Composer provides:

A Domain-Specific Language (DSL) called CTO that lets you model a blockchain network

A sandbox – called Playground – that lets you quickly prototype a blockchain application

A command line interface (CLI) for managing and interacting with blockchain applications

Security through the use of ACL-style permissions

Tools

Lots more!

Using Composer, you can quickly build, test, and then manage blockchain applications that run on the Hyperledger Fabric.

Composer lowers the bar to building Fabric applications. How? Composer provides a framework that includes many common features of production-quality blockchain applications like management and security. So you spend your time writing business logic, not infrastructure.

How about a tutorial?

So, you want to build a blockchain application, and Composer sounds like a good tool for getting you started. Now what do you do? Sounds like you need a tutorial. Don’t worry, IBM developerWorks and I have you covered.

I’ve written a three part tutorial series on how to use Composer. When you’re finished with this tutorial series, you’ll be ready to build the next hot blockchain application.

In Part 1 of the series, called Hyperledger Composer Basics, Model and test your blockchain network, available at IBM developerWorks, I tell you all about these features of Composer, and show you how to use them as you work with a perishable goods network. You’ll learn how to model a blockchain network’s features – such as assets, participants, and transactions – using the Composer CTO language, and you’ll see how to use the Composer Playground to quickly prototype and test the perishable goods network using an embedded Hyperledger Fabric instance that runs inside a Docker container.

How do I learn more?

Check out these links to learn more about Blockchain and Hyperledger Fabric and Composer:

Make sure the proxy is running (I showed you how to do this in Part 4). Start the proxy in a separate Terminal window:

kubectl proxy --port=8001

Once the Dashboard is deployed you can access it from http://localhost:8001/ui.

You can see the same basic information as from the various kubectl commands, but in a UI. Here’s an example of what I see using Chrome:

Conclusion

Well, that’s it for this series. I hope you enjoyed it, and make sure to check out the video below that walks you through everything I covered in this blog series (it’s true what they say: a video is worth a thousand pictures!).

The Application

So now you’re finally ready to start using Kubernetes. The first step in deploying a containerized application is, well, the application. I’ve put together some demo JavaScript code that you’ll run as a Node.js application.

Open a Terminal window or command prompt, navigate to a location on your computer where you want the code to land and clone the code from GitHub.

git clone https://github.com/makotogo/developerWorks

Navigate to the kubernetes directory and take a look at the JavaScript code. This toy application doesn’t do anything serious, just outputs a message to the console. But it’s enough for our purposes here.

And there it is. Now that you have an application, it’s time to containerize it.

Containerize the application

Here’s how you use Docker to do that. Take a look at the Dockerfile:

FROM node:6.11.4
EXPOSE 8080
COPY k8sdemo.js .
CMD node k8sdemo.js

Use this Docker definition to containerize the application. But before we can do that we need to start minikube, and I’ll show you why in a minute.

Execute the minikube start command:

minikube start

The first time Minikube runs, it has to download the ISO image to run inside of VirtualBox, and may take a minute or two depending on the speed of your internet connection. Once the image has been downloaded, minikube will start.

Minikube runs inside VirtualBox in its own VM. We need to make sure that Docker uses the internal Docker registry on Minikube’s VM by executing this command:

eval $(minikube docker-env)

Otherwise Docker will use the local registry on your machine, which is not accessible from the VM where minikube is running.

Now, from the Terminal window, execute the docker build command:

docker build -t k8sdemo:v1 .

This will create the image with a name of k8sdemo and a tag of v1, and store it in the Docker registry on the minikube host VM. When deploying the image to Minikube, you’ll reference that tag explicitly.

From the Terminal window execute the kubectl run command:

kubectl run k8sdemo --image=k8sdemo:v1 --port=8080

And now the application is up and running in its own Pod.

Conclusion

In this post I showed you how to work with Kubernetes on your computer. You containerized a simple application, then deployed it to your local Kubernetes cluster.

In Part 5, I’ll show you how to manage an application running in a Kubernetes cluster using kubectl and the Kubernetes Web UI Dashboard.

In this post, I want to walk you through installing the software you need to run Kubernetes on your computer.

Install the software

You’ll need a few pieces of software to run Kubernetes on your computer:

Docker

VirtualBox (or some other virtualization software)

Node.js

Minikube

Install Docker

First, you need Docker. You can find instructions for your platform by clicking this link. If you already have Docker installed, skip to the next section.

Scroll down until you see your platform, which is MacOS in my case, so I’ll click on Docker for MacOS. I want the distribution from the Stable channel, so I click on the link that says Get Docker for Mac (Stable). Always verify the 256 bit SHA checksum of the downloaded file matches what is published.

Now double-click the DMG file to begin the installation, and follow the instructions.

Install VirtualBox

Minikube requires a virtualization environment in order to run. If you want to use software other than VirtualBox, check out the Getting Started with Minikube page at kubernetes.io. If you already have VirtualBox installed, skip to the next section.

To install VirtualBox, go to the VirtualBox installation page, and click on the link that matches your platform. ALWAYS verify the SHA256 checksum matches the downloaded file.

Now double-click the DMG file to begin the installation, and follow the instructions.

Install Node.js

In order to test the demo application, you’ll need Node.js installed. I already have Node.js installed on my Mac, so I’ll skip that for the video. Make sure to check out the Node.js installation page. If you already have Node.js installed, skip to the next section.

Click on the download link that matches your platform, and follow the instructions.

Install Minikube

Go to the Minikube page at GitHub, and look for Installation.

I like to use Homebrew to install software on my Mac. If you’re using Linux or Windows, the Minikube installation page has instructions for those platforms as well.

Drop out to a Terminal window and execute the brew cask install for Minikube:

brew cask install minikube

Homebrew installs Minikube and now it’s ready to go. Yes, it really is that easy (on MacOS anyway).

Conclusion

Now you have all the software you need to work with Kubernetes on your computer. Stay tuned for Part 4, where I’ll show you how to work with Minikube and define an application, deploy it to your local k8s cluster.

Pods

A Pod is where an application is deployed, and contains resources specific to an application, such as file storage.

Pods can contain multiple applications, and all applications in a Pod share the same IP address and port space. Think of a Pod as the logical host, and is the atomic unit of deployment and scheduling in a Kubernetes cluster.

Desired state of the cluster

The desired state is defined as the applications and workloads you want to run, what container images to use, the number of Pod replicas, and other stuff like network and disk resources that your applications need. The master compares the current state of the cluster to the desired state and if they differ, makes any necessary adjustments until the desired state is once again reached.

This is helpful for, say, when an application crashes. The master will detect the application is no longer running, and restart the it. Now the cluster is back to the desired state.

Conclusion

In this post I introduced you to Kubernetes.

Stay tuned for Part 3, where I walk you through installing all of the software you need to run Kubernetes on your computer!

You can see the same info, but in a GUI format. Now, I love the command line as much as anybody, but sometimes figuring out what is going on with Docker through the command line can be frustrating. Not that the information isn’t there; just that it’s not super easy to tease out the information I’m looking for.

What else?

With Kitematic, you can see the logs for each container, just as you can with the docker logs command.

You can see the logs (under the Home tab on the right-hand side of the UI), in addition to information about the port that is exposed on localhost, the volumes that are mounted, and settings for both.

Get Kitematic

How do you use Kitematic? Go to the Docker drop-down menu in the status tray (mine is at the top of the screen on my Mac),

And select Kitematic. The first time you do this, you’ll see this dialog:

Click the “here” link (which takes you to https://download.docker.com/kitematic/Kitematic-Mac.zip). Once the ZIP file is downloaded, unzip it. It contains the Kitematic app, which you then drag and drop into your Applications folder. The next time you select Kitematic from the Docker drop-down, it fires up seamlessly.

You can sign into Docker Hub if you have an ID (if not, just select “Skip for Now”).

That’s it! Now you can use Kitematic.

Fini

I’m not suggesting you shouldn’t use the Docker command line tools. They’re great. But Kitematic is another tool in your Docker arsenal.