Enable Docker Remote API in Redhat 7 (CentOS 7)

Tried different ways to enable the Remote API, never get any luck on anything… But finally, here is what I did, that works!

Here is my docker content:

Add ‘-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock’ in the ‘OPTIONS’:

Then restart your docker daemon by systemctl restart docker Test:

  Done~ This only enables…


Ternary Operator in PowerShell

I’m very noob .Net C# developer, but I remember this: <compare> ? <value of true> : <value of false> (a == ‘a’ ) ? 1 : 2 I want the same thing in PowerShell, here we go:

Sample:

Which I came up with a more readable and something easy to memory:

 …


PowerShell – Multidimensional arrays in PowerShell

You may have some arrays like this:

Then you may want to combine them together:

But unfortunately it’s not simple like this… You will get:

Suppose to be 2, right? Why it’s 6… Let’s identify…

But what I want it to be is $School contains $year1 and $year2, and $year1 contains…


How to convert string to Base64 and vice versa using Powershell

Working with Consul without UI is the correct way to go, which also help you with the productivity!!! (True?, hahaha~~)   Anyway, I’m not allowed to have a UI for it, come down to have read the correct value and make sure it’s the one we want it to be in there, I need to…


Send email via PowerShell

I need to send a large number (more than 100) emails to my wife for her needs. She has a folder that contains tones pdf files, needs to be send to an email address one file per email. So I created this script to send the mail… For sure you need to modify this if…