Requires
- aws-cli - https://aws.amazon.com/cli/
- jq - https://stedolan.github.io/jq/
Configure path to your ECS SSH key file ~/.bashrc
echo 'export ECS_PEM_FILE=$HOME/docker.pem' >> ~/.bashrc
[cmdletbinding()] | |
param( | |
[string]$Width, | |
[string]$Height, | |
[string]$datestamp = "{0:HH/mm/ss/dd/MM/yyyy}" -f (get-date), | |
[string]$FileName = $env:COMPUTERNAME + "_screen_" + "$datestamp" | |
) | |
function Take-Screenshot{ | |
[cmdletbinding()] |
#!/usr/bin/env python | |
from multiprocessing import Process, Pool | |
import time | |
import urllib2 | |
def millis(): | |
return int(round(time.time() * 1000)) | |
def http_get(url): |
import time | |
import datetime | |
import asyncio | |
import aiohttp | |
domain = 'http://integralist.co.uk' | |
a = '{}/foo?run={}'.format(domain, time.time()) | |
b = '{}/bar?run={}'.format(domain, time.time()) | |
async def get(url): |
# 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 |
#!/bin/bash | |
DARKGRAY='\033[1;30m' | |
RED='\033[0;31m' | |
LIGHTRED='\033[1;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[1;33m' | |
BLUE='\033[0;34m' | |
PURPLE='\033[0;35m' | |
LIGHTPURPLE='\033[1;35m' |
Requires
Configure path to your ECS SSH key file ~/.bashrc
echo 'export ECS_PEM_FILE=$HOME/docker.pem' >> ~/.bashrc
netsh advfirewall firewall set rule group="remote administration" new enable=yes | |
netsh advfirewall firewall add rule name="Open Port 5985" dir=in action=allow protocol=TCP localport=5985 | |
winrm quickconfig -q | |
winrm quickconfig -transport:http | |
winrm set winrm/config '@{MaxTimeoutms="7200000"}' | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}' | |
winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}' | |
winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}' | |
winrm set winrm/config/service '@{AllowUnencrypted="true"}' |
This snippet is a sample showing how to implement CloudWatch Logs streaming to ElasticSearch using terraform
.
I wrote this gist
because I didn't found a clear, end-to-end example on how to achieve this task. In particular,
I understood the resource "aws_lambda_permission" "cloudwatch_allow"
part by reading a couple of bug reports plus
this stackoverflow post.
The js
file is actually the Lambda function automatically created by AWS when creating this pipeline through the
web console. I only added a endpoint
variable handling so it is configurable from terraform
.
function XmlDocTransform($xml, $xdt) | |
{ | |
if (!$xml -or !(Test-Path -path $xml -PathType Leaf)) { | |
throw "File not found. $xml"; | |
} | |
if (!$xdt -or !(Test-Path -path $xdt -PathType Leaf)) { | |
throw "File not found. $xdt"; | |
} | |
$scriptPath = (Get-Variable MyInvocation -Scope 1).Value.InvocationName | split-path -parent |
<# | |
.SYNOPSIS | |
Create a configuration transformation | |
.DESCRIPTION | |
This script runs an ASP.NET configuration transformation, given a source | |
configuration and transformation file. MSBuild.exe is assumed to be in | |
the path, and Visual Studio 2012 should be installed. Modify the path to | |
Microsoft.Web.Publishing.Tasks.dll if a different version of Visual Studio | |
is installed. |