Author: admin
Magento fix for “No Administrators role was found, data fixture needs to be run”
SQL queries
INSERT INTO authorization_role (role_id, parent_id, tree_level, sort_order, role_type, user_id, user_type, role_name) VALUES (1, 0, 1, 1, 'G', 0, '2', 'Administrators');
INSERT INTO authorization_rule (rule_id, role_id, resource_id, privileges, permission) VALUES (1, 1, 'Magento_Backend::all', null, 'allow');
Longer Orange 10 plugin for Chitubox v 2.2 (experimental)
I had to open that plugin via 7zip then put some QT dlls into it
Import this plugin via Help->Plugins
Here it is: https://files.fm/f/86b5xp6hz2
You can also extract and use as standalone via cmd.exe
Pirate PI Pulse metal detector oscillograms / Осциллограммы МД Пират
NE555 3 pin output
Mosfet Gate
Opamp input after diodes (no metal near coil)
Opamp input after diodes (there is metal near coil)
Magento 2 debug controller match
Useful if your custom controller is not firing
Places to check:
vendor/magento/framework/App/FrontController.php
while (!$request->isDispatched() && $routingCycleCounter++ < 100) {
/** @var \Magento\Framework\App\RouterInterface $router */
foreach ($this->_routerList as $router) {
try {
$actionInstance = $router->match($request);
if ($actionInstance) {
$result = $this->processRequest(
vendor/magento/framework/App/Router/Base.php
foreach ($modules as $moduleName) {
$currentModuleName = $moduleName;
$actionClassName = $this->actionList->get($moduleName, $this->pathPrefix, $actionPath, $action);
if (!$actionClassName || !is_subclass_of($actionClassName, $this->actionInterface)) {
continue;
}
$actionInstance = $this->actionFactory->create($actionClassName);
break;
}
Boss BR-1600 Free .VR8 converter in Python (with Windows binary)
USBAsp v 2.0 firmware for flashing AT89S51, AT89S52
main.hex firmware with an inversion of RESET pin:
https://drive.google.com/file/d/1QiRvCN29H0l-Kq0eJhdKs3WfHdrvEXrB/view?usp=sharing
source code:
https://drive.google.com/file/d/1-idzOalAeA77U9Ony_UZ1YfTT4d_M8j3/view?usp=sharing
avrdude.conf
https://drive.google.com/file/d/1bEraBArDpIUMMW7dt0KzH7qNNhkQd99W/view?usp=sharing
TARGET=atmega8
HFUSE=0xd9
LFUSE=0x9f
You can just flash the MCU without fuses
env for PlatformIO
[env:AT89S51]
platform = intel_mcs51
board = AT89S51
upload_protocol = custom
upload_command = sudo avrdude -c usbasp -p at89s51 -U flash:w:$SOURCE:i -C +./avrdude.conf
Magento 2 debug layout xml
/etc/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"></event>
<event name="layout_generate_blocks_after">
<observer name="layout_generate_blocks_after" instance="Module\Wishlist\Observer\Layout" />
</event>
</config>
Observer
<?php
/** * Create "Layout.php" at onlinecode/Dev/Model/Layout.php */
namespace Module\Wishlist\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
class Layout implements ObserverInterface
{
protected $set_logger;
public function __construct(\Psr\Log\LoggerInterface $logger_cons)
{
$this->set_logger = $logger_cons;
}
public function execute(\Magento\Framework\Event\Observer $observer)
{
$get_xml = $observer->getEvent()->getLayout()->getXmlString();
$this->set_logger->debug($get_xml);
$get_writer = new \Zend_Log_Writer_Stream(BP . '/var/log/layout_block.xml');
$get_logger = new \Zend_Log();
$get_logger->addWriter($get_writer);
$get_logger->info($get_xml);
return $this;
}
}
Magento 2 emulating (debugging) Thank you (success) page
File vendor/magento/module-checkout/Controller/Onepage/Success.php
Should look like:
public function execute()
{
$session = $this->getOnepage()->getCheckout();
$session
->setLastOrderId(OLD_ID)
->setLastRealOrderId('OLD INCREMENT ID')
->setLastOrderStatus('Pending');
Magento 2 log all Mysql queries to log file
Edit file vendor/magento/framework/DB/Statement/Pdo/Mysql.php
return $this->tryExecute(function () use ($params) {
$writer = new \Zend_Log_Writer_Stream(BP . '/var/log/debugSql.log');
$logger = new \Zend_Log();
$logger->addWriter($writer);
$logger->debug($this->_stmt->queryString);
$logger->debug(json_encode($params));
$logger->debug('================');
return $params !== null ? $this->_stmt->execute($params) : $this->_stmt->execute();
});