Skip to content

Instantly share code, notes, and snippets.

View limushi's full-sized avatar

Maxim Lianov limushi

View GitHub Profile
@limushi
limushi / basic-bind.sh
Created August 2, 2024 06:59 — forked from SkaTeMasTer/basic-bind.sh
DNS Server -- Simple script to generate a basic bind configuration for home/lab use
#!/bin/bash
#
# Simple script to generate a basic bind configuration for home/lab use
#
# Local config - adjust as required
OWNIP=192.168.111.3
NETWORK=192.168.111.0
NETMASK=/24
DNS1=192.168.111.1
@limushi
limushi / rabbitmq-cluster.md
Created July 31, 2024 13:14 — forked from pobsuwan/rabbitmq-cluster.md
How to config rabbitmq server cluster [3 nodes]

How to config rabbitmq server cluster [3 nodes]

Edit /etc/hosts

vi /etc/hosts
192.168.10.157  rabbitmq-1
192.168.10.159  rabbitmq-2
192.168.10.161  rabbitmq-3
@limushi
limushi / ocserv.conf
Created July 4, 2024 08:56 — forked from wongsyrone/ocserv.conf
ocserv configuration file example.
# User authentication method. Could be set multiple times and in
# that case all should succeed. To enable multiple methods use
# multiple auth directives. Available options: certificate, certificate[optional],
# plain, pam.
#auth = "certificate"
#auth = "plain[./ocserv-passwd]"
#auth = "pam"
# This indicates that a user may present a certificate. When that option
# is set, individual users or user groups can be forced to present a valid
@limushi
limushi / alert.sh
Created January 27, 2024 17:07 — forked from cherti/alert.sh
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@limushi
limushi / remove-all-from-docker.sh
Created June 28, 2023 10:48 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@limushi
limushi / git.txt
Created May 24, 2023 10:27 — forked from AnatoliyNBulyga/git.txt
GIT list (шпаргалка по git-github)
Инициализировать новый репозиторий:
1
git init rep-name
Клонировать репозиторий с удаленного сервера:
1
git clone git@bitbucket.org:afiskon/hs-textgen.git
Добавить в репозиторий файл:
1
git add file.txt
Удалить файл из репозитория:
@limushi
limushi / README.md
Created March 29, 2023 22:07 — forked from mattupstate/README.md
An example of how to setup streaming replication for PostgreSQL with Docker.

PostgreSQL Streaming Replication With Docker

The *.txt files here hold user and database parameters. Specifically, replication.txt contains the user/role and password to use for replication. Whereas database.txt contains an initial database, user/role and password to create on the master.

Run the master:

$ fig run -d master

Wait for it to start up completely. Start the slave:

@limushi
limushi / snat_dnat_advantech.md
Created February 14, 2023 19:25 — forked from tomasinouk/snat_dnat_advantech.md
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP

@limushi
limushi / beowulf-cluster.md
Created July 9, 2022 13:04 — forked from arifsisman/beowulf-cluster.md
Beowulf Cluster Setup

Beowulf Cluster Setup

1. Introduction

A Beowulf cluster is a computer cluster of similar computers networked into a small local area network with libraries and programs installed which allow processing to be shared among them. The result is a high-performance parallel computing cluster from the inexpensive personal computer hardware.

This project aims to create a Beowulf Cluster which computes bigram analysis on a news data set. 2 virtual worker nodes and 1 virtual master node used for the cluster, all operating with Ubuntu Server 16.04.