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 | |
# Author: Salvatore Guarino - [email protected] | |
# Instructions: | |
# | |
# 1. Manually rsync the local Magento 2 folder on the remote server. | |
# 2. Change the Mysql DB settings on app/etc/env.php on the remote server. | |
# 3. Copy the script on your local Magento 2 folder | |
# 4. Change variables according to your local and remote environment |
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
# on Raspberry Pi | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install ser2net | |
# check if /dev/ttyUSB0 exist | |
sudo echo "2000:raw:600:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT banner" >> /etc/ser2net.conf | |
sudo service ser2net 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
# Mirror of the instructions available here: | |
# http://www.lowefamily.com.au/2016/06/02/installing-ubiquiti-unifi-controller-5-on-raspberry-pi/ | |
# | |
# These commands CANNOT be run in a script. | |
# They're just for reference. | |
# Install on Raspbian Jessie, or upgrade from Wheezy. | |
# Make sure all packages are upgraded (update && upgrade). |
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-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
Enable-RemoteDesktop | |
cinst notepadplusplus | |
cinst 7zip | |
cinst adobereader | |
cinst skype | |
cinst pdfcreator | |
cinst firefox | |
cinst chrome |
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
//enable COD only for italy | |
function payment_gateway_disable_country( $available_gateways ) { | |
global $woocommerce; | |
if ( isset( $available_gateways['cod'] ) && $woocommerce->customer->get_country() <> 'IT' ) { | |
unset( $available_gateways['cod'] ); | |
} | |
//make COD the only available gateway for flat_rate shipping method (or other unused method) | |
//you can use the label cash on delivery for flat_rate and determining the shipping cost for COD | |
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); |
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
#with this query you can extract rows that contain in the field "textfield1" only uppercase words | |
SELECT * FROM t1 WHERE BINARY textfield1 = ucase(textfield1) |
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 | |
echo "Hello world"; | |
?> |