Skip to content

Instantly share code, notes, and snippets.

View kesor's full-sized avatar
🏠
Working from home

Evgeny Zislis kesor

🏠
Working from home
View GitHub Profile
@kesor
kesor / component-app.js
Last active April 23, 2024 15:18
Vue.js 3.x with ES6 modules in the browser using import-map
import { defineAsyncComponent } from 'vue'
const Content = defineAsyncComponent(() => import('./component-content.js'))
export default {
name: 'App',
components: { Content },
template: /*html*/`
<Content />
`
@kesor
kesor / docker-compose.yaml
Last active July 13, 2020 10:51
Docker Compose for ElasticSearch + Kibana 7.8
# Create an EBS volume and attach to the EC2 instance
# Format as XFS and mount at /mnt/elastic-data
# /dev/nvme2n1 on /mnt/elastic-data type xfs (rw,relatime,attr2,inode64,noquota)
# For ElasticSearch to work - got to change this sysctl:
#
# sudo sysctl vm.max_map_count=262144
#
# $ cat docker-compose.yml
@kesor
kesor / docker-compose.yaml
Created July 13, 2020 10:49
Docker Compose for ElasticSearch + Kibana 7.8
# Create an EBS volume and attach to the EC2 instance
# Format as XFS and mount at /mnt/elastic-data
# /dev/nvme2n1 on /mnt/elastic-data type xfs (rw,relatime,attr2,inode64,noquota)
# $ cat docker-compose.yml
version: "3.7"
services:
elasticsearch:
@kesor
kesor / docker-compose.yaml
Created July 13, 2020 10:49
Docker Compose for ElasticSearch + Kibana 7.8
# Create an EBS volume and attach to the EC2 instance
# Format as XFS and mount at /mnt/elastic-data
# /dev/nvme2n1 on /mnt/elastic-data type xfs (rw,relatime,attr2,inode64,noquota)
# $ cat docker-compose.yml
version: "3.7"
services:
elasticsearch:
@kesor
kesor / utils.sh
Created July 1, 2020 07:57
example utils.sh
#!/bin/bash
# Common utility functions for bash scripts,
# - fatal -- use like `some_cmd || fatal "Some cmd failed"`
# - debug -- use like `debug "This is a debug message"`
# - timer -- use like `tm some_cmd` as a wrapper
# - retry -- use like `retry some_cmd` as a wrapper, retries with exp. backoff
#
# Source this bash like so: `. util.sh`
#
@kesor
kesor / Dockerfile
Last active June 18, 2020 11:23
example node.js production Dockerfile
FROM node:14.4
RUN DEBIAN_FRONTEND=noninteractive apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /app \
&& chown node:node /app
ENV NODE_ENV production
@kesor
kesor / debug-grid.css
Created June 8, 2020 08:25
debug css grid
/* DEBUG Grid */
body {
position: relative;
background: blue;
}
body:after {
background-size: var(--grid-size) var(--grid-size);
background-repeat: repeat;
background-image:
linear-gradient(
controller:
kind: DaemonSet
ingressClass: XXX-ingress
daemonset:
useHostPort: true
hostPorts:
http: 68888
https: null
containerPort:
http: 68888
@kesor
kesor / docker-cli-install.sh
Last active May 25, 2020 16:29
install docker-cli on centos/amazon-linux
## optional: run the amazon cli container
docker run -ti --rm --name amazon-cli \
-v ~/.aws:/root/.aws \
-v ~/.docker:/root/.docker \
-v /var/run/docker.sock:/var/run/docker.sock \
--entrypoint /bin/bash \
amazon/aws-cli
## (slow) optional: generate yum repository configuration using an additional tool
@kesor
kesor / http-fs-server.js
Created May 22, 2020 20:08
Node.js HTTP server to stream static files from the filesystem
// based on https://nodejs.org/en/knowledge/HTTP/servers/how-to-serve-static-files/
const http = require('http'),
fs = require('fs')
const PORT = process.env.PORT || '8080'
function handler(req, res) {
const filename = __dirname + req.url
let stat