Posts

Showing posts from September, 2020

Digital Marketing

Change the default shell for OpenSSH in Windows

The default shell used by Windows OpenSSH server is the Windows command shell. Configuring the default ssh shell is done in the Windows registry by adding the full path to the shell executable to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH in the string value DefaultShell. The following Powershell command sets the default shell to be PowerShell.exe: New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force

Find the location of an executable in Windows

goyun@dev C:\Users\goyun>where ping C:\Windows\System32\PING.EXE goyun@dev C:\Users\goyun>where powershell.exe C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe goyun@dev C:\Users\goyun>where powershell-ise.exe INFO: Could not find files for the given pattern(s). In powershell use where.exe, Get-Command (or its abbreviation gcm), as where is the default alias for Where-Object. PS C:\Users\goyun> Get-Command powershell.exe CommandType     Name                                               Version    Source -----------     ----                                               -------    ------ Application     powershell.exe                                     10.0.19... C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe PS C:\Users\goyun> gcm powershell.exe CommandType     Name                                               Version    Source -----------     ----                                               -------    ------ Application     powershell.exe       

Start the Windows PowerShell ISE

Click Start, select Windows PowerShell, and then click Windows PowerShell ISE. Alternately, you can type powershell_ise.exe in any command shell or in the Run box.

Add current instance IP into security group with AWS cli

GlassFish Server default password

An administration user name and password: The default user name is admin , and by default no password is required.

Set the default user for WSL in Windows 10

ubuntu config --default-user new_user_name Or ubuntu2004 config --default-user new_user_name Or opensuse-42 config --default-user new_user_name Or sles-12 config --default-user new_user_name

Windows wsl ubuntu exe location

For example: C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps ubuntu2004.exe or  ubuntu.exe

Debug public key authentication for OpenSSH server on Windows

Stop the sshd service Open a PowerShell console with administrator privileges Type 'sshd -d' Try login from my client machine The public key needs to be  C:\ProgramData\ssh\administrators_authorized_keys This file needs special permissions. Only system user and administrators group must have access to it. To remove other users from accessing this file, you may need to  Right click  administrators_authorized_keys  , go to Properties -> Security -> Advanced Click "Disable inheritance"; Choose "Convert inherited permissions into explicit permissions on this object" when prompted;

Create a new disk from snapshot in Azure portal

Create the Disk from a Snapshot disk from Portal using following link. https://portal.azure.com/#create/Microsoft.ManagedDisk Choose snapshot as the source.

Create a snapshot using the Azure portal

To create a snapshot, complete the following steps: On the Azure portal, select Create a resource. Search for and select Snapshot. In the Snapshot window, select Create. The Create snapshot window appears. Enter a Name for the snapshot. Select an existing Resource group or enter the name of a new one. Select an Azure datacenter Location. For Source disk, select the managed disk to snapshot. Select the Account type to use to store the snapshot. Select Standard_HDD, unless you need the snapshot to be stored on a high-performing disk. Select Create.
Get the latest version of  Azure Storage Explorer To copy a disk:  From the Disks dropdown on the left, select the resource group that contains the disk you want to copy. On the right pane, select the disk you'd like to copy and select Copy. On the left pane, select the resource group you'd like to paste the disk in. Select Paste on the right pane. In the Paste Disk dialog, fill in the values.

Rename disk in the Azure Portal

Create a copy of the OS Disk with the desired name ( assuming you are using managed disks ). Swap the OS disk for the VM. Start the VM. Delete the old OS disk.

Create a Windows Desktop Spot VM on Azure Example

az group create -n spotGroup -l canadacentral az vm create \     --resource-group spotGroup \     --name dev \     --image MicrosoftWindowsDesktop:Windows-10:rs5-pron-g2:17763.1457.2009030514 \     --admin-username azureuser \     --generate-ssh-keys \     --priority Spot \     --max-price -1 \ --eviction-policy Deallocate        --image                        : The name of the operating system image as a URN alias, URN,                                      custom image name or ID, custom image version ID, or VHD blob                                      URI. This parameter is required unless using `--attach-os-                                      disk.` Valid URN format: "Publisher:Offer:Sku:Version".  Values                                      from: az vm image list, az vm image show.

Azure az cli Virtual Machine image type

['CentOS', 'CoreOS', 'Debian','openSUSE-Leap', 'RHEL', 'SLES', 'UbuntuLTS', 'Win2019Datacenter', 'Win2016Datacenter', 'Win2012R2Datacenter', 'Win2012Datacenter', 'Win2008R2SP1'].

Azure Region location data

# Azure CLI 2.0 az account list-locations | tee azure_regions.json [   {     "displayName": "East US",     "id": "/subscriptions/02c62ea7-4a6c-486b-9121-67afd91365e1/locations/eastus",     "metadata": {       "geographyGroup": "US",       "latitude": "37.3719",       "longitude": "-79.8164",       "pairedRegion": [         {           "id": "/subscriptions/02c62ea7-4a6c-486b-9121-67afd91365e1/locations/westus",           "name": "westus",           "subscriptionId": null         }       ],       "physicalLocation": "Virginia",       "regionCategory": "Recommended",       "regionType": "Physical"     },     "name": "eastus",     "regionalDisplayName": "(US) East US",     "subscriptionId": null   },   {     "

Install GUI on AWS EC2

Run the following command to list down the available package groups for your EC2. # yum group list $ yum group list Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 230 packages excluded due to repository priority protections Installed Environment Groups:    Cinnamon Desktop    MATE Desktop Installed Groups:    Cinnamon    Fonts    Input Methods    MATE Available Groups:    AWS Tools    Backup Client    Console internet tools    Development Tools    E-mail server    Educational Software    Electronic Lab    Fedora Packager    General Purpose Desktop    Graphical Administration Tools    Graphics Creation Tools    Hardware monitoring utilities    Haskell    Internet Applications    KDE Desktop    LXQt Desktop    Milkymist    Network Infrastructure Server    Networking Tools    Office Suite and Productivity    Performance Tools    Scientific support    Smart card support    System administration tools    Technical Writing    TurboGears application framework    Web Se

Docker-based IDE

  openkbs/knime-vnc-docker (VNC/NoVNC) openkbs/knime-docker (X11/Desktop) openkbs/vscode-docker-x11 (X11/Desktop)) openkbs/atom-docker openkbs/eclipse-oxygen-docker openkbs/eclipse-photon-docker openkbs/eclipse-photon-vnc-docker openkbs/intellj-docker openkbs/intellj-vnc-docker consol/ubuntu-xfce-vnc openkbs/eclipse-photon-vnc-docker openkbs/netbeans10-docker openkbs/netbeans openkbs/papyrus-sysml-docker openkbs/pycharm-docker openkbs/rapidminer-docker openkbs/scala-ide-docker openkbs/sublime-docker openkbs/webstorm-docker openkbs/webstorm-vnc-docker Sqlectron SQL GUI at openkbs/sqlectron-docker Mysql-Workbench at openkbs/mysql-workbench PgAdmin4 for PostgreSQL at openkbs/pgadmin-docker

Remove all docker images at once

To remove all images there is a simple command to do that.  docker rmi $(docker images -q)

Grant read-only permission to the MySQL user.sql

Script to detect Ubuntu Version

Push Git Tag to Remote

The git tag command creates a local tag with the current state of the branch. When pushing to a remote repository, tags are NOT included by default. It is required to explicitly define that the tags should be pushed to remote. Push all tags to remote: $ git push origin --tags Push a single tag to remote: $ git push origin <tag_name> Git 2.4 has added the push.followTags option to turn that flag on by default which you can set with: git config --global push.followTags true or by adding followTags = true to the [push] section of your ~/.gitconfig file. Only push annotated tags to the remote, and keep lightweight tags for local development to avoid tag clashes.

Proxy Auto-Configuration (PAC) file Example

function FindProxyForURL ( url , host ) { var useSocks1088 = [ "192.168.3.5" ] ; var useSocks1080 = [ "anotherJenkins:8443" ] ; for ( var i = 0 ; i < useSocks1088 . length ; i ++ ) { if ( shExpMatch ( host , useSocks1088 [ i ] ) ) { return "SOCKS localhost:1088" ; } } for ( var i = 0 ; i < useSocks1080 . length ; i ++ ) { if ( shExpMatch ( host , useSocks1080 [ i ] ) ) { return "SOCKS localhost:1080" ; } } return "DIRECT" ; //return "SOCKS localhost:1088"; } https://gist.github.com/goyuninfo/10e50ffa652d04ec9c14b7c80551b39e