Skip to content

Instantly share code, notes, and snippets.

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

Jonas Rosado jonaswebdev

🏠
Working from home
View GitHub Profile
@jonaswebdev
jonaswebdev / jail.local
Created December 19, 2024 03:01 — forked from wpottier/jail.local
Fail2ban -> slack
# ban & send a notification on slack
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
slack[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s", sendername="%(sendername)s"]
# Choose default action. To change, just override value of 'action' with the
# interpolation to the chosen action shortcut (e.g. action_mw, action_mwl, etc) in jail.local
# globally (section [DEFAULT]) or per specific section
action = %(action_with_slack_notification)s
@jonaswebdev
jonaswebdev / fix-wordpress-permissions.sh
Created October 30, 2020 04:21 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@jonaswebdev
jonaswebdev / docker-php-ext-install.md
Created April 14, 2020 19:47 — forked from giansalex/docker-php-ext-install.md
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@jonaswebdev
jonaswebdev / convert-encoding-to-utf8.sh
Created May 31, 2018 19:21
Script Convert/Update File encoding to UTF-8 in mass/batch (Eg: WINDOWS-1252 to UTF-8)
#!/bin/sh
for file in $(find . -name "*.php" -type f)
do
iconv -f WINDOWS-1252 -t UTF-8 "$file" > "$file".utf8 && mv "$file".utf8 "$file" && echo "Success: $file"
done