Skip to content

Instantly share code, notes, and snippets.

View OSapozhnikov's full-sized avatar

Oleksandr Sapozhnikov OSapozhnikov

View GitHub Profile
@OSapozhnikov
OSapozhnikov / README.md
Created March 30, 2022 07:52
Build a custom Windows AMI on AWS using Packer

Windows AWS Packer example

An example of building a Windows Server 2019 AMI on AWS with Packer. The AMI will include Firefox, Putty, VSCode and extensions.

This is heavily based on the AWS Windows examples from https://www.packer.io/docs/builders/amazon/ebs

  1. Configure your environment with some AWS credentials
  2. Run packer build custom-windows.pkr.hcl
@OSapozhnikov
OSapozhnikov / aws.md
Created March 25, 2021 20:01 — forked from yancyn/aws.md
Monitor Memory Utilization on AWS EC2 Windows Instance

Monitor Memory Utilization on AWS EC2 Windows Instance

How to Enable Memory Monitor

  1. AWS Console > Intance > Action
  2. Attach IAM role to your instance.
  3. Attach policy > CloudWatchFullAccess + AmazonSSMFullAccess.
  4. Start Windows instance.
  5. Configure CloudWatch.json based on your requirement before Ec2Config service is started.
  • Configure your region i.e. if your instance at us-web-2b set to us-west-2.
  • Add your IAM access key and secret key under CloudWatch component.
@OSapozhnikov
OSapozhnikov / EnableWinRm
Created March 25, 2021 19:50 — forked from mapbutcher/EnableWinRm
Enable WinRM with basic auth
set-executionpolicy -executionpolicy remotesigned
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
@OSapozhnikov
OSapozhnikov / .bashrc
Created April 26, 2018 14:24 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@OSapozhnikov
OSapozhnikov / createReqCSR.sh
Last active March 24, 2017 13:47
createReqCSR
#!/usr/bin/env bash
# Constants
RED='\033[0;31m'
GR='\033[0;32m'
NC='\033[0m' # No Color
# Hello
echo "Hello, ${RED}"$USER"${NC}. This script will generate CSR for SSL Cert"
# CommonName
echo -n "${GR}Enter your domain CommonName [ENTER]: ${NC}"
@OSapozhnikov
OSapozhnikov / baseServerConfigCentOS.sh
Last active March 23, 2017 15:06
BaseServerConfig for CentOS7
#!/usr/bin/env bash
echo " -> Starting Marker"
echo " -> Add repository"
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -Uvh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
rpm --import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX
yum clean all
yum update -y
@OSapozhnikov
OSapozhnikov / deploy.php
Created November 30, 2016 14:32 — forked from krisnoble/deploy.php
A slightly modified version of Brandon Summers' script. For more information: http://simianstudios.com/blog/post/using-bitbucket-for-automated-deployment-of-multiple-repositories
<?php
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php
/**
* The root directory where the repos live.
*
* @var string
*/
$root_dir = '/your/root/dir/';
#!/usr/bin/env bash
sudo apt-get update -y
sudo apt-get install -y apt-transport-https ca-certificates
# Add keys and Docker repository
sudo apt-key adv \
--keyserver hkp://p80.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" \
| sudo tee /etc/apt/sources.list.d/docker.list
# Install Docker