Skip to content

Instantly share code, notes, and snippets.

@sutlxwhx
sutlxwhx / README.md
Last active Aug 24, 2018
How to backup your LAMP / LEMP installation the right way
View README.md

Introduction

This is the LAMP / LEMP environment backup guide in case you want or need to try my highload LEMP installation.

Basic usage

As a first thing we will setup a variable that will store current date and time. We will use year-month-day_hours-minutes-seconds format:

now=$(date +"%Y-%m-%d_%H-%M-%S")
@sutlxwhx
sutlxwhx / README.md
Last active Aug 24, 2018
How to install LAMP stack on Windows 7 / 8 / 10
View README.md

Introduction

This guide will help you install LAMP stack on your Windows machine. I made this to help people who want to use or try any of my projects on their local or remote computers under Windows OS.

Requirements

The fastest way to install LAMP stack on your Windows machine is to use WAMP. It comes with a lot of preinstalled modules for Apache and PHP-FPM along with Nginx and MySQL.

Configuration

@sutlxwhx
sutlxwhx / README.md
Last active May 10, 2021
Enable RDP and access to the virtual machines for your Proxmox installation
View README.md

Introduction

This tuturial will help you configure network for your fresh Proxmox istallation.
Be aware that Proxmox configuration was made using this tutorial.

Installation

Backup your current /etc/network/interfaces using this command:

cp /etc/network/interfaces /etc/network/interfaces.backup
@sutlxwhx
sutlxwhx / README.md
Last active Jun 29, 2021
Installation of Proxmox 5 on Debian 9
View README.md

Introduction

This tutorial will help you install Proxmox 5 on a freshly installed Debian 9.
It was tested on a dedicated server at hetzner.

Installation

Fisrt things first. Create a custom repository to pickup Proxmox related packages:

echo "deb http://download.proxmox.com/debian/pve stretch pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
wget http://download.proxmox.com/debian/proxmox-ve-release-5.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg
@sutlxwhx
sutlxwhx / README.md
Last active Aug 22, 2018
Use Nginx as a Reverse Proxy to another Nginx
View README.md

Instroduction

This tutorial will show how you can setup Nginx as a Reverse Proxy to another Nginx server with a least amount of code.

Installation

Point your A DNS record to the first server that will accept the initial request and then redirect it to second server On that first server use the following setup fo default enabled site:

server {
	listen 80;
@sutlxwhx
sutlxwhx / backup.sh
Last active Apr 27, 2021
Backup all your MySQL / MariaDB databases with rclone
View backup.sh
#!/usr/bin/env bash
# To run this script you need to install https://rclone.org/ first
# Use current date and time for future backup folder name
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
# Declare the directory where the temporary backup files will be stored
BACKUP_DIR="/backup/$TIMESTAMP/mysql"
# State the username for your MySQL / MariaDB instace that can access the neccessary databases
MYSQL_USER=""
# Point this script to mysql executable file
MYSQL=/usr/bin/mysql
@sutlxwhx
sutlxwhx / README.md
Last active Aug 24, 2018
Synchronize folders between two servers using rclone and ssh-agent with ssh based authorisation
View README.md

Introduction

This tutorial will help you transfer your folders / files between two server using rclone and ssh-agent.
It was tested between two Ubuntu 16.04 servers.

Installation

First things first. We need to install the neccessary packages:

apt-get update -y
@sutlxwhx
sutlxwhx / Empt.php
Last active Aug 24, 2018
Delete empty lines in the file and save it
View Empt.php
<?php
/**
* @author https://gist.github.com/sutlxwhx
*
* @version 0.2
*
* @license Apache License 2.0
*
*/
@sutlxwhx
sutlxwhx / README.md
Last active Jul 19, 2021
Comparison of different popular VPS providers
View README.md
@sutlxwhx
sutlxwhx / extract.js
Last active Aug 20, 2018
Copy to the clipborad list of all h1/h2/h3 elements on the page
View extract.js
# Declare tag name that you want to extract
var elements = document.getElementsByTagName("h2");
# Create a temporary element where all the data will be stored
var buffer = document.createElement("buffer");
document.body.appendChild(buffer);
# Declare the string var where all the data from the page will be stored
var names = '';
# Create a foor loop and append all new elements to the string
for(var i=0; i<elements.length; i++) {
names += elements[i].innerText + '\n';;