Skip to content

Instantly share code, notes, and snippets.

View mhwh-dev's full-sized avatar
💭
Science is the knowledge of the universe

Edgar AP mhwh-dev

💭
Science is the knowledge of the universe
View GitHub Profile
@mhwh-dev
mhwh-dev / validate_cidr.php
Created November 10, 2021 14:57 — forked from mdjekic/validate_cidr.php
PHP function for validating CIDR notation format (ipv4, ipv6)
<?php
/**
* Validates the format of a CIDR notation string
*
* @param string $cidr
* @return bool
*/
function validateCidr($cidr)
{
@mhwh-dev
mhwh-dev / emojis.json
Created November 8, 2021 02:51 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "&#128104;&zwj;&#128105;&z
@mhwh-dev
mhwh-dev / linux_performance.md
Created October 22, 2021 09:46 — forked from Nihhaar/linux_performance.md
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

@mhwh-dev
mhwh-dev / README.md
Created October 18, 2021 17:11 — forked from mrl22/README.md
VestaCP NGINX Web Template for WordPress in a Directory (blog) with force HTTPS and WWW, Upload to /usr/local/vesta/data/templates/web/nginx/php-fpm

Save these files and to upload to /usr/local/vesta/data/templates/web/nginx/php-fpm

Rename any instance of "blog" to the name of your wordpress directory.

After this, edit your domain in the VestaCP admin and choose the web template "wordpress2blog_rewrite".

www.webfwd.co.uk

@mhwh-dev
mhwh-dev / translitera
Created August 25, 2021 18:57 — forked from ekam230/translitera
Транслитерация названий страниц на PHP в ЧПУ
Транслитерация названий страниц на PHP в ЧПУ
Следующая функция PHP помогает произвести транслитерацию заголовка страницы в ЧПУ с русского и казахского языков на английский язык:
<?php
function translitURL($str)
{
$tr = array(
"А"=>"a","Б"=>"b","В"=>"v","Г"=>"g",
"Д"=>"d","Е"=>"e","Ё"=>"yo","Ж"=>"zh","З"=>"z","И"=>"i",
@mhwh-dev
mhwh-dev / 00-clamav-notes.sh
Created August 11, 2021 09:42 — forked from AfroThundr3007730/00-clamav-notes.sh
My notes on getting ClamAV working on CentOS 7
# How to get ClamAV working on CentOS 7
yum -y install epel-release && yum -y update
yum -y install clamav clamav-data clamav-scanner clamav-scanner-systemd clamav-server clamav-server-systemd clamav-unofficial-sigs clamav-update
# Add /etc/clamd.d/freshclam.conf
# Add /usr/lib/systemd/system/clamav-freshclam.service
systemctl enable clamav-freshclam.service && systemctl start clamav-freshclam.service
@mhwh-dev
mhwh-dev / shmsetup.sh
Created August 10, 2021 17:29 — forked from jodell/shmsetup.sh
kernel shared memory calculator
#!/bin/bash
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php
# Output lines suitable for sysctl configuration based
# on total amount of RAM on the system. The output
# will allow up to 50% of physical memory to be allocated
# into shared memory.
# On Linux, you can use it as follows (as root):
#
# ./shmsetup >> /etc/sysctl.conf
@mhwh-dev
mhwh-dev / .MOVED.md
Created August 5, 2021 11:41 — forked from eggyu/.MOVED.md
IPsec L2TP VPN Server Auto Setup Script for Ubuntu and Debian
#!/bin/sh
#----------------------------------------------------------#
# settings #
#----------------------------------------------------------#
#text colors
redtext() { echo "$(tput setaf 1)$*$(tput setaf 9)"; }
greentext() { echo "$(tput setaf 2)$*$(tput setaf 9)"; }
yellowtext() { echo "$(tput setaf 3)$*$(tput setaf 9)"; }
#!/bin/sh
#----------------------------------------------------------#
# settings #
#----------------------------------------------------------#
#text colors
redtext() { echo "$(tput setaf 1)$*$(tput setaf 9)"; }
greentext() { echo "$(tput setaf 2)$*$(tput setaf 9)"; }
yellowtext() { echo "$(tput setaf 3)$*$(tput setaf 9)"; }