Browsed by
Author: minu

Happy Spring Equinox!

Happy Spring Equinox!

March 20, 2021 is the Spring Equinox! For those who are interested, this is the time of the year when night and day are in equilibrium and share the same amount of hours, the good old mother nature brings balance to our light and sun exposure.

To add on top of this good news, the sun is shining and there is not a single cloud on the sky to prevent proper Vitamin D intake as long as you are outside. I live in an apartment which has outside walls made entirely out of glass so I’m asking my friend Google “how is the weather”.

Glass walls can play “mind tricks”, even if it is -20 outside, in the apartment there is 30 degrees. 

Owww Lord!, it returns 8 degrees Celsius! Perfect time to go outside, sit in the sun, read a book and just do nothing, and it is doable, since it is Saturday! Hell yeah!

Fast forward a half an hour later and I’m on a bench, soaking all the good UV rays and getting the much needed Vitamin D. I have chosen Toronto Music Garden for my spot, the place is important so you could have an overview on how the waterfront looks like. Just Google it! or watch the image at the top 🙂

So while being more or less focused on my reading I hear a kid cry like he is having a tantrum or something and the entire action catches my attention (the mom was hot). It appears the kid(I’m guessing he is 3 or 4) has lost his ball in the water and mom was trying to tell him that the firefighters are going to retrieve it.(just some small lies :), they are not going to give the ball back)

No point of telling you that he does not listen to reason and the crying continues with little to do but just cry and watch as his ball drifts further into the harbor.

Well Mother Nature provides again and a little bit of a wind gust, brings the ball closer to the shore and with this happy event Ben, who is a friend of the mother’s, is able to catch it with a hook and get the ball back to the crying kid.

I was just a bystander to the entire scene, which took around 5 minutes, but the look on the kid’s face once he got his ball back was like a MasterCard commercial, PRICELESS!  

To break it down in actions: 

Mom: It is alright Luke(I had to give him a name), the firefighters are going to get it back! 

Kid: Crying out loud, Noooooo!..venturing closer to the water and looking at the drifting ball.

Mom: Runs and catches him, You have nothing to worry, the firefighters are going to get it back! 

Kid: I want it back!…more heavy crying….I want it now! 

Mom: Look!…Ben is going to get it! 

“Ben, has found a long hook which is used to give to people who fall into the water to hold to and is cleverly tapping the ball closer to the shore”

Kid: Continues crying but there are some hope stops along the way! 

Mom: Keeps him still, while Ben attempts to get the ball back!

….

Ball is recovered and handed back to Luke who at the blink of an eye goes from heavy tears to a smile as big as the whole world!

Mom: Say thank you to Ben! 

Kid: Thank you Ben! (It was a mechanical thank you, there was no recognition on Ben’s attempt, the ball is back and that is the only thing that matters)

In my own dark mind, just for a little bit of “drama humour”,  I wanted the kid to throw the ball back into the water :)) and see everyone’s faces, but that did not happen…oh well, next time! 

So moral of the story, there is no moral of the story! but the kids’ change of moods put a big smile on my face and I hope this “article”, on yours.

How to copy a file in Vi

How to copy a file in Vi

There was a joke who spread at one moment, regarding how to generate secure passwords and it was something like this:

“Want to generate a secure password?..take a developer inside Vim and ask him to exit”

It goes without saying that Vi or Vim are text editors which are used quite often on Linux servers and with Cloud Computing nowadays being pretty much the norm, a lot more people interact with those machines in one way or another. 

So here I am in the shoes of the previous developer trying to copy a configuration file from one machine to another. I have a “black belt” in googling stuff but a white one in Vi so “how to select everything in Vi” returns the ggVG combination.

Since I actually needed to copy to clipboard and the length of the config file was longer than what my screen was able to show, it only produced “undesirable” (not all the lines) content.

For those in need of something similar and want to copy the entire content of a file in vi/vim there is an workaround/think outside the box approach:

Don’t use Vi/Vim, use the cat command and select the content using the mouse. Or at least this approach worked for me.

Windows 10 SSH

Windows 10 SSH

Microsoft Windows has come a long way since 95 and I think Windows 10 is the best iteration, with this one going the “as a service” implementation route. To cut to the chase if you are someone who has to use SSH to connect to servers you can now do it natively from inside PowerShell or CMD. (I know, I know, PuTTY is always there to save the day 😛 )

To check if the computer has the version of Windows 10 which already has the SSH client configured, all you have to do is type “ssh” inside PowerShell and if you see the same output as in the image below you are good to go!

In a real world scenario, if you want to connect to a Virtual Machine, say an EC2 Instance in AWS, you will have to meet two conditions:

  1. Make sure that the key you have is in OpenSSH format (puTTYgen to the rescue in case you want to convert a ppk)

2. Make sure that the key file has the appropriate permissions. To do this from the ui you can follow these steps

Right click on the file->Go to Security->Advanced->Disable inheritance-> Select the first option “Convert inherited permissions…”-> Remove all the other accounts that you find in the permissions tab and only leave the account that you use. Make sure that the same account is the owner of the file.

Goodbye 2020, Hello 2021!

Goodbye 2020, Hello 2021!

It is the beginning of a new year and for those who want to be inspired, I will share with you a video from one of Mark Rober’s Ted Talks, a video which is from 2015 but one which has a point that I think was valid then, it is valid now and will forever be valid. 

Happy New Year! 

Wishing you to be creative, to work hard and to get lucky! 

Random thought #1

Random thought #1

So, the martial stability can be predicted by the result of the following formula:

  • frequency of lovemaking minus frequency of quarrels

If the result is negative there might be blood.

I guess this can be the origin of “not giving a fuck” so we should start to give more fucks and when there are no more fucks to give, just fuck! 🙂

It is for our own happiness!

Have a great day y’all!

How do I ?

How do I ?

My code editor of choice is Visual Studio Code and so far I found it very useful. It also has a PowerShell extension so I can run my scripts directly from within the Code Editor.

VS Code has a lot of themes from which you can choose but I prefer one theme for the editor and the classic blue and white theme for the terminal.

So if you are like me, you can quickly change the aspect of the terminal by:

  • Open the User Settings (Ctrl + , )
  • Go to Workbench->Appearance->Color Customization and click on “Edit in settings.json
  • Add the code below:
workbench.colorCustomizations": {
    "terminal.foreground": "#FFFFFF",
    "terminal.background": "#012456"
 }

Welcome 2020 and Happy New Year!

Welcome 2020 and Happy New Year!

I think a lot of people like round numbers and 2020 looks to me, quite round, it even has two “circles” it 🙂

On a more serious note, I saw in a book I’m reading, a reference about this and made me think about the “Banana tapped to the wall” which was sold as a form of art for about 120.000 dollars.

So what is art? Is beauty really in the eye of the beholder?

Well I don’t really know what art is but I think this was highly overpriced and for those on a tighter budget, I have created a masterpiece that I’m going to sell for the exact (round)amount of 0 zero dollars. (Or maybe I’ll give it away for free…who knows, I’ve not decided yet).

PS: Let me know if your nose is runny!

Office 365 tip of the day

Office 365 tip of the day

As an “IT Firefighter” there comes a time when you have to recreate an Outlook profile. In Office 365, the default behaviour for Microsoft Outlook is to run in “Cached Exchange Mode” and only download emails which are 1 year old, however, if you have a large mailbox, it can take hours until Outlook’s status becomes “All folders are up to date”.

While the update process is running and emails are getting downloaded, new emails might not show up in inbox so in order to slightly improve the update process you can:

  • Go to “Send / Receive” and click on “Work Offline” button , wait a second and click back on it. (This will trigger the download process and get the latest emails from the mailbox.) These steps should be repeated every time you want to get the newest emails until, status is “All folders are up to date”

The calendar might be the last one to update so to force the download of the latest meeting you can:

  • Click on the calendar icon
  • Go to “Send / Receive” and click “Update Folder”

Another workaround is to just use Outlook Web App while Outlook downloads the emails.

Peace Out!

Create a VPN Connection and change its settings with PowerShell. Windows 10

Create a VPN Connection and change its settings with PowerShell. Windows 10

I had to deploy a VPN connection in an environment which looks like this:

  • Domain Controller is hosted on a Virtual Machine in Azure
  • Using an Azure Virtual Network Gateway
  • Point-to-site configuration uses RADIUS authentication.

I accomplished this using the Windows administrator’s best friend, PowerShell.

The prerequisites for these are:

  • Get the VPN server IP/DNS
  • Make sure computers are using PowerShell 3.0

The Powershell script to deploy a VPN connection would look like this:

#Set Variables for the VPN connection
$VPNconnectionName = "New VPN"
$SRVaddress = "auzrevpn.azure.com"
$dnssuf = "contoso.com"

#Create the VPN connection
Add-VpnConnection -Name $VPNconnectionName -ServerAddress $SRVaddress -TunnelType Sstp -AuthenticationMethod Eap -EncryptionLevel Required -AllUserConnection -SplitTunneling -IdleDisconnectSeconds 900 -DnsSuffix $dnssuf

#Get the content from the phone book
$contain = Get-Content -Path "$env:ProgramData\Microsoft\Network\Connections\Pbk\rasphone.pbk" -Raw

#Change the connection phone book content to add the internal DNS entries  
if ($contain.Contains("IpDnsAddress=0.0.0.0")){
($contain) -replace 'IpDnsAddress=0.0.0.0','IpDnsAddress=192.168.1.4' -replace 'IpDns2Address=0.0.0.0','IpDns2Address=192.168.1.10'-replace 'IpNameAssign=1','IpNameAssign=2'| Set-Content "$env:ProgramData\Microsoft\Network\Connections\Pbk\rasphone.pbk"
}