Skip to content

Instantly share code, notes, and snippets.

1, Magento 2 admin this webpage has a redirect loop
SELECT * FROM `core_config_data` WHERE `path` LIKE '%web/cookie/cookie_domain%'
Change value to domain
import java.util.Arrays;
public class Sorting {
public int[] countingSortOld(int arrs[], int k) {
int C[] = new int[k];
for (int i = 0; i < arrs.length; i++) {
C[arrs[i]]++;
@iamdylanngo
iamdylanngo / Install magento 2 with command line
Last active November 25, 2019 02:19
Install magento 2 with command line
# Install magento 2 with command line
php bin/magento setup:install \
--backend-frontname=admin \
--db-host=localhost \
--db-name=magento \
--db-user=magento \
--db-password=magento \
--base-url=http://magento2.docker/ \
--admin-firstname=Admin \
@iamdylanngo
iamdylanngo / Install and configuration sendmail in ubuntu
Last active November 22, 2019 09:41
Install and configuration sendmail in ubuntu
# Install sendmail
sudo apt install sendmail
sudo service sendmail restart
sudo service php7.2-fpm restart
# Send email by command
echo "test message" | sendmail -v [email protected]
@iamdylanngo
iamdylanngo / Install OpenSSH Server
Created November 26, 2019 01:29
Install OpenSSH Server in ubuntu
# In server
sudo apt install openssh-server
sudo vim /etc/ssh/sshd_config
- Edit sshd_config change to
PasswordAuthentication no
sudo service ssh restart
@iamdylanngo
iamdylanngo / Install code sniffer in ubuntu, phpstorm
Created November 27, 2019 01:15
Install code sniffer in ubuntu, phpstorm
# Config custom rules
vendor/bin/phpcs --config-set installed_paths vendor/magento/magento-coding-standard/Magento2/
@iamdylanngo
iamdylanngo / Install Ant in ubuntu
Created November 29, 2019 06:40
Install Ant in ubuntu
1, Make sure local workstation install JDK >= 1.8
2, Dowload Ant:
wget https://www-eu.apache.org/dist//ant/binaries/apache-ant-${VER}-bin.tar.gz
3, sudo tar -xvf apache-ant-${VER}-bin.tar.gz -C /usr/local
4,
sudo ln -s /usr/local/apache-ant-${VER}/ /usr/local/ant
sudo vim /etc/profile.d/ant.sh
export ANT_HOME=/usr/local/ant
export PATH=${PATH}:${ANT_HOME}/bin
source /etc/profile.d/ant.sh
@iamdylanngo
iamdylanngo / Jenkins file 1
Created November 29, 2019 07:59
Jenkins file 1
pipeline {
agent any
stages {
stage('Prepare') {
steps {
sh 'composer install'
sh 'rm -rf build/api'
sh 'rm -rf build/coverage'
sh 'rm -rf build/logs'
@iamdylanngo
iamdylanngo / Export Java Home
Created November 29, 2019 09:30
Export Java Home
export JAVA_HOME=/opt/java/openjdk
export PATH=$PATH:$JAVA_HOME/bin
@iamdylanngo
iamdylanngo / docker-compose
Created December 3, 2019 10:31
docker-compose
sudo docker volume create -d local-persist -o mountpoint=/var/www/rav-rp --name=mag-rav-stg