Skip to content

Instantly share code, notes, and snippets.

View mamashin's full-sized avatar
🎯
Focusing

Nikolay Mamashin mamashin

🎯
Focusing
View GitHub Profile
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@mamashin
mamashin / my.cnf
Created March 23, 2021 12:48 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated February 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@mamashin
mamashin / unifi-debian11-install.sh
Created April 5, 2023 10:56 — forked from cloudnull/unifi-debian11-install.sh
Install the latest Unifi Controller on Debian 11
#!/usr/bin/env bash
set -ev
set -o pipefail
# Install dependencies
apt update
apt -y install apt-transport-https ca-certificates wget dirmngr gnupg gnupg2 software-properties-common
# Install old mongo (requried).
@mamashin
mamashin / resize-image-keep-aspect-ratio.py
Created August 9, 2023 15:15 — forked from tomvon/resize-image-keep-aspect-ratio.py
Python script to resize an image while keeping the original aspect ratio.
#Resizes an image and keeps aspect ratio. Set mywidth to the desired with in pixels.
import PIL
from PIL import Image
mywidth = 300
img = Image.open('someimage.jpg')
wpercent = (mywidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))