Skip to content

Instantly share code, notes, and snippets.

View stigfromsouth's full-sized avatar
👻

Alexander Belashev stigfromsouth

👻
  • LES LTD
  • Novocherkassk
View GitHub Profile
@stigfromsouth
stigfromsouth / rocketchat_docker_migrate.md
Last active January 25, 2022 06:50
How to migrate rocketchat docker containers on another server

Migrate rocketchat docker containers on another server

List our containers on old server

$ docker container list
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                    NAMES
9406c8b05996        rocketchat/rocket.chat:latest   "node main.js"           3 weeks ago         Up 6 hours          0.0.0.0:3000->3000/tcp   rocket_rocketchat_1_b8ee159f80c3
ea0e49de71ce        mongo:3.2                       "docker-entrypoint..."   3 weeks ago         Up 6 hours          27017/tcp                rocket_mongo_1_6ca5fa0882ca

Prepare, save & load images to another server

@stigfromsouth
stigfromsouth / proxypass.sh
Last active June 19, 2019 12:02
Script creates NGINX config files for proxy_pass on internal web hosts.
#!/bin/bash
###############################################################################
#
# Script creates NGINX config files for
# proxy_pass on internal web hosts
#
# begin: 19.06.2019
# author: Alexander Belashev aka Stigfromsouth
# version : 0.0.1
#
@stigfromsouth
stigfromsouth / tmux-cheatsheet.markdown
Created July 31, 2019 11:11 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@stigfromsouth
stigfromsouth / kvm-server-deploy.md
Last active September 25, 2019 13:31
Развертывание системы виртуализации KVM

Развертывание системы виртуализации KVM

https://www.cyberciti.biz/faq/install-kvm-server-debian-linux-9-headless-server/ https://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/

Установка пакетов KVM

sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils libguestfs-tools genisoimage virtinst libosinfo-bin

Добавляем пользователя в группу управления виртуальными машинами

sudo adduser belashev libvirt
@stigfromsouth
stigfromsouth / electric_safety_2018.md
Last active November 8, 2019 13:00
Билеты по электробезопасности на 3 и 4 группы.

Вопросы к билетам по ЭБ на 3 и 4 группы

  1. КАКИЕ ПОМЕЩЕНИЯ ОТНОСЯТСЯ К ОСОБО ОПАСНЫМ (В ОТНОШЕНИИ ОПАСНОСТИ ПОРАЖЕНИЯ ЛЮДЕЙ ЭЛЕКТРИЧЕСКИМ ТОКОМ)? (ПУЭ 1.1.13)
  • 1. Помещения с высокой температурой
  • 2. Помещения, где возможно одновременное прикосновение к заземленным металлоконструкциям зданий с одной стороны, и к металлическим корпусам электрооборудования – с другой.
  • 3. Помещения с особой сыростью.
  • 4. Помещения с наличием сырости или токопроводящей пыли.
  1. КАК КЛАССИФИЦИРУЮТСЯ ПОМЕЩЕНИЯ В ОТНОШЕНИИ ОПАСНОСТИ ПОРАЖЕНИЯ ЛЮДЕЙ ЭЛЕКТРИЧЕСКИМ ТОКОМ? (ПУЭ 1.1.13)
  • 1. Помещения без повышенной опасности, помещения с повышенной опасностью, особо опасные помещения.
@stigfromsouth
stigfromsouth / zeromq_install.sh
Last active January 15, 2020 08:42 — forked from cdjhlee/zeromq_install.sh
install zeromq in ubuntu 16.04 (tested)
#!/bin/bash
VER=$1
##############################################
#from http://zeromq.org/intro:get-the-software
##############################################
#install dependency
sudo apt-get update && \
sudo apt-get install -y libtool pkg-config build-essential autoconf automake uuid-dev
# Install libsodium
@stigfromsouth
stigfromsouth / VSCodeCPPSetup.md
Created March 16, 2020 13:39 — forked from BaReinhard/VSCodeCPPSetup.md
A Basic Setup for using VS Code with C++ 11 for CSIT Data Structures

Setting Up VS Code for C++ 11

This is for students who are running on a Non-Microsoft OS, or students who would rather use a lighter weight IDE

  1. First download VS Code and install it.

  2. Install a C++ extension in VS Code VS Code Extensions *The extension button is the square logo on the

@stigfromsouth
stigfromsouth / gist:b0ff4aa172f8b9cf8288f5ab903e359e
Created June 30, 2020 07:04 — forked from jimfinnis/gist:6823802
C++/C code to send UDP packets.
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <strings.h>
#include <string.h>
#include <fcntl.h>
#include <stdlib.h>

Useful LXD commands

Summarized from https://stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/.

Interestingly, the LXD command line client is named.... lxc!

List available containers

lxc image list ubuntu:        # ubuntu: is officially supported image source
lxc image list images:        # images: is an unsupported source
lxc image alias list images:  # lists user-friendly names