If you haven't already, install fail2ban and ufw:
sudo apt-get install fail2ban ufw
Now make a copy of the fail2ban configuration, and name it jail.local
:
#!/bin/bash | |
#title :magento2-setup.sh | |
#description :This script will install Magento from github | |
#author :Shine Software Italy | |
#date :20170202 | |
#version :0.1 | |
#usage :Set the execution permission for this file and then call it ./magento2-setup.sh | |
#notes :Install Composer and cURL to use this script. |
<?php | |
// Source: http://www.jonasjohn.de/snippets/php/headers.htm | |
// Use this header instruction to fix 404 headers | |
// produced by url rewriting... | |
header('HTTP/1.1 200 OK'); | |
// Page was not found: | |
header('HTTP/1.1 404 Not Found'); |
<?php | |
/** | |
* Clean HTML string removing all element attributes and elements which are | |
* not in the provided whitelist (but keeping their allowed children). | |
* | |
* @see https://github.com/alixaxel/phunction/blob/master/phunction/HTML.php | |
* @param string $html to clean | |
* @param array $whitelist | |
*/ | |
function clean_html($html, array $whitelist) |
#find . -type f -name '*.png' -exec optipng -o5 -quiet -preserve {} \; | |
#find . -type f -name '*.jp*' -exec mogrify -compress jpeg -quality 70 {} \; | |
find . -type f -iname "*.jp*g" | xargs mogrify -resize '1280x1280>' | |
find . -type f -iname "*.jp*g" | xargs jpegoptim --strip-all --max=90 | |
# With parallel | |
find . -type f -iname "*.jp*g" -print0 | parallel --progress -0 -j +0 "mogrify -resize 1280x1280\> {}" | |
find . -type f -iname "*.jp*g" | parallel --progress "jpegoptim --strip-all --max=65 {}" |
In /etc/default/grub
, modify:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off"
Then sudo update-grub
<html> | |
<body> | |
<p>Here are Webber’s points:</p> | |
<ul> | |
<li>If a method can be static, declare it static. Speed improvement is by a factor of 4.</li> | |
<li>echo is faster than print.(<em>* compare with list from phplens by John Lim</em>)</li> | |
<li>Use echo’s multiple parameters instead of string concatenation.</li> | |
<li>Set the maxvalue for your for-loops before and not in the loop.</li> | |
<li>Unset your variables to free memory, especially large arrays.</li> | |
<li>Avoid magic like __get, __set, __autoload</li> |
#!/bin/bash | |
## | |
## New IP login notification script | |
## 2009-11-20 00:28 Samuele ~redShadow~ Santi | |
## 2018-06-04 12:53 ElliotNB | |
## 2018-10-17 17:55 ElliotNB - bug fixes for non-interactive sessions and `sudo su` commands | |
## Licensed under GPL | |
## | |
## This script will email the contact specified below whenever | |
## a user logs into the system from a new IP address. The email will contain the |
<? | |
// this script receives a Stripe dispute / chargeback and: | |
// | |
// - immediately refunds the payment | |
// - closes the user's account (in my DB, add your own code there) | |
// | |
// this is to automate dispute handling (because you never win a dispute on Stripe anyway) | |
// and by refunding avoiding the chargeback fee | |
// |
This should help you get Sendmail installed with basic configuration on Ubuntu.
sudo apt-get install sendmail
/etc/hosts
file: nano /etc/hosts
127.0.0.1 localhost yourhostname
sudo sendmailconfig
sudo service apache2 restart