Skip to content

Instantly share code, notes, and snippets.

View webmaks's full-sized avatar
🏠
Working from home

Maksim Tarasenko webmaks

🏠
Working from home
View GitHub Profile
@webmaks
webmaks / .tmux.conf
Created March 17, 2021 11:49
Tmux beauty configuration
# Dracula Colours
# background_color '#282a36'
# current_line_color '#44475a'
# foreground_color '#f8f8f2'
# comment_color '#6272a4'
# cyan '#8be9fd'
# green '#50fa7b'
# orange '#ffb86c'
# pink '#ff79c6'
# purple '#bd93f9'
17 Nov 26 12:38:34 firewall-cmd --zone=public --add-port=443/udp --permanent
18 Nov 26 12:38:41 firewall-cmd --zone=public --add-port=443/tcp --permanent
19 Nov 26 12:38:47 firewall-cmd --reload
46 Nov 26 13:01:33 firewall-cmd --permanent --add-masquerade
171 Nov 21 14:57:41 firewall-cmd --zone-trusted --add-service openvpn
181 Nov 26 12:30:44 firewall-cmd state
182 Nov 26 12:30:54 firewall-cmd --state
183 Nov 26 12:31:23 firewall-cmd --get-default-zone
184 Nov 26 12:31:31 firewall-cmd --get-active-zone
185 Nov 26 12:31:50 firewall-cmd --list-all
@webmaks
webmaks / bat_with_ansible
Created May 11, 2020 15:01
Install bat with ansible
- name: get bat latest version
block:
- shell: curl --silent "https://api.github.com/repos/sharkdp/bat/releases/latest" | grep -Po '"tag_name"':' "\K.*?(?=")' warn=false
register: latest_release
- get_url:
url: https://github.com/sharkdp/bat/releases/download/{{latest_release.stdout}}/bat-{{latest_release.stdout}}-x86_64-unknown-linux-musl.tar.gz
dest: /tmp
- unarchive:
src: bat-{{latest_release.stdout}}-x86_64-unknown-linux-musl.tar.gz
dest: /tmp
@webmaks
webmaks / passwordGenerator.py
Created May 8, 2020 05:19
Generate password using own algo and get some from API
import string
import random
import requests
import json
alfabet = list(string.ascii_letters)
symbols = list(string.punctuation)
numbers = list(string.digits)
source = alfabet + symbols + numbers
@webmaks
webmaks / Bash.md
Last active May 8, 2020 05:18
Basic of bash

Got from https://devhints.io/bash


title: Bash scripting category: CLI layout: 2017/sheet tags: [Featured] updated: 2019-10-02 keywords:

  • Variables
@webmaks
webmaks / backup.bash
Created March 14, 2020 09:51
Creating backup of website and mysql and copy to AWS S3
#!/bin/bash
# backup.bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
TODAY="$(date +%Y)/$(date +%m)"
DAY=$(date +%d-%m-%Y)
TIME=$(date +%F_%H:%M:%S)
ALL="/home/BACKUPS"
SITES="${ALL}/sites/${TODAY}"
@webmaks
webmaks / published.sh
Created June 2, 2017 17:42
Mercurrial
#!/bin/sh
# publisher.sh
# The script send email notification in case someone
# published changes in /project/html repository
export PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/dell/srvadmin/bin:/home/user/bin
REPO="/project/html"
TMPD="/project/tmp"
LASTFNAME="last_revision.txt"
@webmaks
webmaks / Nginx Proxy
Created April 25, 2017 16:50
Easy setup nginx proxy to another server
server {
listen 80;
server_name domain.io www.domain.io;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
@webmaks
webmaks / locale fix
Created December 27, 2016 04:32
Solution You can fix the issue by setting the locale to en_US.UTF-8 for example:
Solution
You can fix the issue by setting the locale to en_US.UTF-8 for example:
$ export LANGUAGE=en_US.UTF-8
$ export LANG=en_US.UTF-8
$ export LC_ALL=en_US.UTF-8
$ locale-gen en_US.UTF-8
$ dpkg-reconfigure locales
#!/bin/bash
# mys.bash
# Usage ./mys.bash some.deb
if [[ -z "$1" ]]; then
echo -e "\n\tUsage:\n\t ./mys.bash some.deb\n"
exit 1
fi
DEB=$1