Skip to content

Instantly share code, notes, and snippets.

@sutlxwhx
sutlxwhx / README.md
Last active September 1, 2021 15:23
How to backup your LAMP / LEMP installation the right way

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 May 28, 2024 14:43
How to install LAMP stack on Windows 7 / 8 / 10

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 March 13, 2024 14:44
Enable RDP and access to the virtual machines for your Proxmox installation

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 March 13, 2024 14:43
Installation of Proxmox 5 on Debian 9

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 August 22, 2018 12:11
Use Nginx as a Reverse Proxy to another Nginx

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 February 1, 2024 21:08
Backup all your MySQL / MariaDB databases with rclone
#!/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 September 2, 2024 01:00
Synchronize folders between two servers using rclone and ssh-agent with ssh based authorisation

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 August 24, 2018 23:14
Delete empty lines in the file and save it
<?php
/**
* @author https://gist.github.com/sutlxwhx
*
* @version 0.2
*
* @license Apache License 2.0
*
*/
@sutlxwhx
sutlxwhx / README.md
Last active October 28, 2023 07:29
Comparison of different popular VPS providers
@sutlxwhx
sutlxwhx / extract.js
Last active August 20, 2018 18:15
Copy to the clipborad list of all h1/h2/h3 elements on the page
# 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';;