Skip to content

Instantly share code, notes, and snippets.

View damsfx's full-sized avatar

Damien MATHIEU damsfx

View GitHub Profile
@damsfx
damsfx / script-vps-secure-pro-max.sh
Created November 25, 2025 11:29 — forked from mozzypc/script-vps-secure-pro-max.sh
Sécurise ton serveur VPS avec ce script : 🔐 SSH sécurisé (utilisateur dédié, clé SSH, pas de mot de passe). 🛡️ Firewall UFW strict (SSH restreint, HTTP/HTTPS autorisés). 🚨 Fail2Ban activé pour bloquer les IPs en échec SSH. 🌍 IPv6 bloqué pour réduire les attaques possibles. 📡 ICMP limité pour éviter les abus (ping flood).
#!/bin/bash
# Script pour sécuriser son VPS
# Copyright MozzyPC (https://www.youtube.com/@mozzypc)
# Dernière mise à jour 02/2025
set -e # Arrête le script en cas d'erreur
# === Déclaration des variables ===
ACTIONS_DONE=() # Liste des actions effectuées pour un éventuel rollback

WinterCMS console command output

This is a console command used as a demonstration to quickly find the various possibilities offered by the output of a console command.

Infos

  1. Copy the file as TestOutputCommand.php in your plugin console directory
  2. Adapt namespace Acme\Myplugin\Console to your plugin
  3. Register the command in your plugin's plugin.php file

WinterCMS console command output

This is a console command used as a demonstration to quickly find the various possibilities offered by the output of a console command.

Infos

  1. Copy the file as TestOutputCommand.php in your plugin console directory
  2. Adapt namespace Acme\Myplugin\Console to your plugin
  3. Register the command in your plugin's plugin.php file
@damsfx
damsfx / check_translations.md
Last active February 22, 2023 18:21
Check translations in WinterCMS/OctoberCMS

In command prompt run :

php artisan tinker
function array_diff_key_recursive(array $arr1, array $arr2) {
    $diff = array_diff_key($arr1, $arr2);
 $intersect = array_intersect_key($arr1, $arr2);
@damsfx
damsfx / css-gradient-mixin.less
Last active October 21, 2015 08:55 — forked from brysongilbert/css-gradient-mixin.less
LESS Mixin for CSS/SVG Vertical Gradients
// Vertical gradient using CSS where possible, and base64-encoded SVG for IE9 (enables use of this in combination with border-radius)
// Based on this by Phil Brown: http://blog.philipbrown.id.au/2012/09/base64-encoded-svg-gradient-backgrounds-in-less/
// Also based on a mixin from Twitter Bootstrap: https://github.com/twitter/bootstrap
.gradient-vertical(@startColor, @endColor) {
// IE9 prep
@dataPrefix: ~"url(data:image/svg+xml;base64,";
@dataSuffix: ~")";
@dataContent: ~'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><linearGradient id="g743" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="0%" y2="100%"><stop stop-color="@{startColor}" offset="0"/><stop stop-color="@{endColor}" offset="1"/></linearGradient><rect x="0" y="0" width="1" height="1" fill="url(#g743)"/></svg>';