Thursday, July 27, 2017

Human Behavioral Patterns and Fundamentalism


"Once you have understood what forgiveness truly is according to the Bible, all of the Ten Commandments will perfectly and logically align with each other, and everything will make sense, especially the meaning of 'love' in 'love your enemy'."


Analysing recurring patterns are very important when observing people. Once you put those patterns down to their fundamentalist behaviours that will never change, you get to predict the next steps that person will most likely do. Fundamentalists rarely, if ever, will go outside of their behaviour.

For example, in a fictional story Les Misérables that mirrors the society and specific human behaviours, you will never expect a person like Javert to do something that Val jean will do. Javert's upbringing and fundamentalist thinking "boxed" him into a specific predictability. Val jean, on the other hand, is a counter-fundamentalist so to speak: always questions his actions if he is right, always reflects what could have been done otherwise, always checks his conscience, always strives to right what was done wrong. In this way, Val jean is changing and cannot be "boxed" into a fundamental set of behaviours.

I used to think when I was in college that the song "Stars" upheld the law and justice of the heaven. It took me years listening to numerous versions of the music, and eventually the movie musical, to refine my observations and realize that such a song is the embodiment of fundamentalism. And as with Javert, with all the wrong interpretations of heavenly punishment, one can later realize that every single justice that was done was not punishment, but rather an act of kindness and consolation to the people who have sinned yet continues to struggle to right their wrong. Thus bringing to the truth that God truly loves his people, and the extent of sacrifice and restraint he has done is too immense to put in human words. Only in the last days man will be judged.

We have been brought up in a culture that "forgiving" is synonymous to "forgetting", while totally ignoring the fact that forgiveness is giving the chance for the sinner to pay for his sins, and for the trespassed to take the "effort" to ask the sinner to pay...in other words, to show love to the sinner because you are giving the chance for the sinner to be forgiven. I'll expound on this realization in a different article to avoid going off on a tangent, but suffice it to say: once you have understood what forgiveness truly is according to the Bible, all of the Ten Commandments will perfectly and logically align with each other, and everything will make sense, especially the meaning of "love" in "love your enemy". The forgiving will truly understand what forgiveness is, and will be able to sleep well at night knowing that the commandments all makes perfect sense. You will never be forgiven for your own sins if you don't give others the opportunity to be forgiven. And with what Val jean had done in his life, his sin of stealing is not really a sin if you only look at the context, unlike what Javert fundamentally thought of.

What I'm trying to put forward here is that there is a way to know good people to the core, and to separate them from vindictive people, by knowing their fundamentalist ideals and thus their predictable patterns of behaviour.

My next article will be about how to forgive; however, please bear in mind that these ideas are not my own. Truly, there are kind and selfless people in this world who painstakingly took most of their time and effort to learn and piece these together, in order to give sense and clarity to these topics that seemed impossible and illogical to do.

Although my article is not meant to be denominational, one good observation of Javert can also be found in this article.

Monday, January 16, 2017

SharePoint Server 2016 Dev/Test Environment in Azure

Original Article Summary: Create a single-server SharePoint 2016 dev/test farm in Microsoft Azure infrastructure services.

The purpose of this blog is to help you avoid copy-pasting each and every code snippet in the original article, and to facilitate a single script flow of commands. Hopefully this will cut down your time in accomplishing the tasks. I've added some codes and comments as necessary that may help you navigate the article and resolve some of the possible issues you may encounter.



### Follow: https://technet.microsoft.com/library/mt723354(v=office.16).aspx ###

##AD VM##

# Bypass proxy
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
Login-AzureRMAccount

# Select subscription
$subsopt = Get-AzureRMSubscription | Sort SubscriptionName | Select SubscriptionName
$subscr=$subsopt[1].SubscriptionName #change index to selection
Get-AzureRmSubscription -SubscriptionName $subscr | Select-AzureRmSubscription

# Create resource group
Get-AzureRMResourceGroup | Sort ResourceGroupName | Select ResourceGroupName
$rgName="DEVRESGRP0" #change name to unique
$locName="Southeast Asia" #change to available location
New-AzureRMResourceGroup -Name $rgName -Location $locName

# Create storage account
Get-AzureRMStorageAccount | Sort StorageAccountName | Select StorageAccountName
Get-AzureRmStorageAccountNameAvailability "devstore20"  #change name to unique, lowercase
$saName="devstore20"
New-AzureRMStorageAccount -Name $saName -ResourceGroupName $rgName -Type Standard_LRS -Location $locName

# Create virtual network, subnet, and security group
$locShortName="southeastasia" #get this from translated $locName
$spSubnet=New-AzureRMVirtualNetworkSubnetConfig -Name SP2016Subnet -AddressPrefix 10.0.0.0/24
New-AzureRMVirtualNetwork -Name SP2016Vnet -ResourceGroupName $rgName -Location $locName -AddressPrefix 10.0.0.0/16 -Subnet $spSubnet -DNSServer 10.0.0.4
$rule1=New-AzureRMNetworkSecurityRuleConfig -Name "RDPTraffic" -Description "Allow RDP to all VMs on the subnet" -Access Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 3389
$rule2 = New-AzureRMNetworkSecurityRuleConfig -Name "WebTraffic" -Description "Allow HTTP to the SharePoint server" -Access Allow -Protocol Tcp -Direction Inbound -Priority 101 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix "10.0.0.6/32" -DestinationPortRange 80
New-AzureRMNetworkSecurityGroup -Name SP2016Subnet -ResourceGroupName $rgName -Location $locShortName -SecurityRules $rule1, $rule2
$vnet=Get-AzureRMVirtualNetwork -ResourceGroupName $rgName -Name SP2016Vnet
$nsg=Get-AzureRMNetworkSecurityGroup -Name SP2016Subnet -ResourceGroupName $rgName
Set-AzureRMVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name SP2016Subnet -AddressPrefix "10.0.0.0/24" -NetworkSecurityGroup $nsg

# Get the Azure storage account name
$sa=Get-AzureRMStorageaccount | where {$_.ResourceGroupName -eq $rgName}
$saName=$sa.StorageAccountName

# Create an availability set for domain controller virtual machines
New-AzureRMAvailabilitySet -Name dcAvailabilitySet -ResourceGroupName $rgName -Location $locName

# Create the domain controller virtual machine
$vnet=Get-AzureRMVirtualNetwork -Name SP2016Vnet -ResourceGroupName $rgName
$pip = New-AzureRMPublicIpAddress -Name adVM-NIC -ResourceGroupName $rgName -Location $locName -AllocationMethod Dynamic
$nic = New-AzureRMNetworkInterface -Name adVM-NIC -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id -PrivateIpAddress 10.0.0.4

$avSet=Get-AzureRMAvailabilitySet -Name dcAvailabilitySet -ResourceGroupName $rgName
$vm=New-AzureRMVMConfig -VMName adVM -VMSize Standard_D1_v2 -AvailabilitySetId $avSet.Id

$storageAcc=Get-AzureRMStorageAccount -ResourceGroupName $rgName -Name $saName
$vhdURI=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds/adVM-SP2016Vnet-ADDSDisk.vhd"
Add-AzureRMVMDataDisk -VM $vm -Name ADDS-Data -DiskSizeInGB 20 -VhdUri $vhdURI  -CreateOption empty
$cred=Get-Credential -Message "Type the name and password of the local administrator account for adVM."

$vm=Set-AzureRMVMOperatingSystem -VM $vm -Windows -ComputerName adVM -Credential $cred -ProvisionVMAgent -EnableAutoUpdate
$vm=Set-AzureRMVMSourceImage -VM $vm -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2012-R2-Datacenter -Version "latest"
$vm=Add-AzureRMVMNetworkInterface -VM $vm -Id $nic.Id
$osDiskUri=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds/adVM-SP2016Vnet-OSDisk.vhd"
$vm=Set-AzureRMVMOSDisk -VM $vm -Name adVM-SP2016Vnet-OSDisk -VhdUri $osDiskUri -CreateOption fromImage
New-AzureRMVM -ResourceGroupName $rgName -Location $locName -VM $vm -DisableBginfoExtension

# Before: adVM\devadmin

# adVM Server:
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools
Install-ADDSForest -DomainName corp.contoso.com -DatabasePath "F:\NTDS" -SysvolPath "F:\SYSVOL" -LogPath "F:\Logs"

# After adVM installation of domain controller and DNS server: CORP\devadmin

# adVM Server:
Add-WindowsFeature RSAT-ADDS-Tools
New-ADUser -SamAccountName sp_farm_db -AccountPassword (read-host "Set user password" -assecurestring) -name "sp_farm_db" -enabled $true -PasswordNeverExpires $true -ChangePasswordAtLogon $false

##SQL VM##

# Log in to Azure
Login-AzureRmAccount

# Set up key variables
$subscrName=$subscr
$dnsName="devsql"

# Set the Azure subscription
Get-AzureRmSubscription -SubscriptionName $subscrName | Select-AzureRmSubscription

# Get the Azure storage account name
$sa=Get-AzureRMStorageaccount | where {$_.ResourceGroupName -eq $rgName}
$saName=$sa.StorageAccountName

# Create an availability set for SQL Server virtual machines
New-AzureRMAvailabilitySet -Name sqlAvailabilitySet -ResourceGroupName $rgName -Location $locName

# Create the SQL Server virtual machine
$vmName="sqlVM"
$vmSize="Standard_D3_V2"
$vnet=Get-AzureRMVirtualNetwork -Name "SP2016Vnet" -ResourceGroupName $rgName

$nicName=$vmName + "-NIC"
$pipName=$vmName + "-PublicIP"
$pip=New-AzureRMPublicIpAddress -Name $pipName -ResourceGroupName $rgName -DomainNameLabel $dnsName -Location $locName -AllocationMethod Dynamic
$nic=New-AzureRMNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id -PrivateIpAddress "10.0.0.5"
$avSet=Get-AzureRMAvailabilitySet -Name sqlAvailabilitySet -ResourceGroupName $rgName
$vm=New-AzureRMVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avSet.Id

$diskSize=100
$diskLabel="SQLData"
$storageAcc=Get-AzureRMStorageAccount -ResourceGroupName $rgName -Name $saName
$vhdURI=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds/" + $vmName + "-SQLDataDisk.vhd"
Add-AzureRMVMDataDisk -VM $vm -Name $diskLabel -DiskSizeInGB $diskSize -VhdUri $vhdURI  -CreateOption empty

$cred=Get-Credential -Message "Type the name and password of the local administrator account of the SQL Server computer."
$vm=Set-AzureRMVMOperatingSystem -VM $vm -Windows -ComputerName $vmName -Credential $cred -ProvisionVMAgent -EnableAutoUpdate
$vm=Set-AzureRMVMSourceImage -VM $vm -PublisherName MicrosoftSQLServer -Offer SQL2014SP1-WS2012R2 -Skus Standard -Version "latest"
$vm=Add-AzureRMVMNetworkInterface -VM $vm -Id $nic.Id
$storageAcc=Get-AzureRMStorageAccount -ResourceGroupName $rgName -Name $saName
$osDiskUri=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds/" + $vmName + "-OSDisk.vhd"
$vm=Set-AzureRMVMOSDisk -VM $vm -Name "OSDisk" -VhdUri $osDiskUri -CreateOption fromImage
New-AzureRMVM -ResourceGroupName $rgName -Location $locName -VM $vm -DisableBginfoExtension

# Connect: sqlVM\devsqladmin

# sqlVM Server:
Add-Computer -DomainName "corp.contoso.com" #CORP\devadmin
Restart-Computer

# Reconnect: sqlVM\devsqladmin

# sqlVM Server:

md f:\Data
md f:\Log
md f:\Backup

# CORP\devadmin

New-NetFirewallRule -DisplayName "SQL Server ports 1433, 1434, and 5022" -Direction Inbound -Protocol TCP -LocalPort 1433,1434,5022 -Action Allow # IMPORTANT

## SP2016 ##

# Set up key variables
$dnsName="devsp2016"

# Set the Azure subscription
Get-AzureRmSubscription -SubscriptionName $subscrName | Select-AzureRmSubscription

# Get the Azure storage account name
$sa=Get-AzureRMStorageaccount | where {$_.ResourceGroupName -eq $rgName}
$saName=$sa.StorageAccountName

# Create an availability set for SharePoint virtual machines
New-AzureRMAvailabilitySet -Name spAvailabilitySet -ResourceGroupName $rgName -Location $locName

# Specify the virtual machine name and size
$vmName="spVM"
$vmSize="Standard_D3_V2"
$vm=New-AzureRMVMConfig -VMName $vmName -VMSize $vmSize

# Create the NIC for the virtual machine
$nicName=$vmName + "-NIC"
$pipName=$vmName + "-PublicIP"
$pip=New-AzureRMPublicIpAddress -Name $pipName -ResourceGroupName $rgName -DomainNameLabel $dnsName -Location $locName -AllocationMethod Dynamic
$vnet=Get-AzureRMVirtualNetwork -Name "SP2016Vnet" -ResourceGroupName $rgName
$nic=New-AzureRMNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id -PrivateIpAddress "10.0.0.6"
$avSet=Get-AzureRMAvailabilitySet -Name spAvailabilitySet -ResourceGroupName $rgName
$vm=New-AzureRMVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avSet.Id

# Specify the image and local administrator account, and then add the NIC
$pubName="MicrosoftSharePoint"
$offerName="MicrosoftSharePointServer"
$skuName="2016"
$cred=Get-Credential -Message "Type the name and password of the local administrator account."
$vm=Set-AzureRMVMOperatingSystem -VM $vm -Windows -ComputerName $vmName -Credential $cred -ProvisionVMAgent -EnableAutoUpdate
$vm=Set-AzureRMVMSourceImage -VM $vm -PublisherName $pubName -Offer $offerName -Skus $skuName -Version "latest"
$vm=Add-AzureRMVMNetworkInterface -VM $vm -Id $nic.Id

# Specify the OS disk name and create the VM
$diskName="OSDisk"
$storageAcc=Get-AzureRMStorageAccount -ResourceGroupName $rgName -Name $saName
$osDiskUri=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds/" + $vmName + $diskName  + ".vhd"
$vm=Set-AzureRMVMOSDisk -VM $vm -Name $diskName -VhdUri $osDiskUri -CreateOption fromImage
New-AzureRMVM -ResourceGroupName $rgName -Location $locName -VM $vm -DisableBginfoExtension

# Connect to SP2016: spVM\devspadmin

# SP2016 Server:
Add-Computer -DomainName "corp.contoso.com" # CORP\devadmin
Restart-Computer

# Connect to SP2016: CORP\devadmin

# Aletrnate access mapping (Public IP)
$pip = Get-AzureRMPublicIpaddress -Name "spVM-PublicIP" -ResourceGroup $rgName
$pip.DnsSettings.Fqdn # Note the dns name

# Public Site: http://devsp2016.southeastasia.cloudapp.azure.com
# http://devsp2016.southeastasia.cloudapp.azure.com/_layouts/15/start.aspx#/SitePages/Home.aspx

## Post-Setup ##

#Stop VMs
Stop-AzureRMVM -Name spVM -ResourceGroupName $rgName -Force
Stop-AzureRMVM -Name sqlVM -ResourceGroupName $rgName -Force
Stop-AzureRMVM -Name adVM -ResourceGroupName $rgName -Force

#Start VMs
Start-AzureRMVM -Name adVM -ResourceGroupName $rgName
Start-AzureRMVM -Name sqlVM -ResourceGroupName $rgName
Start-AzureRMVM -Name spVM -ResourceGroupName $rgName




Credit goes to source article: https://technet.microsoft.com/library/mt723354(v=office.16).aspx