This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To add an ssh key from putty to authorized_keys | |
ssh-keygen -i -f ssh2.pub > openssh.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# After updating Azure VM DNS via Portal or Terraform you need to ensure they are applied | |
# DNS check CentOS | |
# Get connection name | |
nmcli device | |
# Check connection specific DNS | |
nmcli -f IP4.DNS connection show "Wired connection 1" | |
# Restart NetworkManager (required for connection to pick up new DNS servers) | |
sudo systemctl restart NetworkManager | |
# DNS check Ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum remove packages-microsoft-prod-1.0-1.el7.noarch | |
sudo yum clean all | |
sudo rm -rf /var/cache/yum | |
sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm | |
sudo yum install blobfuse -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1beta1 | |
kind: Deployment | |
metadata: | |
name: sampleapp | |
spec: | |
selector: | |
matchLabels: | |
app: sampleapp | |
replicas: 1 | |
template: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download and install specific version of Terraform - adjust dowload version as needed | |
sudo apt-get install unzip | |
wget https://releases.hashicorp.com/terraform/1.0.8/terraform_1.0.8_linux_amd64 | |
unzip terraform_1.0.8_linux_amd64.zip | |
sudo install terraform /usr/local/bin/ | |
terraform --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is something which can be useful if you run into error message below during SQL Server installation | |
# The MOF compiler could not connect with the WMI server - Error in UI | |
# MSINEWINSTANCE requires a new instance that is not installed - Error in SQL installer logs | |
# View all installed components which name contains SQL | |
Get-WmiObject -Query "SELECT * FROM win32_product Where Caption like '%SQL%'" | Select Caption, IdentifyingNumber | |
# Build a list of commands to uninstall all of them | |
$components_to_delete = Get-WmiObject -Query "SELECT * FROM win32_product Where Caption like '%SQL%'" | Select -ExpandProperty IdentifyingNumber | |
foreach ($component in $components_to_delete) { | |
echo "msixec /x $component" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install required module | |
Install-Module -Name VSTeam -Scope CurrentUser | |
# Specify your Azure DevOps project | |
Set-VSTeamAccount -Account <Name of your Azure DevOps org> -PersonalAccessToken <Your PAT with access to your project> | |
# Request pipeline validation: | |
Test-VSTeamYamlPipeline -Project <PROJECT_NAME> -PipelineId <PIPELINE_ID> -FilePath '<PATH_TO_YAML_FILE>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Checkout repo which needs history clear up | |
# Assuming repo has default "main" name | |
git checkout --orphan latest_branch | |
# Once current state checked out to local folder add all files | |
git add -A | |
# Commit "the changes" | |
git commit -am "Repo clear up" | |
# Delete your original remote branch | |
git branch -D main | |
# Rename the current branch to main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-VM | Format-List Name,Generation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Set Execution Policy if necessary using command below | |
#Set-ExecutionPolicy Unrestricted -Force | |
#-------------------------------- | |
#Modules | |
# | |
Import-Module WebAdministration | |
#-------------------------------- | |
#Variables |