Search

Sunday, January 28, 2018

Setup Terminal Profile in Linux for PowerShell 6



It's been a while since my last post, but there's a lot of exciting things happening already for PowerShell in 2018. So what better way than to kick off learning more PowerShell than to quickly access PowerShell when using a graphical environment on Linux!

Disclaimer: This tutorial is geared towards someone just getting started with Linux.

Setting up a terminal profile is easy, and it is something I recommend doing if you want to have a consistent experience for opening a PowerShell while using the GUI on Linux. I have outlined below a few screenshots and the steps required to setup a consistent profile experience. For the purposes of this tutorial, I’m using CentOS 7.4 GNOME3 Desktop Environment.


Pre-requisites:
  • You must have already installed PowerShell 6.0 for your Linux distribution.
Ready? Let’s begin:

  1. Open your Terminal or Konsole application and select File > New Profile.

  2. Go ahead and name your new profile “PowerShell” or whatever you like. Notice you can also adjust the size of the terminal that you want to have. This can be adjusted at any time in the future so don’t be worried if you end up with a smaller window at first.


  3. Now lets move to the Command tab. Again, you can use whatever title you wish, but for the purposes of this tutorial, we’ll set the Title of this new profile “PowerShell”.

  4. Next, under Command, select Run a customer command instead of my shell and enter in the Custom command: field “pwsh”.

  5. You can now open your new profile as show below. Don't forget to update help!


I hope you found this quick tutorial helpful. Happy Learning Linux & PowerShell 6!

 



Tuesday, January 10, 2017

Notes for Installing Rockstor 3.8 on VMware Workstation 12.5

I ran into a little hiccup on a new Rockstor 3.8 NAS setup today. After some quick searching on their support forum I ran across someone who was also using VMware Workstation 12.5 having the exact issue.

There appears to be a bug with this type of test environment where no UUID is assigned to any of the disks you add to your guest. To fix this you must edit the virtual machine's VMX file and add the following line to the end of the file:

disk.EnableUUID="true"

Once you do that, save the file and restart your NAS. You will now see the disks have been detected.


It is no joke either that their support forum is very responsive and helpful! Even with this minor issue, this still is the easiest and quickest NAS solution out there without spending a fortune. The update subscription service is also very reasonably priced and if I ever use this in production I will be signing up. 

My original report: https://forum.rockstor.com/t/cannot-add-disks-vmware-workstation-demo-environment/2662

Fix: https://forum.rockstor.com/t/error-running-a-command-cmd-sbin-btrfs-filesystem-show-dev-disk-by-id-sda3/2314

Thursday, January 5, 2017

PowerShell / PowerCLI Powered On / Off Report Using HTML & CSS

I recently was tasked with creating a report containing the current power state for all VM's in a vCenter environment. Using some recently obtained CSS knowledge and revisiting PowerShell HTML reports, I whipped this little gem up:



That's it. All you need to do is modify the PowerState to either:

  • PoweredOn
  • PoweredOff
and or point to another external CSS for formatting. I find it easier to use a URL between the single quotes. I modified the script to strip away any custom settings for my environment. 

Here's an example of the external CSS file I used (reportstyle.css) : 


With these you can create simple reports from vcenter data that look like this:


Sunday, December 25, 2016

Merry Christmas 2016

2016 has brought quite a bit of excitement to my life. This year I've:

  • Sold and moved homes. Finished living in a basement for a period of 1 year. 
  • Started a Bachelor's degree program. 
  • Was told I could start working from home more (drive into office once a week).
  • Found out I was going to be a dad!
  • Broke my freaking ankle in three places! (it sucks, and as of right now I still have a cast.)
I've also not posted a lot of new content to this blog in a while But I'm hoping to have some interesting bits of info to talk about in 2017. I'm gearing up for some interesting classes, some possible job changes and maybe getting a few more certifications.

But in the meantime, I wanted to just say Merry Christmas to anyone who stumbles by to read my pointless ramblings and to say this is the last post for 2016. 

Tuesday, September 27, 2016

Windows Server 2016 EVAL - First Thoughts & Observations

After downloading the official Windows Server 2016 Eval yesterday and spinning up a VM I was pleased to see what I had been hearing for a while that this version would indeed include support for containers:

Woo-hoo! I'll have to play with this some more soon. It should also be noted that Windows Server 2016 now uses PowerShell 5.1 which contains some important new features around JEA & DSC.

I'm excited to start learning. This version appears to have improved on the sweeping changes we saw with Server 2012 so there shouldn't be too much to relearn which is good. As I work with this new version I'll post more.


Wednesday, August 10, 2016

Grab Basic Network Info from Docker Container

Learning Docker has forced me to learn more about basic Linux tools. One such tool is GREP, or Global Regular Expression Print.

GREP is quite a powerful, yet simple tool for searching text. Docker has lots of text that can be searched when using Docker commands such as docker inspect. Using this command can return a lot of text on your screen. While this can be useful, why hurt your eyes looking for simple network information on a particular container? Enter GREP.

In this example, I'm looking for just the name of the container, it's IP address(es) and MAC address(es). 


 docker network inspect 4136d04999bc | grep 'Name\|IPv4Address\|MacAddress'  

As you can see, I use the command docker network inspect [containerID] and pipe that text to the GREP utility which allows me to search for the regular expression. 

You should see something similar to the following:


docker network inspect + GREP







The above is plain text but since you can do so much with regular expressions, there isn't much you can't find using this example as a starting point.

For more information on using GREP and regular expressions as well as Docker networking, visit the following sites:

Grep - An introduction to grep and egrep. How to search for strings inside of files.

Docker - Work with network commands

Tuesday, July 12, 2016

Time to Learn Docker

I've been quite busy lately. Not long after my last blog post I was blessed with a great opportunity to finally enter the enterprise IT realm.

Oh the things I've begun to learn and have been asked to learn. Definitely makes scheduling time to enjoy the finer things in life (spending lots more time with the wife, friends & family, fixing up a new house etc.) at little more chaotic at times. But I digress...

I've been asked consider learning all that I can about Docker. So I bought some books, started reading some things online and watched a few videos.

Wow. Big change is coming for IT. Container technology is already upsetting the industry and has already motivated me to learn more and second guess how I currently do things.

As I have time, I'm going to write up some things I've discovered & learned in hopes it will help someone else and as a way to to help me better learn Docker by talking about it with whoever decides to read this blog.

Until next time......