
Anamul Haq Bappy
Site Reliability Engineer
SYDNEY, New South Wales
INFORMATION TECHNOLOGY & SERVICES
Aiming For: Senior DevOps Engineer
Education: Federation University Australia
cks

Personal Details
- Resident: Australia, USA
- PHONE: +61449776114
- EMAIL: bappy776@gmail.com
ABOUT ME
I love to Automate things around me. Learning new technology is my passion. Using ClouldFormation, Git, Flux, CDK with Python, Kubernetes becoming my second nature.
THINGS I HAVE DONE
60 min
On Premise Bare MetalSydneyDeploying a production-grade high-availability Kubernetes cluster on bare metal using Kubespray
# Prepare Environment
- I have selected six Ubuntu 22.04 servers: three for control planes and three for worker nodes. Three of the control planes will host ETCD.
- Control plane IP ranges:
192.168.1.101, 192.168.1.102, 192.168.1.103
. - Worker node IP ranges:
192.168.1.111, 192.168.1.112, 192.168.1.113
. - Ensure SSH access to all servers using:
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.XXX
. - Install Python and Ansible on the machine from which we will run Kubespray.
- Clone the Kubespray repository:
git clone https://github.com/kubernetes-sigs/kubespray.git
. - Checkout the stable version:
cd kubespray && git checkout tags/vX.XX.X
. - Create a new Python virtual environment and activate it:
python3 -m venv kubespray-XXX && source kubespray-XXX/bin/activate
.
# Deploy Kubernetes Cluster with Kubespray
pip3 install -U -r requirements.txt
.cp -rfp inventory/sample inventory/mycluster
.declare -a IPS=(192.168.1.101 192.168.1.102 192.168.1.103 192.168.1.111 192.168.1.112 192.168.1.113)
.CONFIG_FILE=inventory/mycluster/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]}\n
.- I want to install Helm and metrics server with Kubespray so I have created a variable file name
cluster-variable.yaml
ansible-playbook -i inventory/mycluster/hosts.yaml -e @inventory/mycluster/cluster-variable.yaml --become --become-user=root cluster.yml
# Add node to Kubernetes cluster
- Update host file
inventory/mycluster/hosts.yaml
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root -u root scale.yml
# Delete node to Kubernetes cluster
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root -u root remove-node.yml
- Update host file
inventory/mycluster/hosts.yaml
# Reset all Kubernetes installation
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root -u root reset.yml
30 min
AWS EKSSydneyDeploy EKS cluster with Terraform, Deploy Argo CD and Connect it with Github
# Install EKS cluster with Terraform
git clone https://github.com/hashicorp/terraform-provider-aws.git
cd terraform-provider-aws/examples/eks-getting-started
terraform init
- Change accourding to your need in .tf files
terraform plan
terraform apply
and yes for confirmationmkdir ~/.kube && touch ~/.kube/config
terraform output kubeconfig > ~/.kube/config
(Need to edit “~/.kube/config” to get rid of first and last line)kubectl cluster-info
# Install ArgoCD in EKS
kubectl create namespace argocd
– To create a seperate namespacekubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
– To installkubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
– To expose service to outsidekubectl get svc argocd-server -n argocd | awk '{print $4}'
– To get the web url for ArgoCD login pagekubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | cut -d'/' -f 2
– To get name of the ArgoCD podargocd login "WB_URL_THAT_GOT_EARLIER" --insecure
– To login ArgoCD with cli- To login to ArgoCD UI user username as “admin” and password is the name of the pod we got earlier
# Create CD with ArgoCD
- Log in to argoCD with cli
- I have created a public repo in https://github.com/bappy776/3-tier-application and yaml folder got all my deployment. I would recommend to use private repo for security purpose.
argocd app create argocd-wordpress --repo
– To create an application in ArgoCD, connect the application with github repo for CD. Anything change in Github repo will take effect in EKS cluster deployment.
https://github.com/bappy776/3-tier-application --path yaml
--dest-namespace default --dest-server https://kubernetes.default.svc
--project default --sync-policy auto --self-heal
For more details visit https://github.com/bappy776/eks-argocd-application/blob/main/README.md
5 min
KubernetesSydneyInstall Prometheus and Grafana Using Helm
# Use Helm to install prometheus-operator
helm install stable/prometheus-operator –generate-name
#Grafana will install with prometheus
# To get Grafana password where username is admin
kubectl get secret prometheus-operator-XXXXX-grafana -o jsonpath=”{.data.admin-password}” | base64 –decode ; echo
# Need to add prometheus in Grafana as source and then create dashboard
# For different types of dashboard we can import by id (id=3131)
https://grafana.com/grafana/dashboards
1 min
KubernetesSydneyInstall HELM 2
# Install HELM in Ubuntu
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add –
sudo apt-get install apt-transport-https –yes
echo “deb https://baltocdn.com/helm/stable/debian/ all main” | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
Ref: https://helm.sh/docs/intro/install/
30 min
PythonSydneyOutlook Mail Shorting with Python
# Need to have Python3 installed
# If install check the version
python3 –version
import win32com.client as client
# Startup outlook instance
outlook = client.Dispatch(‘Outlook.Application’)
# Get namespace so that we can access folders
namespace = outlook.GetNameSpace(‘MAPI’)
# Get the inbox folder, specifically
inbox = namespace.GetDefaultFolder(6)
# By index starting at zero
subfolder = inbox.Folders[0]
subfoldersub = subfolder.Folders[0]
# Filter messages with a body that includes a specific term
sla_messages = [message for message in inbox.Items if ‘breach’ in message.Body.lower()]
# Move the messages to the subfoldersub
for message in sla_messages:
message.Move(subfoldersub)
Ref: https://github.com/israel-dryer/Outlook-Python-Tutorial/wiki/Search-and-Organize-Mail
1 Hour
AWSSydneyDeploy EKS Cluster in AWS
# Create an EC2 Instance & make sure assign public ip to access.
# Login to the Instance
# Install aws cli 2
curl “https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip” -o “awscliv2.zip”
unzip awscliv2.zip
which aws
# My path was /usr/bin/aws
sudo ./aws/install –bin-dir /usr/bin –install-dir /esr/bin/aws-cli –update
aws –version
# Create IAM role with administrator access and add aws cli with AWS
aws configure
# Install kubectl
curl -LO “https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl”
chmod +x .kubectl
mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin
kubectl version
# Install EKSCTL
curl –silent –location “https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz” | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
eksctl version
# Create 3 workers node with 1 kubernetes cluster in us-east-1 Region
eksctl create cluster –name k8s-cluster –version 1.19 –region us-east-1 –nodegroup-name standard-workers –node-type t3.micro –nodes 3 –nodes-min 1 –nodes-max 4 –managed
# Check the cluster
kubectl get nodes
eksctl get cluster
# Configures kubectl so that you can connect to an Amazon EKS
aws eks update-kubeconfig –name k8s-cluster –region us-east-1
# Deploy nginx application with a loadbalancer
kubectl deploy nginx-deploy –image=nginx –replicas=3
kubectl expose deploy nginx-deploy –name=svc-nginx
10 min
KubernetesSydneyDeploy Flux in K8S
#check whether fluxctl is installed on the cluster
fluxctl version
#install fluxctl
sudo snap install fluxctl –classic
#Create a namespace for Flux
kubectl create ns flux
#Set the GHUSER environment variable:
export GHUSER=bappy776
#Deploy Flux using the fluxctl command:
fluxctl install \
–git-user=${GHUSER} \
–git-email=${GHUSER}@users.noreply.github.com \
–git-url=git@github.com:${GHUSER}/DeployRepository \
–git-path=namespaces,workloads \
–namespace=flux | kubectl apply -f –
#Verify the Flux deployment:
kubectl -n flux get deployment
#Obtain the Flux RSA key created by fluxctl:
fluxctl identity –k8s-fwd-ns flux
#From Github add the deploy key
bappy776 /DeployRepository > settings> Deploy Keys> Allow Write access> Add key
#Use fluxctl to sync the cluster with the repository:
fluxctl sync –k8s-fwd-ns flux
# Wait a bit and everything will deploy from DeployRepository to K8S cluster
10 min
AWSSydneyCI/CD Pipeline with CodeStar to CodeCommit
AWS CodeStar, a frontend tool that will automatically configure AWS CodeCommit, AWS CodeBuild, AWS CodeDeploy, and AWS CodePipeline.
Create a CI/CD Pipeline
- Navigate to CodeStar.
- Click Create project.
- If the Create service role dialog appears, click Create service role.
- Click the HTML card.
- Click Services and open EC2 in a new tab.
- Click KeyPairs located in the navigation menu.
- Click Create key pair.
- For Name, enter pipeline.
- Click Create key pair.
- Back in the CodeStar browser tab, close the key pair dialog.
- Click Next.
- For Project name, enter Pipeline.
- For the repository, select AWS CodeCommit.
- For the Instance type, select t2.micro.
- Check the acknowledgment box.
- Click Next.
- Click Create Project. It could take 5-10 minutes for the project to finish being set up.
Deploy a New Version of a Website using a CI/CD Pipeline
- Click View application to navigate to our web application.
- Back in the CodeStar browser tab, click IDE.
- Click Access your project code.
- Click Edit in AWS CodeCommit. This opens our repositories.
- Click the webpage folder.
- Click the index.html file. This is the code used to generate the website we just visited.
- Click Edit.
5 min
AWSSydneyAWS CLI
#To create an administrators group (AWS CLI)
aws iam create-group –group-name Admins
#List the groups in your AWS account
aws iam list-groups
#To add a policy giving full administrator permissions (AWS CLI)
aws iam attach-group-policy –group-name Admins –policy-arn arn:aws:iam::aws:policy/AdministratorAccess
https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html
10 min
AzureSydneyCreating Azure Repo
#1 Create a Repo Using the Web Portal
- Go to https://dev.azure.com/.
- From the repo drop-down, select New repository.
- In the Create a new repository dialog, verify that Git is the repo type and enter a name for the new repo.
- Select Create.
#2 Clone the Repo
- From the web browser, open the team project for your organization in Azure DevOps and select Repos > Files.
- Select Clone in the upper-right corner of the Files window and copy the Clone URL.
- Open the Git command window (Git Bash on Git for Windows) and browse to the folder where the code should go on the computer. Run git clone followed by the path copied from the Clone URL in the previous section.
- Switch directory to the directory with the cloned repository.
#3 Work with the Code
- Browse to the folder with the cloned repo and open the file that need to edit.
- Make changes and then save the file.
- Commit the changes.
- Go to DevOps Portal to confirm the changes are reflected.
10 min
GITSydneyBasic Git commands
#Configure the author name and email address to be used with your commits.
git config –global user.name “Sam Smith”
git config –global user.email sam@example.com
#Create a working copy of a local remote repository:
git clone /path/to/repository
git clone username@host:/path/to/repository
#Add one or more files to staging (index):
git add <filename>
git add *
#Commit any files you’ve added with git add, and also commit any files you’ve changed since then:
git commit -a -m “Commit message”
#Send changes to the master branch of your remote repository:
git push origin master
#List the files you’ve changed and those you still need to add or commit:
git status
#If you haven’t connected your local repository to a remote server, add the server to be able to push to it:
git remote add origin <server>
#Switch from one branch to another:
git checkout <branchname>
#Create a new branch and switch to it:
git checkout -b <branchname>
#List all the branches in your repo, and also tell you what branch you’re currently in:
git branch
#Delete the feature branch:
git branch -d <branchname>
https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html
10 min
AzureSydneyTake a snapshot of an OS disk and create a VM from it
#1 – Create a snapshot of the OS disk
$vm = Get-AzureRmVM `
-ResourceGroupName ‘psdemo-rg’ `
-Name ‘psdemo-win-1c’
$snapshotconfig = New-AzureRmSnapshotConfig `
-Location ‘Central US’ `
-DiskSizeGB 127 `
-AccountType ‘Premium_LRS’ `
-OsType Windows `
-CreateOption Empty
New-AzureRmSnapshot `
-ResourceGroupName ‘psdemo-rg’ `
-Snapshot $snapshotconfig `
-SnapshotName “psdemo-win-1-OSDisk-1-snap-1”
#2 – Getting the snapshot we just created
$SnapShot = Get-AzureRmSnapshot `
-ResourceGroupName ‘psdemo-rg’ `
-SnapshotName “psdemo-win-1-OSDisk-1-snap-1”
#3 – Create a new disk from the snapshot we just created
#If this was a data disk, we could just mount this disk to a VM.
$DiskConfig = New-AzureRmDiskConfig `
-Location $SnapShot.Location `
-SourceResourceId $SnapShot.Id `
-CreateOption Copy
$Disk = New-AzureRmDisk `
-ResourceGroupName ‘psdemo-rg’ `
-Disk $DiskConfig `
-DiskName ‘psdemo-win-1g-OSDisk-1’
#4 – Create a VM from the disk we just created, we’ll also need to create a network config here too.
$VirtualMachine = New-AzureRmVMConfig `
-VMName ‘psdemo-win-1g’ `
-VMSize ‘Standard_D1’
$VirtualMachine = Set-AzureRmVMOSDisk `
-VM $VirtualMachine `
-ManagedDiskId $disk.Id `
-CreateOption Attach `
-Windows
$vnet = Get-AzureRmVirtualNetwork `
-ResourceGroupName ‘psdemo-rg’ `
-Name ‘psdemo-vnet-1’
$nic = New-AzureRmNetworkInterface `
-ResourceGroupName ‘psdemo-rg’ `
-Location ‘centralus’ `
-SubnetId $vnet.Subnets[0].Id `
-Name ‘psdemo-win-1g-nic-1’
$VirtualMachine = Add-AzureRmVMNetworkInterface `
-VM $VirtualMachine `
-Id $nic.Id
New-AzureRmVM `
-ResourceGroupName ‘psdemo-rg’ `
-VM $VirtualMachine `
-Location $snapshot.Location
#5 – If we want we can delete a snapshot when we’re finished
Remove-AzureRmSnapshot `
-ResourceGroupName ‘psdemo-rg’ `
-SnapshotName “psdemo-win-1-OSDisk-1-snap-1” `
-Force
10 min
AzureSydneyRemove a data disk of a VM
#1 – Detaching the disk from the virtual machine. This can be done online too.
$vm = Get-AzureRmVM `
-ResourceGroupName ‘psdemo-rg’ `
-Name ‘psdemo-win-1c’
#2 – Remove the disk from the VM config
Remove-AzureRmVMDataDisk `
-VM $vm `
-Name “psdemo-win-1c-st0”
#3 – Update the VM config, this actually detaches the disk
Update-AzureRmVM `
-ResourceGroupName ‘psdemo-rg’ `
-VM $vm
#4 – Delete the disk from our Resource Group. This ACTUALLY DELETES the disk
Remove-AzureRmDisk `
-ResourceGroupName ‘psdemo-rg’ `
-DiskName ‘psdemo-win-1c-st0’
10 min
AzureSydneyResizing a data disk of a VM
#1 – Stop and deallocate the VM. This has to be an offline operation.
Stop-AzureRmVM `
-ResourceGroupName ‘psdemo-rg’ `
-Name ‘psdemo-win-1c’ `
-Force
#2 – Find the disk’s name we want to expand. This is the disk we added to our VM in the previous demo.
$disk = Get-AzureRmDisk `
-ResourceGroupName ‘psdemo-rg’ `
-DiskName “psdemo-win-1c-st0”
#3 – Update the disk’s size and update the Disk configuration.
$disk.DiskSizeGB = 1024
Update-AzureRmDisk `
-ResourceGroupName ‘psdemo-rg’ `
-Disk $disk `
-DiskName $disk.Name
#4 – start up the VM again
Start-AzureRmVm `
-ResourceGroupName ‘psdemo-rg’ `
-Name ‘psdemo-win-1c’
#5 – Log into the guest OS via Remote Desktop and resize the volume using diskpart.
diskpart
list volume #we’re looking for P:
select volume NN
extend
10 min
AzureSydneyCreating a new data disk with PowerShell and attach it to our VM
#1 – Define a new DiskConfig, Create the DataDisk and attach the new disk
$diskConfig = New-AzureRmDiskConfig `
-Location ‘Central US’ `
-OsType ‘Windows’ `
-CreateOption Empty `
-DiskSizeGB 50 `
-SkuName ‘Premium_LRS’ #’Standard_LRS, HDD’
$dataDisk = New-AzureRmDisk `
-ResourceGroupName ‘psdemo-rg’ `
-DiskName ‘psdemo-win-1c-st0’ `
-Disk $diskConfig
$vm = Get-AzureRmVM `
-ResourceGroupName ‘psdemo-rg’ `
-Name ‘psdemo-win-1c’
$vm = Add-AzureRmVMDataDisk `
-VM $vm `
-Name “psdemo-win-1c-st0” `
-CreateOption Attach `
-ManagedDiskId $dataDisk.Id `
-Lun 1
Update-AzureRmVM `
-ResourceGroupName ‘psdemo-rg’ `
-VM $vm
#2 – Prepare the disk for use by the operating system, initialize disk, add a partition and format the disk
#PERFORM THIS OPERATION ON THE SERVER VIA Remote Desktop.
$NewDisk = Get-Disk | Where-Object { $_.Location -like “*LUN 1*” }
$DriveLetter = ‘P’
$label = “DATA1”
$NewDisk | Initialize-Disk -PartitionStyle MBR -PassThru | `
New-Partition -UseMaximumSize -DriveLetter $driveLetter | `
Format-Volume -FileSystem NTFS -NewFileSystemLabel $label -Force
10 min
AzureSydneyChanging IP address of VM in Azure
Update a NIC to use a new private IP address
# Deallocate a VM
az vm deallocate \
–resource-group “bappy1-ps” \
–name “bappy-win-rst1”
# Changing IP of NIC
az network nic ip-config update \
-g “bappy1-ps” \
–nic-name “bappy-win-rst1-nic-XXXXXX” \
-n “XXXXXX” \
–private-ip-address 10.1.1.5 \
–make-primary
# Start VM
az vm start \
–resource-group “bappy1-ps” \
–name “bappy-win-rst1”
https://docs.microsoft.com/en-us/cli/azure/network/nic/ip-config?view=azure-cli-latest#az_network_nic_ip_config_update
10 min
AzureSydneyChanging a Host name of a VM in Azure
Create a new VM with the desired name and attach the VHD files, NICs from the current server
# Set variables
$resourceGroup = “Bravo”
$oldvmName = “WTFG”
$newvmName = “WT-FG01a”
# Stop and Deallocate Azure VM with PS
Stop-AzVM -name $oldvmName -resourcegroup $resourceGroup -force
# Get the details of the VM to be renamed
$originalVM = Get-AzureRmVM `
-ResourceGroupName $resourceGroup `
-Name $oldvmName
# Remove the original VM
Remove-AzureRmVM -ResourceGroupName $resourceGroup -Name $oldvmName -force
# You receive an question if you would like to remove your VMs. You want do that. You can remove that question using the -force option
# Create the basic configuration for the replacement VM
$newVM = New-AzureRmVMConfig `
-VMName $newvmName `
-VMSize $originalVM.HardwareProfile.VmSize `
set-AzureRmVMOSDisk -VM $newVM -CreateOption Attach -ManagedDiskId $originalVM.StorageProfile.OsDisk.ManagedDisk.Id -Name $originalVM.StorageProfile.OsDisk.Name -Windows
# Now let’s add the data disks
foreach ($disk in $originalVM.StorageProfile.DataDisks) {
Add-AzureRmVMDataDisk -VM $newVM `
-Name $disk.Name `
-ManagedDiskId $disk.ManagedDisk.Id `
-Caching $disk.Caching `
-Lun $disk.Lun `
-DiskSizeInGB $disk.DiskSizeGB `
-CreateOption Attach
}
# Add the original NIC(s)
foreach ($nic in $originalVM.NetworkProfile.NetworkInterfaces) {
Add-AzureRmVMNetworkInterface `
-VM $newVM `
-Id $nic.Id
}
# Now recreate the VM using the new name but with the old disks, NIC etc
New-AzureRmVM `
-ResourceGroupName $resourceGroup `
-Location $originalVM.Location `
-VM $newVM `
-DisableBginfoExtension
10 min
AzureSydneyCreate VMs with two NICs from two subnet in AZURE
Create VMs in Azure with two NICs from two different subnets
#First, create a resource group.
New-AzureRmResourceGroup -Name “bappy1-ps” -Location “WestUS2”
#Define two virtual network subnets with New-AzureRmVirtualNetworkSubnetConfig
$mySubnetFrontEnd = New-AzureRmVirtualNetworkSubnetConfig -Name “mySubnetFrontEnd” `
-AddressPrefix “192.168.1.0/24”
$mySubnetBackEnd = New-AzureRmVirtualNetworkSubnetConfig -Name “mySubnetBackEnd” `
-AddressPrefix “192.168.2.0/24”
#Create your virtual network and subnets with New-AzureRmVirtualNetwork
$myVnet = New-AzureRmVirtualNetwork -ResourceGroupName “bappy1-ps” `
-Location “WestUS2” `
-Name “myVnet” `
-AddressPrefix “192.168.0.0/16” `
-Subnet $mySubnetFrontEnd,$mySubnetBackEnd
#Create two NICs with New-AzureRmNetworkInterface
$frontEnd = $myVnet.Subnets|?{$_.Name -eq ‘mySubnetFrontEnd’}
$myNic1 = New-AzureRmNetworkInterface -ResourceGroupName “bappy1-ps” `
-Name “myNic1” `
-Location “WestUS2” `
-SubnetId $frontEnd.Id
$backEnd = $myVnet.Subnets|?{$_.Name -eq ‘mySubnetBackEnd’}
$myNic2 = New-AzureRmNetworkInterface -ResourceGroupName “bappy1-ps” `
-Name “myNic2” `
-Location “WestUS2” `
-SubnetId $backEnd.Id
#Set your VM credentials
$cred = Get-Credential
#Define your VM with New-AzureRmVMConfig
$vmConfig = New-AzureRmVMConfig -VMName “myVM” -VMSize “Standard_D2_v3”
#Create the rest of your VM configuration with Set-AzureRmVMOperatingSystem and Set-AzureRmVMSourceImage
$vmConfig = Set-AzureRmVMOperatingSystem -VM $vmConfig `
-Windows `
-ComputerName “myVM” `
-Credential $cred `
-ProvisionVMAgent `
-EnableAutoUpdate
$vmConfig = Set-AzureRmVMSourceImage -VM $vmConfig `
-PublisherName “MicrosoftWindowsServer” `
-Offer “WindowsServer” `
-Skus “2019-Datacenter” `
-Version “latest”
#Attach the two NICs that you previously created with Add-AzureRmVMNetworkInterface:
$vmConfig = Add-AzureRmVMNetworkInterface -VM $vmConfig -Id $myNic1.Id -Primary
$vmConfig = Add-AzureRmVMNetworkInterface -VM $vmConfig -Id $myNic2.Id
#Finally, create your VM with New-AzureRmVM:
New-AzureRmVM -VM $vmConfig -ResourceGroupName “bappy1-ps” -Location “WestUS2”
10 min
AzureSydneyCreate a VMs and open RDP port
Create VMs in Azure and RDP to it
#1 – Create public IP address
az network public-ip create \
–resource-group “bappy1-ps” \
–name “bappy-win-1-pip-1”
#2 – Create network security group, so we can have seperate security policies
az network nsg create \
–resource-group “bappy1-ps” \
–name “bappy-win-nsg-1”
#3 – Create a virtual network card and associate with public IP address and NSG
az network nic create \
–resource-group “bappy1-ps” \
–name “bappy-win-1-nic-1” \
–vnet-name “bappy-vnet-1” \
–subnet “bappy-subnet-1” \
–network-security-group “bappy-win-nsg-1” \
–public-ip-address “bappy-win-1-pip-1”
#4 – Create a virtual machine and make sure to use appropriate password
az vm create \
–resource-group “bappy1-ps” \
–name “bappy-win-1” \
–size “Standard_D2_v3” \
–location “westus2” \
–nics “bappy-win-1-nic-1” \
–image “win2016datacenter” \
–admin-username “bappy” \
–admin-password “XXXXXX”
#5 – Open port 3389 to allow RDP traffic to host
az vm open-port \
–port “3389” \
–resource-group “bappy1-ps” \
–name “bappy-win-1”
5 min
WindowsSydneyCreate mailbox in Hybrid Office 365 environment using On Premserver
Create User Mailbox in Exchange 2013 Hybrid
Enable-RemoteMailbox “Display Name” -RemoteRoutingAddress username@ProxyAddress.mail.onmicrosoft.com
Enable-RemoteMailbox “Kim Akers” -RemoteRoutingAddress “kima@contoso.mail.onmicrosoft.com”
https://docs.microsoft.com/en-us/powershell/module/exchange/enable-remotemailbox?view=exchange-ps
5 min
WindowsSydneyAdds all Dabbo-based Marketing employees to Advertising team
Use Powershell to add Dabbo-based Marketing employees to Advertising team
Get-ADUser -filter {department -eq “Marketing” -and city -eq “Dubbo”} | Move-ADUser -TargetPath “ou=Advertising,ou=Marketing,dc=domain,dc=com”
5 min
WindowsSydneyRemove a User from Sales AD group
Use Powershell to remove a user from Sales AD group
Remove-ADGroupMember -Identity “Sales” -Members “usename”
5 min
WindowsSydneyAdd Sales Department users to Sales AD Group
Use Powershell to add Sales department users to Sales AD group
Get-ADUser -filter {department -eq “sales”} -Properties department | Add-ADPrincipalGroupMembership -memberOf “Sales”
5 min
WindowsSydneyTest connection Local computer and DC
Test a channel between the local computer and a domain controller
Test-ComputerSecureChannel -Server “DCName.domain.com”
5 min
WindowsSydneyDisables all Dubbo computer accounts from AD
Disables all Dubbo computer accounts
Get-ADComputer -filter {location -eq “Dubbo”} | Disable-ADAccount
Re-enables all Dubbo computer accounts
Get-ADComputer -filter {location -eq “Dubbo”} | Enable-ADAccount
5 min
WindowsSydneyGet the Embedded Product key of Windows and Install
Run the Powershell as admin and reinstall the product key
$service = get-wmiObject -query ‘select * from SoftwareLicensingService’
$service.OA3xOriginalProductKey
$key=$service.OA3xOriginalProductKey
$service.InstallProductKey($key)
5 min
Office 365SydneyList of Shared Mailboxes Members and Permissions
Generate List of Shared Mailboxes Members and their Permissions and export it to CSV File
Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | Get-MailboxPermission |Select-Object Identity,User,AccessRights | Where-Object {($_.user -like ‘*@*’)}|Export-Csv C:\Users\anamul.bappy\Desktop\sharedfolders.csv -NoTypeInformation
5 min
Windows SydneyGenerate AD active users, email and phone to CSV
Powershell script to get active users, email and phone
Get-ADUser -Filter * -Properties DisplayName, EmailAddress, OfficePhone | where {$_.enabled -eq $true} | select DisplayName, EmailAddress, OfficePhone | export-csv -path C:\Users\anamul.bappy\Desktop\ADUserlistNameEmailPhone.csv
5 min
Windows SydneyFile Explorer is Not Showing Extended Disk
Open CMD as Admin
>diskpart
>select volume [# of your volume]
>extend filesystem
5 min
Windows SydneyRegisty Hack
#By Pass Application Admin Prompt
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
“C:\\Program Files\\path\\application.exe”=”RunAsInvoker”
Each task 5 min
Office 365SydneyGet All Distribution Groups and its members
#Get All Distribution Groups As Well As Members by Powershell in O365
$Result=@()
$groups = Get-DistributionGroup -ResultSize Unlimited
$totalmbx = $groups.Count
$i = 1
$groups | ForEach-Object {
Write-Progress -activity “Processing $_.DisplayName” -status “$i out of $totalmbx completed”
$group = $_
Get-DistributionGroupMember -Identity $group.Name -ResultSize Unlimited | ForEach-Object {
$member = $_
$Result += New-Object PSObject -property @{
GroupName = $group.DisplayName
Member = $member.Name
EmailAddress = $member.PrimarySMTPAddress
RecipientType= $member.RecipientType
}}
$i++
}
$Result | Export-CSV “C:\Users\anamul.bappy\Desktop\All-Distribution-Group-Members.csv” -NoTypeInformation -Encoding UTF8
Each task 5 min
NetworksSydneyChecking Port Connectivity between two servers
Checking Port to Port connection
Function Verify-Connection() {
$targetData = @((“104.41.43.208”, “10024”), (“104.41.43.207”, “10050”))
$json = @()
foreach ($item in $targetData) {
$ComputerName = $item[0]
$RemotePort = $item[1]
$CurrentTime = [DateTime]::UtcNow.ToString(‘yyyy-MM-ddThh:mm:ssZ’)
$Result = (Test-NetConnection -ComputerName $item[0] -Port $item[1] -ErrorAction SilentlyContinue -WarningAction SilentlyContinue).TcpTestSucceeded
$jsonItem = “{ComputerName: $ComputerName,RemotePort: $RemotePort,Result: $Result,DateValue: $CurrentTime}”
$json += $jsonItem
}
return $json
}
Verify-Connection
Each task 5 min
Active DirectorySydneyChanging Login Name in AD
AD change login name
# Getinge the user name in AD
Get-ADUser -Filter * | where { $_.SamAccountName -like “David.Murray” } | Select-Object -Property Name,SamAccountName,Userprincipalname
# Changing the login user name
$SAM = “DMurray”
$SAM2 = “David.Murray”
Get-ADUser $SAM | Set-ADUser -SamAccountName $SAM2 -PassThru
#Changing UPN
Get-ADUser $SAM | Set-ADUser -UserPrincipalName $SAM2
EDUCATION
Federation University Australia
Masters in Informational Technology
Asian University of Bangladesh
Bachelor of Computer Science and Engineering
SKILLS
Languages
English: Advanced
Bangla: Advanced
Hindi: Basic
PORTFOLIO
RECOMMENDATIONS
Bappy, Congratulations on achieving your CKS certification!
Really great to see you improving your skills and thus your career with Cloud Foundry!
Thank you for your dedication.