Wednesday, December 5, 2018

NetCat with Powershell

I keep forgetting this and when you look for Powershell-like NetCat command you find tons and tons of really large scripts - evidently implementing the full schema - not what I wanted (but, to be fair, exactly what I asked for).  Anyways - here this:

PS > Test-NetConnection -ComputerName 172.16.1.5 -Port 22 -InformationLevel "Detailed"

or

PS > Test-NetConnection -ComputerName "mypc.example.com" -Port 22 -InformationLevel "Detailed"

Saturday, December 1, 2018

John Dies at the End

In the dark comedy scifi horror film John Dies at the End, the main plot revolves around a drug which gives the user vast knowledge of everything in various time streams.  Essentially, the user can no longer perceive time in the usual linear way and is always confused and asking "Is this now?" "When is this?"  "Has X happened yet?"

I find myself thinking along those lines as I work on Azure.  I keep finding "solutions" to issues only to try them and find they simply do not work at all.  For example, the recent output from a command "error: unknown option `--image'" sent me looking for the date of the documentation I was using.  "Is this now?" "When is this?"  "Has X happened yet?"

Thursday, October 11, 2018

Prediction: Windows 11 = Microsoft Linux

Wow!  I cannot believe where we are now!  They now admit there are MORE Linux VMs in Azure than anything else.  Previous estimates were "nearly half" and some said 80%.  Azure itself runs on Linux (as do most hypervisors, phones, IoT, etc.).

Of course, Microsoft has added the really nice WSL allowing you to run the bash shell and even Linux under Windows (making native calls).   This, while cool, was not really that interesting to me - until I saw the results!  The back and forth cross platform/pollination has resulted in Powershell Core!  It runs on Linux and Windows.  This makes administering Azure from Linux MUCH easier.  And, even better, Microsoft has released Visual Studio Code for Linux.  Both of these run great under Slackware Linux (I used the tarball).  They have binaries for Debian or RedHat distros.

I've never been one for a IDE, after moving from emacs to vi 17 years ago, but I have to admit - this is probably worth learning.  It has a really slick plugin for Git.  It has plugins for most languages (I've added a bunch) - even Perl!  (It took me a lot of scrolling, but I finally found it!)  I'm excited about Microsoft for the first time since 1995 (that was *really* short lived!)

People are always bugging me - switch from Perl to Python.  I've dabbled with Python.  If I were starting today, I'd definitely go that way.  But now, I need to get things done and everything you can do in Python you can do in Perl and vice-versa - so what's the point?  BUT, Powershell is a different story!  With Powershell, I have 10's of thousands of comandlets (reminds me a bit of Perl modules) that give me easy access to Windows .Net objects that allow me to do VERY POWERFUL THINGS.  I've been playing around with it for years and I really appreciate what it can do!  Now, I can do it from my Linux command line whilst operating against VMs in the Azure cloud.  This truly is an amazing time in IT.  I am so glad Microsoft is finally working with us instead of against us!  I can't wait to see where this is heading!

Wednesday, March 14, 2018

Azure Re-Visited

It's been a while since I updated the Azure CLI. I ran into some weirdness getting my template to create a new Oracle Linux VM for me.  I was, of course, still using azure CLI version 0.10.2.  A quick npm re-install got me to 0.10.17 - not good enough.  The latest download  was still CLI 0.10.17.  Strange - was everyone talking about CLI 2.0?  Then I saw the Docker container installation instructions!  Super easy!  Do this and save your self some grief now and in the future. 

Thursday, July 28, 2016

Installing Azure CLI on Slackware Linux

The first thing I wanted to do was to get the Azure CLI running on Slackware Linux. I am using the NEW Slackware 14.2 (64 bit) version so I went to Slackbuilds to download from nodejs (NOT node and DO NOT install both - they conflict).

nodejs consists of node-4.4.7.tar.gz and nodejs.SlackBuild. Just Follow the instructions for installing Slackbuilds.

# chmod +x nodejs.SlackBuild
# ./nodejs.SlackBuild (this takes a LOT of time)
# cd /tmp # installpkg nodejs-4.4.7-x86_64-1_SBo.tgz

Download Azure CLI for Linux.  I chose the Nodejs version

This is what you do with it:

# npm install -g azure-cli.0.10.2.linux.tar.gz

Now, do the dual login verification...

# azure login (then follow instructions)

...  and you're ready to manage Azure from your Linux console!



Welcome to Linux for Azure

This will be the place I will gather notes on using the Azure CLI on Linux.

I have only a few posts on Azure so far (on my primary blog):

Azure and Oracle Linux 6

It's a good time to be a Linux sysadmin! 

I have a feeling I have only just begun to tap into this cloud service.  So far, I am pleased to see it has a cross-platform command line utility that seems to work pretty well.  When it comes to the web GUIs - there are some things you can only do with the Classic Azure Portal and some things that you can only do with New Azure Portal BUT most everything is possible with the Powershell or cross-platform CLI.

I pretty much live in a bash shell with the screen multiplexer logged into 35-40 systems all day long.  So, the CLI looked like a good fit.  However, sometimes, the CLI command (or Powershell commands) are really long, complicated and (in my opinion) intuitive.  So, I am starting this blog to keep my notes.  If you find them handy, great!  (And positive comments are always welcome)