Skip to content

Instantly share code, notes, and snippets.

View WeslyG's full-sized avatar
🎯
Focusing

Vladimir Lila WeslyG

🎯
Focusing
  • Yandex.Cloud
  • Yekaterinburg
View GitHub Profile
@WeslyG
WeslyG / elk6
Last active March 24, 2020 18:00
Elasticsearch 6 docker-compose + kibana
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.7
ports:
- 9200:9200
- 9300:9300
environment:
- discovery.type=single-node
@WeslyG
WeslyG / js
Created September 15, 2019 18:08
express
import express from 'express';
import { createEvent } from '../controllers/Events/createEvent';
import { getEvents } from '../controllers/Events/getEvents';
import { updateEvent } from '../controllers/Events/updateEvent';
import { deleteEvent } from '../controllers/Events/deleteEvent';
const router = express.Router();
router.route('/events')
.get(async (req, res) => {
// all action in controller
@WeslyG
WeslyG / dlib dockerfile
Created August 2, 2019 07:56
dlib ubuntu docker
FROM ubuntu:18.10
RUN apt-get update && \
apt-get install build-essential cmake -y && \
apt-get install libopenblas-dev liblapack-dev -y && \
apt-get install libx11-dev libgtk-3-dev -y && \
apt-get install python python-dev python-pip -y && \
apt-get install python3 python3-dev python3-pip -y
# build ~3-4 hours(!) on i7 8700k + 960pro (nvme ssd)
@WeslyG
WeslyG / adguard block list
Last active January 12, 2021 11:55
Adguard
vk.com###stories_feed_wrap
stackoverflow.com###js-gdpr-consent-banner
99percentinvisible.org###cookie-policy
serverfault.com###js-gdpr-consent-banner
superuser.com###js-gdpr-consent-banner
vk.com##.feed_friends_recomm
vk.com###feed_filters
ntv.ru###newcontent
unix.stackexchange.com###js-gdpr-consent-banner
askubuntu.com###js-gdpr-consent-banner
@WeslyG
WeslyG / .editconfig
Created July 1, 2019 11:17
.editconfig
# EditorConfig is awesome: http://EditorConfig.org
root = true
[*]
charset = utf-8
indent_size = 2
end_of_line = lf
indent_style = space
insert_final_newline = true
@WeslyG
WeslyG / hyper
Last active May 6, 2019 14:57
js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@WeslyG
WeslyG / Ansible
Last active December 25, 2021 15:31
Shell Usage
# roles when
roles:
- { role: main, when: inventory_file|basename == 'inventory' }
# WSL connection bug
# https://stackoverflow.com/questions/62363901/ansible-msg-failed-to-create-temporary-directory-in-some-cases-fatal
mv /usr/bin/sleep /usr/bin/sleep.dist
ln -s /bin/true /usr/bin/sleep
# Run locally
@WeslyG
WeslyG / move docker volume (backup and restore docker volume)
Created July 23, 2018 12:35
Перенос docker volume между серверами
Как мигрировать docker volume на примере elasticsearch
# Backup
Запускаем елку, и вкидываем в нее данные, хоть через апи, хоть elasticdump
После этого в вольюмах будет много данных (тестировалось на 2 елке)
Смотрим оф руководство https://docs.docker.com/storage/volumes/#backup-a-container
file, err := ioutil.ReadFile("/path/to/index.txt")
if err != nil {
fmt.Print(err)
}
str := string(file)
fmt.Println(str)