PowerShell on LINUX?

I know it’s not Christmas yet, but I did get a nice early gift.
My main laptop has been very reliable over the last few years.
My old Lenovo ThinkPad (11e) has been great, but lately I’ve been thinking I’d like to upgrade. I’ve been looking for something to replace the 11e, and finally (after much consideration and spec comparison) settled on a newer 11e with twice the memory and a i3. It looks and feels as rugged as the old machine, but it’s a little faster. The unit came with Windows 10 pro which I replaced with Ubuntu 18.10.
I did play with it for a while with Windows, but after waiting for updates I decided I should stop fooling around and set it up the way I want.

I did test a few other Linux LTS Distros, but Ubuntu 18.10 works great on the new 11e – actually better than it did on the old ThinkPad. I think that was more related to the old Bios and driver/hardware limitations.
The one thing that I do like about Windows 10 has been PowerShell. Now that PowerShell is available for Ubuntu I might not need a Windows machine. I was never too excited about running Ubuntu under Windows, as a virtual box, or duel-boot.
I’ll probably load Win10 on the old 11e just to have on hand for special projects, but I’d like to keep the new laptop as a Linux only machine.

I know ToughBooks have been the benchmark for rugged laptops for fieldwork, but I’ve had great luck with the 11e (Education series) I paired solid hardware (ThinkPad) with a great Operating System (Ubuntu/Linux).
PowerShell is working – although not exactly the same as it would on Windows, but it does seem very promising.

PS /home/eph> Test-Connection LocalHost > Test_Connection.txt
Reply from bytes=0 time=0ms TTL= Reply from bytes=0 time=0ms TTL= Reply from bytes=0 time=0ms TTL= Reply from bytes=0 time=0ms TTL= Ping complete. 

Source Destination Replies

X LocalHost {System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingRep…

PS /home/eph> cat Test_Connection.txt

Source Destination Replies

X LocalHost {System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingRep…

PS /home/eph> ping localhost -c 6 > Ping_test.txt
PS /home/eph> Get-Content Ping_test.txt
PING localhost ( 56(84) bytes of data.
64 bytes from localhost ( icmp_seq=1 ttl=64 time=0.017 ms
64 bytes from localhost ( icmp_seq=2 ttl=64 time=0.072 ms
64 bytes from localhost ( icmp_seq=3 ttl=64 time=0.072 ms
64 bytes from localhost ( icmp_seq=4 ttl=64 time=0.072 ms
64 bytes from localhost ( icmp_seq=5 ttl=64 time=0.071 ms
64 bytes from localhost ( icmp_seq=6 ttl=64 time=0.074 ms

— localhost ping statistics —
6 packets transmitted, 6 received, 0% packet loss, time 127ms
rtt min/avg/max/mdev = 0.017/0.063/0.074/0.020 ms
PS /home/eph> cat Ping_test.txt
PING localhost ( 56(84) bytes of data.
64 bytes from localhost ( icmp_seq=1 ttl=64 time=0.017 ms
64 bytes from localhost ( icmp_seq=2 ttl=64 time=0.072 ms
64 bytes from localhost ( icmp_seq=3 ttl=64 time=0.072 ms
64 bytes from localhost ( icmp_seq=4 ttl=64 time=0.072 ms
64 bytes from localhost ( icmp_seq=5 ttl=64 time=0.071 ms
64 bytes from localhost ( icmp_seq=6 ttl=64 time=0.074 ms

— localhost ping statistics —
6 packets transmitted, 6 received, 0% packet loss, time 127ms
rtt min/avg/max/mdev = 0.017/0.063/0.074/0.020 ms

One nice attribute you have avaiable when using Powershell in Linux is the availability of standard Linux commands in the same terminal.

If PowerShell is the only thing keeping you tied to Windows, you might want to take a look at the Linux version.

Dark Roasted Conspiracy

As the daylight hours grow shorter and darkness becomes the prevailing theme, the temperatures drop and the winds blow cold. It feels like the night never ends. The leaves are falling and swirling down the road. Without the sun’s energy and warmth, a good fire and a hot cup of dark roast coffee help take away the ever-present Autumn chill. Coffee is an ever-persistent habit for me. I like good coffee, and it keeps me going like high octane fuel.

No cream, no sugar, not for me.
I like coffee, just black coffee.

The darker the roast, the better I like it. It’s a basic thing. You can make it more complicated than it has to be, or you can learn to appreciate it’s simplicity. I don’t care what other people put in their coffee, everyone is different. I only worry about my own. Just don’t mess with mine. Sometimes all I need to keep me going is a hot cup of coffee. I have a thermos, it is a luxury I appreciate. I buy coffee I like and rarely buy coffee on the road, although I will order a cup if I stop somewhere for a bite to eat. I usually don’t stop anywhere long enough to eat. If I’m working I usually just go, do the job, and head home. I’ll eat when the work is done.
If I’m working at home, I have my coffee close at hand.

I use the same approach in what tools I use to get a job done, and this includes my choice of operating systems, and applications I use. Unlike choosing your preferred coffee blend, choosing a simple, useful, but stable operating system is not quite so easy.

My perfect setup

 A hot cup of coffee, and a laptop running one operating system with only the applications loaded  needed to get some quality work done.

How hard could that be?

Well, lately it hasn’t been as straightforward as I would like. Right off the bat, Windows 7 or 10 – both favored by large organizations, but remind me of instant coffee with too much nondairy cream and way too much artificial sweetener.
Next, up we have my rarely used MacBook Pro – great for creative inspiration, but not something I want to beat the hell out of on the road. So yes, again I lean on my Linux workhorse laptop as my go-to machine. When I’m working on a project I try to reduce any distractions. I’ll have the radio or a podcast on low in the background. I try to avoid the mainstream news/noise, it’s all goofy. I’ll stick to Linux focused news, usually not too wacky or controversial……Suddenly that illusion is dismissed.

What the heck is going on with all the “Code of Conduct” for developers?

  • Is this going to impact the future of Kernel development?
  • Is Linux’s future now sketchier than ever?
  • With Linus on “Holiday” could we see Microsoft becoming more of an “influence” in the fate of Linux?

Probably not, but there’s a change in the air. I’m not sure what it is, but it has the hint of stale coffee that means we should probably brew a fresh pot.
Now let’s turn off the background noise and get back to some less controversial productive topic.

Where was I? Oh yes, good coffee and the best work laptop setup.
I still have my Chromebook that seems to be working fine…..and fast. It’s great for much of my “non-work” work, but not so great for “work” type work. That probably doesn’t make sense to anyone other than me, but unfortunately, not everyone uses a Chromebook yet, although there’s always hope.
I wouldn’t want to limit anyone’s choices. Let each choose what works best for them. I see a lot of people still struggling with Microsoft’s Windows to do basic things a Chromebook would do with less complexity, and a would usually cost less than the new laptops they are getting frustrated with.
That’s a whole other thing.

Suddenly I just had a thought: should I give up on
Linux? Wait a minute, I thought I would forget about that as soon as I turned the radio/podcast off in the background.
Why is this bugging me now? 

Linux isn’t supposed to be political or controversial

….at least I never think of it that way. It’s just a tool to use for a multitude of tasks. For the moment I really should care less about the “CoC” controversy and more about getting some work done. The last big fuss was about Ubuntu turning into another Microsoft. How soon we forget.

Actually, I have recently started using Debian based Distros again in a feeble attempt to get away from the Ubuntu and Arch-based systems. This was more of a precautionary objective to see if I could still be productive without an Ubuntu or Arch based Distro on an underpowered laptop.
I was using Q4os on an old netbook. Had a great start, but the Trinity desktop soon was replaced by KDE. I do like the KDE approach to desktop design.

I have had a great experience with KDE Neon in the past and may return to it if I can not find a suitable replacement, however, the Q4os KDE desktop was working very nicely for me until it froze while I was trying to change the taskbar settings. Most likely attributed to my older hardware.
That was enough for me to decide to go back to the most reliable Distro I have always been able to depend on (not perfect, but it usually gets the job done)…..Mint. (Boring but stable)

Oh, what a surprise

So I guess I can’t really get away from Ubuntu completely. Apparently, the combination of Debian and Ubuntu heritage works best for my current hardware.

At least I haven’t had to regress/default back to running Windows 10. I still have choices available for what Operating system I use.

Time for another cup of coffee.

If the future of Linux development is in question? Will developers abandon ship? Who knows? (At least it hasn’t yet directly affected my pursuit of the perfect work laptop setup.)

If you prefer to use a Mac, that’s great, if you like to use Windows, that’s great too. If you use Linux, perfect! I work with them all, and there are various things about each system I like, and some I’m not too pleased with. If you drink coffee …..cheers! I don’t drink coffee to make a political statement, nor does my choice of an Operating system have any significance on my political views. Why should it? I’m even aware that not everyone drinks coffee. I hear some people even drink water straight out of the tap. Now that’s a little extreme for sure.


End of Year

It’s been an interesting year

Security alerts, Cyber threats, Fake news, and more critical patch updates than you can shake a stick at. Robots are competing in the job market, A.I is looming, and cold air from the far north is sweeping across the land.  Whether it was a good year, a bad year, or nothing too impressive, it’s just about over now. The new year is coming fast. Are you smarter than you were a year ago at this time? Hopefully, the answer is yes if you put any effort into improving your skills, knowledge, and confidence level. Now you can set down some goals for next year. You can also reflect on your hopes for next year.

New Year Goals

One of my goals is to continue to improve and refine my command line skills for both Linux and Windows. It’s the same goal every year, but I know I can continue to improve as operating systems and applications are further developed …..which is inevitable if such technologies remain relevant. Amazing enough will be the number of outdated operating systems that remain in operation. Over complex and poorly understood system designs will continue to frustrate many. Buzzwords will be bantered about as opposing views on remote vs local support, maintenance, and storage are pondered. Computer hardware and software skills will still be required in many industries, but knowing more about the core business these components support will also be crucial. Sadly this is often overlooked. If you are reading this then you most likely already know this. Will this all change next year? Probably not. Will more people drop Windows and move over to Linux and OSX? Some might, but most won’t, so you’ll still need to sharpen your “Microsoft” skills unless you’re adamantly opposed to all things “Windows”. Good luck with that. Most of the generic questions and issues techs get presented with are based in the Windows realm.

Sometimes Windows and Linux techs working together enhance each other’s skill sets and often the customer or end-user is the beneficiary.  I guess that’s a plug for “work with others” it isn’t always as painful as you may expect.

If you can navigate your way through all the “Fake News” (technology related of course) and Silo building you may encounter, plus sharpen and learn new skills, you should do well next year.

You don’t need anyone to tell you how good you are at anything. You know how good you are. That’s the bottom line. Resist the urge to speak when often it’s more productive to listen. Learn from any and all mistakes you or others may make, and try not to stress out too often. Make next year a great year whoever you are or wherever you are. Practice, practice, practice, it might just pay off in ways you don’t foresee. You can always improve your skills. The trick is to avoid wasting time and energy on the technology you’ll  never use or won’t encounter often. Distractions are everywhere. Know your strengths and weaknesses, but also be realistic about your limitations. Try to get the most out of what you already have. Your “experience” is often an asset, but getting more out of less is a skill.  Re-read some of those tech manuals that are still relevant. My best advice though will be to take a break once in a while. Enjoy all the non-tech parts of life. Take time to unplug and recharge.


Nigel’s performance Monitor for Linux (nmon)

Linux has many available tools that simply just work. That’s why I prefer it over other operating systems. I can get things done, usually faster and much simpler from a command line in a terminal, or multiple terminals.

Windows has useful and powerful shells, and I use them when I need to work on that OS, but I prefer to work in bash. I make use of simple, but elegant installation applications, most notably Apt and PacMan – depending on which of my two preferred distros I have installed. I can install simple, but powerful tools to pull out information about my system’s operation and performance.


One of my goto tools is nmon. (Nigel’s performance Monitor for Linux) – originally used by IBM and released as open source in 2009.

I wouldn’t categorize “nmon” as old school, but it sure has that vibe going on. Anything I can run in a terminal from a command line to see what is not always obvious is useful. The ability to export the data it gathers as .csv to use in a graph or for use in analyses applications is sometimes overlooked by casual users – but it’s available.

I don’t use the export function, but I expect that it might be beneficial in some situations. I mostly use nmon in the “Interactive mode” Just a quick glance at some of the output screens presents you with a lot of useful performance information.


From NMON (nmon -h) Hints:

For Data-Collect-Mode

-f            Must be the first option on the line (switches off interactive mode)

Saves data to a CSV Spreadsheet format .nmon file in the local directory

Note: -f sets a default -s300 -c288    which you can then modify

Further Data Collection Options:

-s <seconds>  time between data snapshots

-c <count>    of snapshots before exiting

-t            Includes Top Processes stats (-T also collects command arguments)

-x            Capacity Planning=15 min snapshots for 1 day. (nmon -ft -s 900 -c 96)



Although you can gather and present much data quickly,

don’t just glance at the data – really look at what it’s telling you, and if you don’t understand what you’re looking at – then look it up and find out what you may be missing.




— Toggles on/off to control what is displayed —

b   = Black and white mode (or use -b command line option)

c   = CPU Utilization stats with bar graphs (CPU core threads)

C   = CPU Utilization as above but concise wide view (up to 192 CPUs)

d   = Disk I/O Busy% & Graphs of Read and Write KB/s

D   = Disk I/O Numbers including Transfers, Average Block Size & Peaks (type: 0 to reset)

g   = User Defined Disk Groups            (assumes -g <file> when starting nmon)

G   = Change Disk stats (d) to just disks (assumes -g auto   when starting nmon)

h   = This help information

j   = File Systems including Journal File Systems

J   =  Reduces “j” output by removing unreal File Systems

k   = Kernel stats Run Queue, context-switch, fork, Load Average & Uptime

l   = Long term Total CPU (over 75 snapshots) via bar graphs

L   = Large and =Huge memory page stats

m   = Memory & Swap stats

M   = MHz for machines with variable frequency 1st=Threads 2nd=Cores 3=Graphs

n   = Network stats & errors (if no errors it disappears)

N   = NFS – Network File System

     1st NFS V2 & V3, 2nd=NFS4-Client & 3rd=NFS4-Server

o   = Disk I/O Map (one character per disk pixels showing how busy it is)

     Particularly good if you have 100’s of disks

q   = Quit

r   = Resources: Machine type, name, cache details & OS version & Distro + LPAR

t   = Top Processes: select the data & order 1=Basic, 3=Perf 4=Size 5=I/O=root only

u   = Top Process with command line details

U   = CPU utilization stats – all 10 Linux stats:

     user, user_nice, system, idle, iowait, irq, softirq, steal, guest, guest_nice

v   = Experimental Verbose mode – tries to make recommendations

V   = Virtual Memory stats



I find the info useful and sometimes will set up multiple terminals using Terminator.

You may find NMON useful, and a good tool to see what’s going on behind the scenes on your LINUX system.

Resource monitor

Linux type solutions on Windows

The “Microsoft” Ubuntu command line “App”

Sometimes you find yourself working on a Windows-based machine, have to perform a quick task that might normally be very straightforward on a LINUX machine, and you don’t want to spend too much time fumbling through the GUI pointing and clicking until you stumble across what you’re looking for.
My first gut instinct usually is to get to the command line quickly and work from there.
I installed the “Microsoft” Ubuntu command line “App” on a Windows 10 test machine recently hoping it would become the perfect solution to such situations, but it has been a disappointing experience so far. Maybe I’ll have a better opinion after I spend more time with it, but I doubt I’ll see this installed on too many machines I run into – at least for a while. Luckily Windows command line tools are pretty robust – especially PowerShell.

As a side note, I really find Sysinternals very useful as a nice set of tools for some very interesting challenges you might run into while doing some diagnostic investigation on problematic systems.
For the most part, Windows usually has some nice built-in diagnostic tools – if you know where to look and can find them in a timely manner.

I had a question come up recently about port connections. Usually, I suggest Wireshark as a go-to tool for any supporting operating system, but this situation was for a system that did not have it available – disregarding the fact that you might or might not have the ability to monitor the packet traffic with a tap or port forwarding access via a test laptop. The discussion was on using the computer in question for any diagnostics – and of course, it wasn’t a LINUX machine. Anyhow, here’s a few ideas I floated for such situations – try a few if you haven’t already and see what you think.

Finding port connections in Windows

Use Wireshark to parse out port numbers by adding Destination and Source port columns for both TCP and UDP port numbers. Under each corresponding Wireshark header right-click on destination/source and apply as a column. Edit the name to differentiate between UDP or TCP.
Filtering for a specific protocol number is just as straightforward.
tcp.dstport == 80
tcp.srcport == 80




If you’re a fan of Sysinternals you may find TCPView a nice alternative to monitor your PC’s connections – close to a real-time view of connections made and unmade.





Either from the basic Windows CMD or from within Powershell “netstat” similar to its LINUX long-lost cousin is a simple and quick way to view connection status.






While you’re working in Powershell, check out network connections with Get-NetTCPConnection.





If your set on using the GUI on Windows, the “Resource Monitor” Network – Listening Ports works quite well.

Resource monitor






Back on Linux, you can run netstat, lsof, ss, or nmap.
Each has many options and allow you to customize your scans.
Here a few quick checks:

netstat -a | grep CONNECTED


lsof -i


ss | less

You could always load nmap and scan your own local ports as an alternative port check.

%d bloggers like this: