Skip to content

Instantly share code, notes, and snippets.

@peterblazejewicz
peterblazejewicz / README.md
Last active May 16, 2024 11:56
How to enable logging in Dante server

Modify Dante configuration file to enable logging, here for errors and debug:

errorlog: /var/log/sockd.errlog
logoutput: /var/log/sockd.log

In case you are receiving errors after configuring log sinks for danted service, like:

alert: configparsing(): could not (re)open logfile "/var/log/socks.log": Read-only file system
Step 1:
File to changed should be added to the git
git add -f vendor/dotmailer/dotmailer-magento2-extension/Api/Data/CouponAttributeInterface.php
Step 2:
Then make the changes to the core file
Step 3:
After making the changes run
git diff vendor/dotmailer/dotmailer-magento2-extension/Api/Data/CouponAttributeInterface.php > m2-hotfixes/webapi-fix.patch
@satishgumudavelli
satishgumudavelli / Test.php
Last active December 23, 2021 08:45
magento 2 add video to product programmatically
<?php
namespace Yourcompany\Yourmodule\Controller\Test;
use Magento\Framework\Api\Data\VideoContentInterface;
use Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface;
use Magento\Framework\App\Action\Context;
use Magento\ProductVideo\Model\Product\Attribute\Media\ExternalVideoEntryConverter;
use Magento\Store\Model\Store;
use Magento\Framework\Exception\InputException;
use Magento\Framework\Exception\StateException;
@Nachtalb
Nachtalb / telegram-desktop-multiple-accounts.rst
Last active June 25, 2024 04:10
Add multiple accounts in Telegram Desktop [Linux | MacOSX | Windows]
@leek
leek / _Magento2_DeleteTestData.md
Last active July 25, 2024 12:46
Magento 2 - Delete All Test Data

These set of scripts are for Magento 2. For Magento 1, see this Gist.

@mikemunsie
mikemunsie / phoneMasks.json
Last active July 9, 2024 16:55
Phone Masks by Country Code JSON
{
"AC": "+247-####",
"AD": "+376-###-###",
"AE": "+971-5#-###-####",
"AE": "+971-#-###-####",
"AF": "+93-##-###-####",
"AG": "+1(268)###-####",
"AI": "+1(264)###-####",
"AL": "+355(###)###-###",
"AM": "+374-##-###-###",
@erikhansen
erikhansen / 1_product_queries.sql
Last active May 30, 2024 09:01
Magento 2 - Remove duplicate store view-specific product and category data
/*
* IMPORTANT: The queries below are written for Magento Enterprise. If you're going to run them on Magento Community, you need
* to replace all instances of ".row_id" with ".entity_id". See this for context: http://magento.stackexchange.com/questions/139740/magento-2-schema-changes-for-ee-catalog-staging
*
* When importing products in Magento 2, if you specify store view codes in the store_view_code column, product data will be set at
* both the global scope as well as the specific store view scope. This is not ideal because now you have duplicate
* data at two different scopes that shouldn't actually be duplicated. The scripts below clean up this data by finding
* data set at specific store view scopes and if it's an exact match to the data set at the global store view, then it
* deletes the data set at the specific store view scope.
*
@andrewlimaza
andrewlimaza / honeypot-example.php
Last active July 17, 2024 07:03
Simple honeypot for an HTML form using PHP
<?php
//check if form was sent
if($_POST){
$to = 'some@email.com';
$subject = 'Testing HoneyPot';
$header = "From: $name <$name>";
$name = $_POST['name'];
@yvoronoy
yvoronoy / CODE_AND_DB_DUMP.MD
Last active April 26, 2023 08:35 — forked from tshabatyn/CODE_AND_DB_DUMP.MD
How to Generate Magento2 Code and DB dumps

Code dump

You can use tiny script m2dump it is doing the same thing as described below.

Estimate size of directories and exclude no needed.

du -sh ./* | sort -h
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE