Skip to content

Instantly share code, notes, and snippets.

View hiepnt93's full-sized avatar
Working from home

Hiep Nguyen hiepnt93

Working from home
  • Mars
View GitHub Profile
@hiepnt93
hiepnt93 / env.php
Created March 13, 2022 11:57
env.php
<?php
return [
'backend' => [
'frontName' => 'backend'
],
'queue' => [
'amqp' => [
'host' => 'rabbitmq',
'port' => '5672',
'user' => 'guest',
@hiepnt93
hiepnt93 / omise.sh
Created July 1, 2020 10:33
omise - shopstack
curl https://vault.omise.co/tokens \
-u "pkey_test_5k5v69dpcyw0ikc5103": \
-d "card[name]=Somchai Prasert" \
-d "card[number]=4242424242424242" \
-d "card[expiration_month]=10" \
-d "card[expiration_year]=2022" \
-d "card[city]=Bangkok" \
-d "card[postal_code]=10320" \
-d "card[security_code]=123"
bin/magento setup:install \
--backend-frontname=backend \
--amqp-host=rabbitmq \
--amqp-port=5672 \
--amqp-user=guest \
--amqp-password=guest \
--db-host=db \
--db-name=magento \
--db-user=magento \
--db-password=magento \
php bin/magento module:status | grep Magento_Inventory | grep -v List | grep -v None | grep -v -e '^$' | xargs php bin/magento module:disable
php bin/magento s:upgrade
php bin/magento s:s:deploy -f
php bin/magento c:flush
php bin/magento i:reindex
@hiepnt93
hiepnt93 / osx_install.sh
Created April 2, 2020 04:04 — forked from t-io/osx_install.sh
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@hiepnt93
hiepnt93 / Jenkinsfile
Created March 21, 2019 08:42 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@hiepnt93
hiepnt93 / index.sh
Last active December 15, 2018 02:23
index
# them cate
# assign product vao cate
php shell/indexer.php --reindex catalog_category_flat
# assign product vao cate
php shell/indexer.php --reindex catalog_category_product
#magmi
php shell/indexer.php --reindex catalog_product_attribute
@hiepnt93
hiepnt93 / warm.sh
Created November 22, 2018 09:51
warm
#!/bin/bash
# Nexcess.net Turpentine Extension for Magento
# Copyright (C) 2012 Nexcess.net L.L.C.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@hiepnt93
hiepnt93 / mage_update_attribute_via_upgrade_script.md
Created November 21, 2018 16:43 — forked from evgv/mage_update_attribute_via_upgrade_script.md
Magento. Update attribute via install/upgrade script.

Update attribute via install/upgrade script

In example below I upgraded is_visible_on_front and used_in_product_listing from false to true for two attributes namely flavor and unit_count. These attributes are product attributes and refer to Mage_Catalog_Model_Product::ENTITY or catalog_product. For update attribute params we are need the: entity id of attribute, id of attribute, field name what we wont to change, new field value and sort order. Function what we will use is updateAttribute from class Mage_Eav_Model_Entity_Setup.

Install/upgrade script in my case this is the mysql4-upgrade-1.1.4-1.1.5.php

    /* @var $installer Mage_Catalog_Model_Resource_Setup */
@hiepnt93
hiepnt93 / clean-magento_ce-db-extended.sql
Created November 9, 2018 06:27
Clean Magento database of junk and unnecessary data
--
-- Magento CE database clean-up extended
--
-- This is an extended clean-up which will clean search, import/export, reports, etc.
--
-- @author Constantin Bejenaru <boby@frozenminds.com>
-- @copyright Copyright (c) Constantin Bejenaru (http://frozenminds.com/)
-- @license http://www.opensource.org/licenses/mit-license.html MIT License
--