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 update -y | |
echo "======= INSTALLING RPM FOR MONO =======" | |
sudo mkdir -p /tmp/mono_dependencies | |
cd /tmp/mono_dependencies | |
sudo wget https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.30-11.fc33.x86_64.rpm | |
sudo yum install -y libpng15-1.5.30-11.fc33.x86_64.rpm | |
echo "======= INSTALLING MONO ============" | |
sudo yum install -y yum-utils |
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 AWS CLI, Kubectl, Kops | |
sudo apt update | |
sudo apt install -y awscli | |
sudo snap install kubectl --classic | |
curl -LO https://github.com/kubernetes/kops/releases/download/1.7.0/kops-linux-amd64 | |
chmod +x kops-linux-amd64 | |
mv ./kops-linux-amd64 /usr/local/bin/kops | |
# Setup the AWS profile | |
aws config |
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 script brings up the entire stack of Docker containers, removing the current ones. | |
Docker compose was tried for this task and it wasn't customisable enough. | |
Docker cloud was tried (with stack files) and was buggy (failed to launch, no logs returned). | |
Docker machine was tried, but it can't connect to existing servers only ones it created. | |
Rancher was too heavy weight for the task, as the containers are lightweight in DigitalOcean. | |
Kubernetes would've been too heavy weight for DigitalOcean. | |
It was written in Powershell and worked. But then converting it to Bash was too much effort. | |
Powershell for Linux is too much effort to install without a debian package (and none standard) |
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 the latest Chromedriver version number | |
#========================================================================================== | |
WriteHeader "Determining Chromedriver version" | |
$url = "http://chromedriver.storage.googleapis.com/"; | |
$xml = [xml](wget $url); | |
$chromeDriver_version = 2.12; | |
# XML format: <ListBucketResult><Contents><Key>...</Key></Contents></ListBucketResult> | |
foreach ($item in $xml.ListBucketResult.Contents) |
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
Remove-DnsServerResourceRecord -Name "mysubdomain" -Force -RRType CName -ZoneName "example.com" -ComputerName "ADserver.example.com" -ErrorAction Ignore | |
Add-DnsServerResourceRecordCName -Name "mysubdomain" -HostNameAlias "mysubdomain.example.com" -ZoneName "example.com" -ComputerName "ADserver.example.com" | |
Add-DnsServerResourceRecordA -IPv4Address "10.1.2.3" -Name "another-server.example.com" -ZoneName "example.com" -ComputerName "ADserver.example.com" |
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
# Example: ./enable-hyperv-in-hyperv.ps1 -vmName "Windows 10" | |
param ( | |
[Parameter(Mandatory = $true)]$vmName | |
) | |
Set-VMProcessor -VMName $vmName -ExposeVirtualizationExtensions $true | |
Get-VMNetworkAdapter -VMName $vmName | Set-VMNetworkAdapter -MacAddressSpoofing On | |
Write-Host "VM updated. Make sure your VM has dynamic memory enabled, and has 4gb or more" |
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
while ($true) { $r = wget -uri "http://somesite.com?q=1" -headers @{"Accept-Tenant"="Nz"}; echo $r.Content } |
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
function Import-Snippet($snippetId, $name) | |
{ | |
# Save this in one of the locations found from $env:PSModulePath as "Import-Snippet\import-snippet.psm1" | |
# e.g. "D:\Chris\Documents\WindowsPowerShell\Modules\Import-Snippet\import-snippet.psm1" | |
# Then in powershell type "import-module import-snippet" | |
$fullUrl = "http://visualstudiocodesnippets.com/download/$snippetId" | |
$filePath = "$env:USERPROFILE\Documents\Visual Studio 2015\Code Snippets\Visual C#\My Code Snippets\$name.snippet" | |
wget -Uri "$fullUrl" -OutFile "$filePath" | |
Write-Host "Successfully saved $filePath" -ForegroundColor DarkGreen |
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
# Make sure this is run as administrator | |
$user = [Security.Principal.WindowsIdentity]::GetCurrent(); | |
$isAdmin = (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) | |
if ($isAdmin -eq $false) | |
{ | |
Write-Host "Please run this script as an administrator" -ForegroundColor Yellow | |
exit | |
} | |
$version = "2.15" |
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
# https://peter.hahndorf.eu/blog/WindowsFeatureViaCmd.html | |
Get-WindowsOptionalFeature -Online | Select FeatureName | Sort FeatureName | |
Enable-WindowsOptionalFeature -FeatureName IIS-WebServer -Online -All |
NewerOlder