Skip to content

Instantly share code, notes, and snippets.

@Hotfirenet
Hotfirenet / grocy.conf
Last active Aug 20, 2020
Installation de grocy sur une debian Buster clean
View grocy.conf
<VirtualHost *:80>
DocumentRoot /var/www/grocy/public
ErrorLog ${APACHE_LOG_DIR}/error-grocy.log
CustomLog ${APACHE_LOG_DIR}/access-grocy.log combined
<Directory "/var/www/grocy">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@Hotfirenet
Hotfirenet / OrderInvoice.php
Created Mar 23, 2020
Article HFN - Classer par marque et référence les produits dans le BL et la facture Prestashop - https://hotfirenet.com/blog/2689-classer-par-marque-et-reference-les-produits-dans-le-bl-et-la-facture-prestasop/
View OrderInvoice.php
<?php
class OrderInvoice extends OrderInvoiceCore {
public function getProductsDetail() {
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT od.*, p.*, ps.*
FROM `'._DB_PREFIX_.'order_detail` od
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = od.product_id
LEFT JOIN `'._DB_PREFIX_.'product_shop` ps ON (ps.id_product = p.id_product AND ps.id_shop = od.id_shop)
LEFT JOIN `ps_manufacturer` m ON m.`id_manufacturer`= p.`id_manufacturer`
WHERE od.`id_order` = '.(int)$this->id_order.'
AND od.`id_order_invoice` = '.(int)$this->id .'
View installNvmCommandLine.sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
View resultUpdateRFLINKCommand.txt
vrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/djo/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/cu.usbmodem1411
Using Programmer : wiring
View updateRFLINKCommand.sh
sudo /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega2560 -cwiring -P/dev/cu.usbmodem1411 -b115200 -D -Uflash:w:/Users/djo/Downloads/RFLink_v1.1_r48/RFLink.cpp.hex
View resetJeedomMPD.php
<?php
require_once dirname(__FILE__) . 'core/php/core.inc.php';
$user = user::byLogin('MonLogin');
$user->setPassword(sha1('monMDP'));
$user->save();
@Hotfirenet
Hotfirenet / remove_all_product_category_in_cart_rule.sql
Created Jul 25, 2019
Permet de supprimer tous les produits d'une règle panier contenu dans une categorie sur prestashop.
View remove_all_product_category_in_cart_rule.sql
DELETE FROM ps_cart_rule_product_rule_value WHERE id_item IN (SELECT id_product FROM ps_category_product WHERE id_category = 53) AND id_product_rule = 1076
@Hotfirenet
Hotfirenet / wpa_supplicant.conf
Created Jul 22, 2019
Fichier de conf pour le rpi à placer dans la partition boot
View wpa_supplicant.conf
country=FR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="SSID_LAN"
psk="PASSWORD"
key_mgmt=WPA-PSK
}
@Hotfirenet
Hotfirenet / dev_prestashop_docker.sh
Last active Apr 25, 2019
Permet de monter un prestashop sous docker
View dev_prestashop_docker.sh
# create a network for containers to communicate
docker network create prestashop-net
# launch latest mysql container
docker run -ti --name prestashop-mysql --network prestashop-net -e MYSQL_ROOT_PASSWORD=admin -p 3306:3306 -d mysql:latest
# launch prestashop container
sudo docker run -ti --name my-prestashop --network prestashop-net -e DB_SERVER=prestashop-mysql -e PS_DOMAIN=maboutique.local -e PS_SHOP_URL=maboutique.local --volume /var/www/html/prestashop:/var/www/html -p 80:80 -d prestashop/prestashop:1.6
# Run mailcatcher
sudo docker run -d --name prestashop-mailcatcher --network prestashop-net -p 1080:1080 schickling/mailcatcher
@Hotfirenet
Hotfirenet / slack.sh
Created Nov 16, 2018 — forked from andkirby/slack.sh
Shell/Bash script for sending slack messages.
View slack.sh
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user