Skip to content

Instantly share code, notes, and snippets.

View ijin82's full-sized avatar
📺
https://youtu.be/1IInu3GafkM

Ilya Rogojin ijin82

📺
https://youtu.be/1IInu3GafkM
View GitHub Profile
#!/bin/bash
# Optional variables for a backup script
MYSQL_USER="root"
MYSQL_PASS="secret"
BACKUP_DIR=./$(date +%Y-%m-%d_%H%M%S);
test -d "$BACKUP_DIR" || mkdir -p "$BACKUP_DIR"
# Get the database list
for db in $(mysql -B -s -u $MYSQL_USER --password=$MYSQL_PASS -e 'show databases')
@ijin82
ijin82 / backup-folders-list.sh
Last active June 21, 2017 15:20
backup-folders-list.sh
#!/bin/bash
## config
backupFoldersList="
/home/user/projects/project-name
"
backupDstFolder="/home/user/projects-dump"
## /config
targetFolder="dump-$(date +%Y-%m-%d_%H%M%S)"
@ijin82
ijin82 / http-proxy-auth.go
Last active May 14, 2024 09:21
Simple HTTP proxy with authorization on golang
package main
import (
"github.com/elazarl/goproxy"
"github.com/elazarl/goproxy/ext/auth"
"log"
"net/http"
"flag"
)
@ijin82
ijin82 / second-redis-service.md
Last active March 20, 2019 16:08 — forked from inecmc/notes.md
How to run multiple Redis instances on Ubuntu 16.04, 18.04

Create the directory for the new instance

$ sudo install -o redis -g redis -d /var/lib/redis2

Create a new configuration file

$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
@ijin82
ijin82 / Backup-7z.PS1
Last active August 2, 2021 11:30
Windows 10 - Files backup script for Windows Scheduler (+ 7zip version with folders exclude by name)
### Requires 7-zip https://www.7-zip.org/
###
### Windows scheduler task (as hidden daily job):
### Execute: powershell.exe
### Argument: -WindowStyle Hidden "L:\Backups\Backup-7z.PS1"
##########################################################
####################### Config ###########################
### 7-zip exe file path
extension=php_pdo_sqlsrv_73_nts.so
extension=php_sqlsrv_73_nts.so
@ijin82
ijin82 / choco_install.ps1
Last active June 30, 2024 14:33
Usual Win apps quick install (PowerShell)
## Administrator powershell console needed
##
## Install choco: https://chocolatey.org/install
## Packages: https://chocolatey.org/packages
## List all installed: choco list --local-only
## Upgrade all installed: choco upgrade all
##
##
@ijin82
ijin82 / grafana_telegram_bot.md
Created February 24, 2021 18:07 — forked from ilap/grafana_telegram_bot.md
Grafana Telegram Alert

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather
@ijin82
ijin82 / ubuntu-vbox-add-drive-4mysql.md
Last active May 4, 2021 14:48
VirtualBox, additional disk for MySQL

VirtualBox, additional disk for MySQL

  • Open VirtualBox
  • File - Virtual Media Manager
  • Create - VDI - Dynamically Allocated - set path & size (60Gb good enough for us) - close
  • Stop your target VM
  • Go to VM settings (right click on VM)
  • Storage - Controller SATA - press plus icon "Add new storage attachment" - Hard disk
  • Choose your pre-created VDI disk - that have to appear as attached after addition
  • Start your target VM - Login to your VM (vagrant up - vagrant ssh)
@ijin82
ijin82 / fix-screen-broken-colors.md
Created August 27, 2021 23:43
FIX .screenrc broken colors in xterm-256color

Fix broken colors in screen (screen-256color $TERM)

Original solution

https://bbs.archlinux.org/viewtopic.php?id=67464

Fix

# use "term xterm-256color" in .screenrc
> infocmp -L xterm-256color > temp.terminfo
> vim temp.terminfo
# remove "back_color_erase," from second or third line