Skip to content

Instantly share code, notes, and snippets.

@artttj
artttj / google_maps_tab_tampermonkey.js
Last active September 14, 2024 12:59
Restore Google Maps Tab in Google Search
// ==UserScript==
// @name Google Maps Tab
// @namespace http://tampermonkey.net/
// @version 2024-08-06
// @description Restores the seamless integration of Google Maps with Google Search
// @author Artyom Yagovdik <artyom.yagovdik(at)gmail.com>
// @match https://www.google.com/search*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant none
// ==/UserScript==
@artttj
artttj / MassDeleteElasticsuiteGhostIndices.php
Last active May 29, 2024 20:44
Script to Mass Delete Ghost Indices (Magento 2; smile/elasticsuite)
<?php
use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\State;
use Magento\Framework\ObjectManagerInterface;
require __DIR__ . '/app/bootstrap.php';
class Test
{
@artttj
artttj / openapi3.json
Created September 8, 2023 15:46
Shopware 6 OpenApi Spec
This file has been truncated, but you can view the full file.
@artttj
artttj / magento2_update_stock_qty_csv.php
Last active August 21, 2024 01:30
Magento 2 Update Stock Qty from CSV
<?php
/**
* Script to import/update stocks/inventory/qty in bulk via CSV
*
* @author Artyom Yagovdik <artyom.yagovdik(at)gmail.com>
* @website https://artttj.github.io/
*/
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
@artttj
artttj / check_d_space.sh
Last active October 31, 2017 07:41
check inodes disk space and mail
#!/bin/bash
MAILTO="y@b.biz,e@b.biz,a@b.biz,t@b.com"
USAGE=90 # inode usage - value in percent
dui=$(df -hi | sed -n '4p' |awk '{print $5}' | grep -v U|cut -d% -f1)
if [ $dui -gt $USAGE ]
then
echo "Inode usage on 52.52.52.135 is exceeded - $dui%" |mailx -s "Inode usage on $(hostname)" $MAILTO
fi
@artttj
artttj / fix.sh
Last active April 9, 2018 16:56
ENOSPC node ERROR avoiding / Laravel Yarn watch / Webpack Mix
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@artttj
artttj / create-updated-data-scripts-sp.php
Created December 5, 2016 05:37
Create Theme Data Upgrade SP
<?php
class Versions {
public function __construct() {
}
public static function create() {
return new self();
}
@artttj
artttj / magento_sql_duplciate_store.sql
Created November 8, 2016 09:08
Duplicate entry '1' for key 'PRIMARY' in data migration in Magento
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `core_store`;
CREATE TABLE `core_store` (
`store_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Store Id',
`code` varchar(32) DEFAULT NULL COMMENT 'Code',
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website Id',
`group_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Group Id',
`name` varchar(255) NOT NULL COMMENT 'Store Name',
`sort_order` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Sort Order',
@artttj
artttj / Python_Urllib_Basic_Auth_Query.py
Created September 22, 2016 17:34
Python 3.4 Urllib Basic Auth: the script sends JSON data via POST request using HTTP Basic authentication and urllib.
import urllib.request
import urllib.response
userName = "user"
passWord = "password"
top_level_url = "http://127.0.0.1/api/update"
# create an authorization handler
p = urllib.request.HTTPPasswordMgrWithDefaultRealm()
p.add_password(None, top_level_url, userName, passWord);
@artttj
artttj / magento.conf
Last active October 4, 2016 05:46
Magento NGINX Server Config
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/me/domains/example;
index index.html index.php;
server_name example.dev;
##
# redirect to www