Skip to content

Instantly share code, notes, and snippets.

View duluca's full-sized avatar
💭
😎

Doguhan Uluca duluca

💭
😎
View GitHub Profile
@duluca
duluca / npm-scripts-for-docker.md
Last active April 8, 2024 09:52
npm scripts for Docker

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

How to Use

npm i -g mrm-task-npm-docker
npx mrm npm-docker

Contribute

Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker

@duluca
duluca / awc-ecs-access-to-aws-efs.md
Last active December 9, 2023 11:36
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:

@duluca
duluca / Angular VS Code Settings.md
Last active January 7, 2023 03:54
Optimizing VS Code for Angular Development.

Configure VS Code and Angular project with an optimized development experience using a CLI tool

How to Use

npm i -g mrm-task-angular-vscode
npx mrm angular-vscode

Details

Configures:

@duluca
duluca / package.json
Created January 5, 2017 14:23 — forked from kgroat/package.json
An example of how to use npm as a build tool along with TypeScript
{
"name": "playground",
"version": "1.0.0",
"main": "server/app.js",
"private": true,
"scripts": {
"clean": "npm run clean:client && npm run clean:server",
"clean:client": "rm -rf public/*.* && rm -rf public/**/*.* && rm -rf src/ts/*.js && rm -rf src/ts/**/*.js",
"clean:server": "rm -rf server/*.{js,d.ts} && rm -rf server/**/*.{js,d.ts}",
"compile": "npm run compile:client && npm run compile:sass && npm run compile:server && npm run compile:static",
@duluca
duluca / aws-ecs-deploy-permissions.md
Last active April 14, 2021 06:44
npm scripts for AWS ECS (Blue-Green Deployment)

AWS ECS Deploy Permissions

In order to be able to deploy using the scripts provided by npm scripts for AWS ECS make sure your user is part of an IAM Group that has the following inline policy applied to it.

Note: This may not be complete.

{
    "Version": "2012-10-17",
    "Statement": [
@duluca
duluca / load-test.sh
Created January 18, 2018 00:11 — forked from bigomega/load-test.sh
A simple bash script to do load (performance) testing of a web service
max="$1"
date
echo "url: $2
rate: $max calls / second"
START=$(date +%s);
get () {
curl -s -v "$1" 2>&1 | tr '\r\n' '\\n' | awk -v date="$(date +'%r')" '{print $0"\n-----", date}' >> /tmp/perf-test.log
}
@duluca
duluca / StartingWithDocker.md
Last active June 30, 2020 02:20
Starting with Docker

What is Docker?

  • Docker is an open platform for developing, shipping, and running applications.
  • Combines a lightweight container virtualization platform with workflows and tooling that help manage and deploy applications.

Why is Containerization Important?

  • Containerization allows for encapsulation of app specific configuration concerns.
  • Encapsulation allows for decoupling of dependencies, so each app can depend on different versions.
  • Simpler dependency management results in a low friction IT environment, less things to learn and break.
  • Low friction allows to ship code faster, test faster, deploy faster, shortening the cycle between writing code and running code.

Keybase proof

I hereby claim:

  • I am duluca on github.
  • I am dougi (https://keybase.io/dougi) on keybase.
  • I have a public key ASCO4mKqid0D1Vjc9P3iDzh9SNMkXbugEMCqFbpsybDfrQo

To claim this, I am signing this object:

@duluca
duluca / common-commands.md
Last active September 11, 2018 14:20
Commonly Used, but Oft-Forgotten CLI Commands

Commonly Used, but Oft-Forgotten CLI Commands

MacOS

  • zip -e my_zip_file.zip your_original_file.docx

SSH

  • ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
  • eval "$(ssh-agent -s)"
  • ssh-add -K ~/.ssh/id_rsa use this to add existing key to your terminal session
@duluca
duluca / http-server.js
Created March 12, 2017 00:47
No plug-in http server for Node.js
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8080;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), "public", uri);