Skip to content

Instantly share code, notes, and snippets.

# To add an ssh key from putty to authorized_keys
ssh-keygen -i -f ssh2.pub > openssh.pub
# 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
@mikerodionov
mikerodionov / blobfuseInstallCentOs7.sh
Last active July 11, 2022 16:55
Fixing [Errno 14] HTTPS Error 404 - Not Found error during blobfuse install on CentOS 7
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
@mikerodionov
mikerodionov / testdeplyoment.yaml
Last active June 19, 2022 10:15
Deployment definition
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: sampleapp
spec:
selector:
matchLabels:
app: sampleapp
replicas: 1
template:
@mikerodionov
mikerodionov / tf_install.sh
Created June 16, 2022 07:30
Terraform Install
# 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
@mikerodionov
mikerodionov / SQL_Components_Clean_Up.ps1
Last active December 5, 2021 12:18
Cleanup of SQL components
# 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"
}
# 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>'
# 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
Get-VM | Format-List Name,Generation
#Set Execution Policy if necessary using command below
#Set-ExecutionPolicy Unrestricted -Force
#--------------------------------
#Modules
#
Import-Module WebAdministration
#--------------------------------
#Variables