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
#!/bin/sh | |
function hfnSSH(){ | |
clear | |
ssh $1@$2 | |
} | |
clear | |
echo "Parc HFN" |
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
SELECT A.id_order, | |
A.reference, | |
A.date_add, | |
CONCAT(B.company, ' ', B.lastname, ' ', B.firstname, ' ', B.address1, ' ', B.postcode, ' ', B.city) AS adresseInvoice, | |
CONCAT(C.company, ' ', C.lastname, ' ', C.firstname, ' ', C.address1, ' ', C.postcode, ' ', C.city) AS adresseDelivery, | |
E.name AS nomPaysFacturation, | |
G.name AS nomPaysLivraison | |
FROM ps_orders A |
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
SELECT SUM(B.product_quantity) AS product_quantity | |
,C.id_customer | |
,C.company | |
FROM ps_orders A | |
INNER JOIN ps_order_detail B ON B.id_order = A.id_order | |
INNER JOIN ps_customer C ON C.id_customer = A.id_customer | |
WHERE B.product_id = 2734 AND CAST(A.date_add AS DATE) >= '2015-09-01' | |
GROUP BY C.id_customer, C.company | |
ORDER BY 1 DESC |
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 group_concat_max_len = 18446744073709551615; | |
SET @COLUMNS = NULL; | |
SELECT GROUP_CONCAT( | |
DISTINCT CONCAT( | |
'GROUP_CONCAT(IF(C.id_group = "', | |
C.id_group , | |
'", "X", NULL)) AS "', | |
C.name, | |
'"' |
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 group_concat_max_len = 18446744073709551615; | |
SET @COLUMNS = NULL; | |
SELECT GROUP_CONCAT(DISTINCT | |
CONCAT( | |
'SUM(IF(D.id_product = "',D.id_product,'", B.product_quantity, 0)) AS "',D.reference,'"' | |
) | |
) INTO @COLUMNS | |
FROM ps_product D |
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 = 1208; | |
SELECT P.reference | |
,PL.name | |
,M.name AS 'Fabricant' | |
,P.quantity | |
# ,SP.price | |
,P.price AS 'prix public' | |
FROM ps_product P | |
INNER JOIN ps_product_lang PL ON PL.id_product = P.id_product |
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 group_concat_max_len = 18446744073709551615; | |
SET @COLUMNS = NULL; | |
SELECT GROUP_CONCAT( | |
CONCAT( | |
'GROUP_CONCAT(IF(' , SR1A.id_feature , ' = B.id_feature, D.value, NULL)) AS "', | |
SR1B.name , | |
'"' | |
) | |
) INTO @COLUMNS |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: firewall | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Démarre les règles iptables | |
# Description: Charge la configuration du pare-feu iptables |
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
#!/bin/sh | |
wget https://gist.githubusercontent.com/Hotfirenet/583939a027738cbed8b4e8f62390d94a/raw/e126b4d7f0adbf2a1027e3bc362c50020c498dfe/firewall.sh | |
mv firewall.sh /etc/init.d/firewall | |
chmod +x /etc/init.d/firewall | |
/etc/init.d/firewall | |
update-rc.d firewall defaults |
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
#!/bin/sh | |
apt-get update && apt-get upgrade -y && apt-get autoremove -y && apt-get autoclean -y | |
apt-get install sudo fail2ban rkhunter -y | |
sed -i 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config | |
service ssh restart |
OlderNewer