Create a resource group in Azure to hold all of the resources you'll be creating:
- Virtual Network
- Virtual Machines
- Don't use 172.* IPs. I used 10.3.0.0/24
| """ | |
| Generate the password hashes / verifiers for use in PostgreSQL | |
| How to use this: | |
| pw = EncryptPassword( | |
| user="username", | |
| password="securepassword", | |
| algorithm="scram-sha-256", | |
| ) |
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| //function types | |
| type mapf func(interface{}) interface{} |
| [{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375"," |
| In this post, .net platform has this pinvoke mechanism where it is allowed that you call into the Native windows . | |
| this is extremely useful when you have some 3rd party libraries or if you try to program against with the low-level windows APIS. | |
| One of the typic application htat utilize the Lowe-level windows apis are those Native win32 applications. Where you creat a message pump with the necessary WNDCLASSEX to represent/register the window message pump and message handler process. What you will deal with the win32 applications include the following. | |
| RegisterClassEx, CreateWindowEx, GetMessage(), TranslateMesage(), and DispatchMessage(...). | |
| to be able to use the Window API, you have to declare tons of Structure and PInvoke Method, while you can find help from the Pinvoke.Net. | |
| First, we will introduce some of the win32/user32 functions and their relative structure definitions. |
| $ComputerName = "New Name" | |
| Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" | |
| Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" | |
| Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\Computername" -name "Computername" -value $ComputerName | |
| Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername" -name "Computername" -value $ComputerName | |
| Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" -value $ComputerName | |
| Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" -value $ComputerName | |
| Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -name "AltDefaultDomainName" -value $ComputerName |
| <# | |
| .SYNOPSIS | |
| Tests if a web application exists (this can be a site or application). | |
| This was only written to keep naming conventions consistent. This is the same as | |
| Test-Path IIS:\Sites\$SiteName; | |
| .PARAMETER Url | |
| The url of the match on |
| <?php | |
| function getRealIpAddr() | |
| { | |
| if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) | |
| { |
| # escape=` | |
| # Image with NET CORE installation to extract executables for final image | |
| FROM microsoft/aspnetcore:2.0.0-nanoserver As CoreBuild | |
| # Middleware image used to extract ASP.NET core module | |
| From microsoft/iis as WindowsBuild | |
| SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Continue'; $verbosePreference='Continue';"] | |
| # Installing NET CORE webhosting in middleware image so latest module and configuration schema is extracted for final image | |
| ADD https://download.microsoft.com/download/B/1/D/B1D7D5BF-3920-47AA-94BD-7A6E48822F18/DotNetCore.2.0.0-WindowsHosting.exe ".\hosting.exe" |
| [ | |
| { | |
| "name": "Afghanistan", | |
| "dial_code": "+93", | |
| "code": "AF" | |
| }, | |
| { | |
| "name": "Aland Islands", | |
| "dial_code": "+358", | |
| "code": "AX" |