This file contains hidden or 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
| [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()] |
This file contains hidden or 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
| #!/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): |
This file contains hidden or 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
| 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): |
This file contains hidden or 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 hidden or 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
| #!/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
- 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
This file contains hidden or 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
| 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.
This file contains hidden or 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 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 |
NewerOlder