This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
adduser johan | |
usermod -G root,sudo,adm johan | |
echo "AllowUsers johan" >> /etc/ssh/sshd_config | |
service ssh restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#on sécurise a minima | |
wget https://gist.githubusercontent.com/Hotfirenet/cb2a64052b17c02afb54d60eae961104/raw/ca7fd30f086a4ad90ef885395b62951df6f8172c/secure.sh | |
chmod +x secure.sh | |
./secure.sh | |
#on ajoute un nouvel utilisateur | |
wget https://gist.githubusercontent.com/Hotfirenet/a58ff67ccc98bda81832bb9482209419/raw/835beef17f9a203f118f80a98e733aaf9fbfa75d/add_user.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
until [ "$response" = "yes" ] | |
do | |
read -p"test" -r response | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @idCustomer = 13377; | |
DELETE CP, P | |
FROM ps_cart_product CP | |
INNER JOIN ps_cart C ON C.id_cart = CP.id_cart | |
WHERE C.id_customer = @idCustomer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#Automation script By Hotfirenet for debian | |
#NEED ROOT, CURL | |
#Use curl -sSL https://gist.githubusercontent.com/Hotfirenet/ef367acf97227144fd880f30afdf447f/raw/89539ec5a91902d7591cd86f449c20d570fa79dc/docker_install.sh | bash | |
#install docker engine | |
#https://docs.docker.com/engine/installation/linux/debian/ | |
apt-get install -y --no-install-recommends \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#Automation script By Hotfirenet to install ufw (firewall) | |
#NEED ROOT | |
#Use curl -sSL https://gist.githubusercontent.com/Hotfirenet/acd59a8c31de631220afe42cb4025a19/raw/05698e1a230783a9894b2df330296f91e9240d67/ufw-firewall.sh | bash | |
#installation | |
apt-get update | |
apt-get -y install ufw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//By: Hotfirenet | |
//Description Shortcode: List post, cpt, published between 2 dates | |
//Use: [recap_article type="post,guide" datedebut="2016-01-31" datefin="2016-02-28" limit=5] | |
//For: domadoo blog | |
add_shortcode( 'recap_article', function( $atts ) { | |
extract( shortcode_atts( array( | |
'type' => 'post', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* \.(gif|png|jpe?g)$ { | |
expires 7d; | |
add_header Pragma public; | |
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
# prevent hotlink | |
valid_referers none blocked ~.google. ~.bing. ~.yahoo. server_names ~($host); | |
if ($invalid_referer) { | |
rewrite (.*) /static/images/hotlink-denied.jpg redirect; | |
# drop the 'redirect' flag for redirect without URL change (internal rewrite) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
iptables -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#trouver les fichiers linux, mac qui n'ont pas les caractères autorisé par Windows | |
find . -name '*[<>:/\\|?*]*' -o -name '*[ \.]' | |
#fonction de renommage en masse des fichiers linux, mac qui n'ont pas les caractères autorisé par Windows | |
#rename.sh | |
#!/usr/bin/env bash | |
find "$1" -depth -print0 | while IFS= read -r -d '' file; do | |
d="$( dirname "$file" )" | |
f="$( basename "$file" )" |