-
Create an empty file to prevent the service from starting
sudo touch /etc/cloud/cloud-init.disabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://download2.mikrotik.com/routeros/6.40.5/chr-6.40.5.img.zip -O chr.img.zip && \ | |
gunzip -c chr.img.zip > chr.img && \ | |
apt-get update && \ | |
apt install -y qemu-utils pv && \ | |
qemu-img convert chr.img -O qcow2 chr.qcow2 && \ | |
qemu-img resize chr.qcow2 `fdisk /dev/vda -l | head -n 1 | cut -d',' -f 2 | cut -d' ' -f 2` && \ | |
modprobe nbd && \ | |
qemu-nbd -c /dev/nbd0 chr.qcow2 && \ | |
echo "Give some time for qemu-nbd to be ready" && \ | |
sleep 2 && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function echo_mem_stat () { | |
mem_total="$(free | grep 'Mem:' | awk '{print $2}')" | |
free_mem="$(free | grep 'Mem:' | awk '{print $7}')" | |
mem_percentage=$(($free_mem * 100 / $mem_total)) | |
swap_total="$(free | grep 'Swap:' | awk '{print $2}')" | |
used_swap="$(free | grep 'Swap:' | awk '{print $3}')" | |
swap_percentage=$(($used_swap * 100 / $swap_total)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# shows aoutput device | |
# xrandr | grep -e " connected [^(]" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/" | |
# to output desired resolutuion parameteres | |
# cvt 1920 1080 60 | |
# set desired resolution parameters | |
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync |
Project moved to https://gitlab.com/kbeflo/fiberhomesuperadmin due to excessive amount of unicorns.
Discussion here on Gist is still allowed but I strongly recommend going over to Gitlab or Discord chat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
postgres: | |
container_name: postgresql | |
image: postgres:10 | |
restart: always | |
environment: | |
POSTGRES_PASSWORD: "password" | |
ports: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:alpine AS builder | |
RUN apk update && apk add --no-cache git ca-certificates tzdata && update-ca-certificates | |
RUN adduser -D -g '' appuser | |
ENV GO111MODULE=on | |
WORKDIR /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[sshd] | |
enabled = true | |
[INCLUDES] | |
before = paths-fedora.conf | |
[DEFAULT] | |
ignorecommand = | |
bantime = 60m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - Add this lines to the end of /etc/ufw/after.rules | |
# BEGIN UFW AND DOCKER | |
*filter | |
:ufw-user-forward - [0:0] | |
:DOCKER-USER - [0:0] | |
-A DOCKER-USER -j RETURN -s 10.0.0.0/8 | |
-A DOCKER-USER -j RETURN -s 172.16.0.0/12 | |
-A DOCKER-USER -j RETURN -s 192.168.0.0/16 |
NewerOlder