Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
AndersonIncorp /
Last active Mar 5, 2022
Short guide for setting up MikroTik ovpn server

CA cert

> System > Certificates
    > [Add new]
        Name: ca
        Country: UA
        Common name: ca
        Key size: 4096
 Key Usage: key cert. sign
AndersonIncorp /
Last active Mar 5, 2022
MIT License; Short guide for setting up openvpn-server service (tcp+udp), full network (redirect-gateway def1); Optional - Second VPS with traffic redirect to first via iptables; Optional - SSH tunneling for DPI prevention (pubkey)
$ pacman -S openvpn easy-rsa
$ cp -a /etc/easy-rsa/. /etc/easy-rsa-clientnet/
$ cd /etc/easy-rsa-clientnet/
$ export EASYRSA=$(pwd)
$ easyrsa init-pki
$ easyrsa build-ca nopass
$ easyrsa gen-req server nopass
$ easyrsa sign-req server server
AndersonIncorp /
Created Jun 29, 2018
Install any linux distro on VPS with low RAM, locked ISO boot



  • Your VPS provider doesn't support ISO mount
  • Your VPS has low RAM and cannot load whole ISO image
  • Your current /boot is to small to contain ISO file


  • Boot low memory ISO (CorePure64.iso ~ 14MB)
  • Create new partition ~1GB / size of your ISO
  • dd your ISO into that partition
AndersonIncorp /
Created Jun 27, 2018
Install into grub

Install into grub

wget -O /boot/
nano /etc/grub.d/40_custom
menuentry "" {
    linux16 (hd0,msdos1)/ # /boot is (hd0,msdos1) drive
# One of
AndersonIncorp / build-php-zts7.2.1-archlinux.txt
Created Mar 25, 2018
build-php-zts7.2.1-archlinux.txt php-zts7.2.1 or php7.2.1 without conflict with main php
View build-php-zts7.2.1-archlinux.txt
# ! /bin/bash
# Build of php-zts OR php (if remove --enable-maintainer-zts flag) as second php into /usr/local/php/php-zts7.2.1
# Based on
mkdir -p /root/aur-php/
cd /root/aur-php/
curl -O
tar -xzf php-zts.tar.gz -C patch
curl -O -L
AndersonIncorp / instal_bind.txt
Last active Nov 5, 2017
DNS Self hosted subzone *
View instal_bind.txt
### Install BIND
pacman -S bind
### Configure named.conf
# cp /etc/named.conf /etc/named.conf.bak
# nano /etc/named.conf
# diff /etc/named.conf.bak /etc/named.conf
< // listen-on-v6 { any; };
AndersonIncorp /
Last active Jan 24, 2022
postfix && dovecot virtual email setup (redirect to gmail+alias from domain)

postfix && dovecot virtual email setup (redirect to gmail+alias from domain)

Example shows 2 domains in 1 IP address && 1 postfix instance. All redirected to Gmail.
First domain used as myhostname and is main domain. Others is virtual_alias_domains
Dovecot configured to use passwd database without IMAP && POP3. SMTP auth only
Gmail configured to send emails from our domains (using smtp TLS port 25).
DNS && SPF && PTR records. Example provided.

Brief config overview
Domains /etc/postfix/
AndersonIncorp /
Created May 23, 2017
GRUB loading. Welcome to GRUB! error: file `/boot/grub/i386-pc/normal.mod` not found.
# GRUB loading.
# Welcome to GRUB!
# error: file `/boot/grub/i386-pc/normal.mod` not found.
# Entering rescue mode...
grub rescue> ls
hd(0) (hd0,msdos1)
grub rescue> set
AndersonIncorp / .bash_login
Last active Jul 10, 2018
Present info on terminal/ssh login. ~/.bash_login file
View .bash_login
## SSH Check
if [ -n "$SSH_CONNECTION" ] && [ "$SHLVL" == "1" ]; then
## pacman -S pacman-contrib
stat_mem=$(free -m | awk 'NR==2{printf "%s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }')
stat_disk=$(df -h | awk '$NF=="/"{printf "%d/%dGB (%s)\n", $3,$2,$5}')
stat_cpu=$(top -bn1 | grep load | awk '{printf "%.2f\n", $(NF-2)}')
echo -e -n " Date : `date +"%A, %e %B %Y, %r"`
Hostname : `hostname`
AndersonIncorp /
Last active Nov 30, 2021
OS X to Linux gcc cross compiler build (arch linux x86_64 as target)
set -e
# Prerequirements
# brew install gcc (gmp libmpc mpfr isl)
# copy /usr/lib && /usr/include from arch linux into your CC_ROOT.
# /usr/local/linux/usr/include
# /usr/local/linux/usr/lib
# /usr/local/linux/usr/local/include
# arch linux is target enviroment for this cross compiler
# x86_64 binutils && gcc