Skip to content

Instantly share code, notes, and snippets.

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

Paul Nike m4tlch

🏠
Working from home
  • Ukraine
View GitHub Profile
@m4tlch
m4tlch / my.cnf
Created October 14, 2023 21:15 — forked from kanibaspinar/my.cnf
Mysql My.cnf Optimization - Best Performance For 1000 + Sites Web Server
# Optimized MySQL configuration for cPanel servers by Kani Baspinar - Updated June 2016
#
# The settings provided below are a starting point for a 24GB RAM server with 8 CPU cores.
# If you have less or more resources available you MUST adjust accordingly to save CPU, RAM and disk I/O usage.
# To fine tune these settings for your system, use MySQL DB diagnostics tools like:
# Test your configuration ; https://launchpad.net/mysql-tuning-primer
# or
# http://blog.mysqltuner.com/download/
# Note that if there is NO comment beside a setting, then you don't need to adjust it.
#
sudo touch /usr/share/pipewire/media-session.d/with-pulseaudio
systemctl --user restart pipewire-session-manager
@m4tlch
m4tlch / win-clear.bat
Last active March 8, 2023 18:36
Чистка обновлений-жучков, отключение телеметрии Windows 7/8/10
@echo off
echo
echo Step 1: Delete Updates...
echo Delete KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249
echo Delete KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149
echo Delete KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917
https://askubuntu.com/a/1390848
With MySQL8, they have turned on binary logging by default and the default purge (expiry/deletion) of binary logs is set to 30days.
Once you are in your SSH and in mysql, you can use the below commands
To show binary logs
mysql> SHOW BINARY LOGS;
To Purge binary logs manually until some point
@m4tlch
m4tlch / Mouse Scroll Wheel Speed Setting in Ubuntu
Created August 14, 2022 07:13 — forked from mengtongun/Mouse Scroll Wheel Speed Setting in Ubuntu
Adjust the mouse wheel speed in Ubuntu by using a line of script
Just run this script you can adjust the value of the speed. Thanks to the creator! nicknorton.net
bash <(curl -s nicknorton.net/mousewheel.sh)
@m4tlch
m4tlch / Drupal 8 on VestaCP.md
Last active July 26, 2022 05:59
Templates for Drupal 8 on VestaCP

Each file should be put in /usr/local/vesta/data/templates/web/apache2

Then, when you edit your domain/site, you can change the web template to Drupal8 and just upload your whole project into public_html

@m4tlch
m4tlch / cmder-in-webstorm.md
Created July 8, 2022 11:33 — forked from sadikaya/cmder-in-webstorm.md
Cmder inside Webstorm terminal
  1. Set an environment variable called CMDER_ROOT to your root Cmder folder (in my case C:\Program Files (x86)\Cmder). It seems to be important that this does not have quotes around it because they mess with concatenation in the init script.
  2. In your IntelliJ terminal settings, use "cmd" /k ""%CMDER_ROOT%\vendor\init.bat"" as the Shell path. The double-double-quotes are intentional, as they counteract the missing double quotes in the environment variable.
@m4tlch
m4tlch / Laravel on VestaCP.md
Created July 29, 2018 20:53 — forked from peterbrinck/Laravel on VestaCP.md
Laravel web templates for VestaCP

I've made a new web template to make Laravel work easily on VestaCP, and so I wouldn't have to change my Laravel installation, if I ever wanted to deploy it elsewhere.

Each file should be put in /usr/local/vesta/data/templates/web/apache2

Then, when you edit your domain/site, you can change the web template to Laravel and just upload your whole project into public_html

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2

@m4tlch
m4tlch / Model.js
Created December 26, 2021 13:09 — forked from lorisleiva/Model.js
// resources/js/models/Model.js
export default class Model {
constructor (attributes = {}) {
this.fill(attributes)
}
static make (attributes = {}) {
return Array.isArray(attributes)
? attributes.map(nested => new this(nested))