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 / 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 / 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
--
@hiepnt93
hiepnt93 / git-clearHistory
Created October 16, 2018 09:08 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@hiepnt93
hiepnt93 / README.md
Created September 10, 2018 04:13 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@hiepnt93
hiepnt93 / README.md
Created August 10, 2018 06:10 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@hiepnt93
hiepnt93 / mysql-docker.sh
Created June 17, 2017 02:57 — forked from spalladino/mysql-docker.sh
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
@hiepnt93
hiepnt93 / DoEC-parallel.curl
Created April 20, 2017 16:33 — forked from xcommerce-gists/DoEC-parallel.curl
How to Make Parallel Payments Using Express Checkout.curl
curl -s --insecure https://api-3t.sandbox.paypal.com/nvp -d
"USER=<Caller_ID>
&PWD=<Caller_Pswd>
&SIGNATURE=<Caller_Sig>
&METHOD=DoExpressCheckoutPayment
&VERSION=93
&TOKEN=<Token> # TOKEN value returned from SetExpressCheckout
&PAYERID=<PayerID> # PAYERID value returned from GetExpressCheckoutDetails
&PAYMENTREQUEST_0_AMT=250 # first payment details
&PAYMENTREQUEST_0_CURRENCYCODE=USD