Friday, July 22, 2022

Python: Convert string to and from base64 format

Python: Convert string to and from base64 format

Base64 encoding is a format that can be used for data transfer in HTML or general data representation as you don't need to escape it. To convert a stream of byte object to base64 and vice versa, use the following example.

Sunday, July 17, 2022

CPP: Windows: Get logical drives

CPP: Windows: Get logical drives

Retrieves a bitmask representing the currently available disk drives.

Notes:
- Tested using Visual Studio 2022 C++ Windows Console template
Reference(s):
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlogicaldrives

Saturday, May 14, 2022

Disable IPv6 from the command line

Disable IPv6 from the command line

PS C:\>New-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -Name DisabledComponents -Value 0xFF -PropertyType DWord

To verify that it was updated:
PS C:\>Get-Item HKLM:SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters

Keywowrds: Windows IPv6 disable

Quick Tip: Disable Windows Firewall from the command line

Disable Windows Firewall from the command line

Using elevated command prompt, run:

c:\> netsh advfirewall set allprofiles state off

Keywords: Windows Firewall netsh
Reference(s):
http://techgenix.com/quicklyturnonoffwindowsfirewallusingcommandline/

Sunday, May 08, 2022

Allow external clients to connect to minikube service

Allow external clients to connect to minikube service

Say you have a minikube cluster, you can use this minikube start tutorial as a reference, how can external applications or clients connect to it? You can run the following to expose balanced service (for example):
$: kubectl port-forward --address 0.0.0.0 service/balanced 8080:8080

Refs:
https://stackoverflow.com/questions/64881583/how-to-access-external-service-using-the-minikube-hosts-public-ip-address
Keywords: Kubernetes k8s minikube port forward

Enable Copy/Paste using VMware Remote Console

Enable Copy/Paste using VMware Remote Console

VMware ESXi 6.5 disables copy/paste functionality by default for security reasons. If the security implications are acceptable, copy/paste funcationality can be enabled on per VM basis. It should be possible to change it at the host level but that will be for another post.

Follow the following steps to allow copy/paste:

  • Power down the VM
  • Do Actions | Edit Settings
  • In Edit Settings window, look for Edit Configuration button
  • Add the following parameters
    Key Value
    isolation.tools.copy.disable FALSE
    isolation.tools.paste.disable FALSE
    isolation.tools.setGUIOptions.enable TRUE

  • Power up the VM

Refs:
https://kb.vmware.com/s/article/57122
Keyworks: VMware copy paste vmrc Remote Console

Hello world assembly on x86 Linux

Hello world assembly on x86 Linux Save code below as hello.asm global _start section .data message: db 'hello, world!', 10 secti...