Skip to content

Instantly share code, notes, and snippets.

View eugenestarchenko's full-sized avatar
:octocat:

Eugene S eugenestarchenko

:octocat:
View GitHub Profile
@eugenestarchenko
eugenestarchenko / install nano.sh
Created June 27, 2019 11:45 — forked from BlakeGardner/install nano.sh
Syntax highlighting in nano on Mac OS X
# install Homebrew if you don't already have it: http://mxcl.github.io/homebrew/
# install nano from homebrew
brew install nano
# update your nanorc file with the contents of the nanorc file below
nano ~/.nanorc
# re-open your terminal and you'll have syntax highlighting
@eugenestarchenko
eugenestarchenko / get-iam-credential-report.sh
Created June 14, 2019 09:03
Get IAM Credential Report
#!/bin/sh
aws iam generate-credential-report
aws iam get-credential-report --output text --query Content | base64 -D
@eugenestarchenko
eugenestarchenko / README-Template.md
Created May 2, 2019 10:49 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

#!/bin/sh
alias dm='docker-machine'
alias dmx='docker-machine ssh'
alias dk='docker'
alias dki='docker images'
alias dks='docker service'
alias dkrm='docker rm'
alias dkl='docker logs'
alias dklf='docker logs -f'
@eugenestarchenko
eugenestarchenko / 30-income-calculon.pl
Created March 6, 2019 18:38 — forked from avar/30-income-calculon.pl
Calculate your income in The Netherlands with and without a 30% ruling.
# To check if this is up-to-date with the tax rates go to
# http://www.expatax.nl/tax-rates-2016.php and see if there's anything
# newer there.
#
# I make no guarantees that any of this is correct. I calculated this
# at the time and have been updating it when new tax rates come along
# because people keep finding this useful.
#
# There's also an interactive JS version of this created by
# @stevermeister at
@eugenestarchenko
eugenestarchenko / GitHub-Forking.md
Created January 18, 2019 11:54 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@eugenestarchenko
eugenestarchenko / awc-ecs-access-to-aws-efs.md
Created November 21, 2018 18:51 — forked from duluca/awc-ecs-access-to-aws-efs.md
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide:

Unfortunately as of writing this (Oct 18, 2017) there is no built in integration for multiple target groups per AWS ECS service. Here are a few things you can try:

  1. If your application just serves port 80 (HTTP) & port 443 (HTTPS) then you should consider using the application load balancer and terminating SSL at the load balancer. This will allow your application to function using just port 80.

  2. If your application serves different ports that are backed by different components, perhaps speaking different protocols then you should consider splitting the application into multiple ECS services. This has the benefit of allowing the different components to independently scale

@eugenestarchenko
eugenestarchenko / start.sh
Created September 24, 2018 11:56 — forked from cameck/start.sh
Getting AWS Credentials into to a Docker Container without Hardcoding It
AWS_ACCESS_KEY_ID=$(aws --profile default configure get aws_access_key_id)
AWS_SECRET_ACCESS_KEY=$(aws --profile default configure get aws_secret_access_key)
docker build -t my_app .
docker run -it --rm \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
kcachegrind=$(docker images --format '{{.Repository}}' |grep 'kcachegrind')
if [[ -z "$kcachegrind" ]]; then
docker_build_directory=/tmp/Dockerfile
mkdir -p $docker_build_directory
cd $docker_build_directory
# 如果 uid 不是 1000, 需要这里改正.
# The env variable and the folder /tmp/.X11-unix are needed to share your X11 process with the container.
# If you meet the following error when trying to launch it "Error: cannot open display: :0",
# use the following command: xhost +.