Skip to content

Instantly share code, notes, and snippets.

View jayachandraoggy's full-sized avatar
🏠
Working remotely

Jaya Chandra jayachandraoggy

🏠
Working remotely
View GitHub Profile
@jayachandraoggy
jayachandraoggy / ssmtp.conf
Last active July 31, 2020 13:05
smtp for debian systems. Installation: apt install ssmtp Path: /etc/ssmtp/ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=gmailemail
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587

Install

  • docker-compose -f docker-compose.yml -f docker-compose.dev.yml build
  • docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
  • docker-compose -f docker-compose.yml -f docker-compose.dev.yml restart app # After 20 secs
  • docker-compose -f docker-compose.yml -f docker-compose.dev.yml logs -f
  • docker-compose -f docker-compose.yml -f docker-compose.dev.yml logs -f <service-name>

Bash

  • docker-compose -f docker-compose.yml -f docker-compose.dev.yml exec app bash
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
@jayachandraoggy
jayachandraoggy / Development Environment setup using Magento Cloud Docker.md
Last active June 22, 2023 13:40
Essential steps for setting up development Environment using Docker for cloud projects

Development Environment setup using Magento Cloud Docker

Essential steps for beginning work on a cloud project in progress

Purpose

  • Setup a development environment for a Magento Cloud project using Docker (ECE Tools)
  • Appropriate for developers new to Magento Cloud and Docker

prerequisites

@jayachandraoggy
jayachandraoggy / Collection.php
Created June 1, 2023 12:49
to print mysql query for order reports in the magento admin panel
<?php
/**
* vendor/magento/module-sales/Model/ResourceModel/Report/Order/Collection.php
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Sales\Model\ResourceModel\Report\Order;
/**
* Report order collection
#!/bin/bash
# https://mirasvit.com/blog/common-issues-and-few-hacks-with-magento-2-full-page-cache.html
cd app/design/frontend/ && grep --recursive -l 'cacheable="false"' * && cd ../../..;
cd app/code && grep --recursive -l 'cacheable="false"' * && cd ../..;
cd vendor && grep --recursive -l 'cacheable="false"' * && cd ..;
#!/bin/bash
create_db="CREATE DATABASE $1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
create_user="GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost' IDENTIFIED BY '$1';"
flush="FLUSH PRIVILEGES;"
mysql -u root -p -e "${create_db}${create_user}${flush}"
mkdir $1.local
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition $1.local

govsphp

Simple demonstration to compare go and php language execution time by using for loop with one billion times loop.

CPU: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz


go program result 1.428860546s

with go compiler: go version go1.22.0 linux/amd64

@jayachandraoggy
jayachandraoggy / transmission-daemon-quickstart.md
Created June 26, 2024 17:50 — forked from eriknomitch/transmission-daemon-quickstart.md
Transmission Daemon (transmission-daemon) Quickstart

Transmission Daemon (transmission-daemon) Quickstart

This should work for Debian or Debian-deriviants (e.g., Ubuntu)

Quickstart

Install transmission-daemon

sudo apt-get install transmission-daemon
package main
import (
"context"
"fmt"
"net/url"
"os"
"github.com/hekmon/transmissionrpc/v3"
)