Skip to content

Instantly share code, notes, and snippets.

View faiyazalam's full-sized avatar
💭
Coding...

Faiyaz Alam faiyazalam

💭
Coding...
View GitHub Profile
@faiyazalam
faiyazalam / sample.php
Created December 8, 2023 11:52
sample script to download excel file in pimcore
<?php
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$page = 1;
$limit = 100;
$sql = "TODO";
@faiyazalam
faiyazalam / readme.txt
Last active November 18, 2023 11:22
Docker Hosts Update Script Using Container Names
Docker Hosts Update Script
This shell script updates the `/etc/hosts` file on a Docker host machine by mapping container IP addresses to specified hostnames or container names.
Author:
https://github.com/faiyazalam
Parameters:
--containers: Comma-separated list of Docker container names.
--urls: Comma-separated list of corresponding hostnames. If not provided, defaults to container names.
@faiyazalam
faiyazalam / update_hosts_for_docker_containers.sh
Last active November 18, 2023 11:20
Bash Script to Update /etc/hosts for Docker Containers
#!/bin/bash
#Example Usage: bash update_hosts_for_docker_containers.sh --containers="my_container_id_1,my_container_id_2" --urls="example1.com,example2.com"
#Author: https://github.com/faiyazalam
containers=""
urls=""
# Parse arguments
@faiyazalam
faiyazalam / Dockerfile
Last active March 25, 2023 03:39
Sample docker file to create pimcore 10 instance with php ZMQ extension
FROM pimcore/pimcore:PHP8.1-fpm
RUN apt-get update
RUN apt-get install -y build-essential libtool autoconf uuid-dev pkg-config libsodium-dev libzmq3-dev
RUN git clone https://github.com/zeromq/php-zmq.git
RUN cd php-zmq && phpize && ./configure
RUN cd php-zmq && make && make install
RUN docker-php-ext-enable zmq
RUN cd /var/www/html/ && rm -rf php-zmq/
@faiyazalam
faiyazalam / script.sh
Last active March 25, 2023 03:07
script to install zeromq php extension - Tested with Pimcore 10 and Official Docker Compose
apt-get update
apt-get install -y build-essential libtool autoconf uuid-dev pkg-config libsodium-dev libzmq3-dev
git clone https://github.com/zeromq/php-zmq.git
cd php-zmq
phpize && ./configure
make && make install
docker-php-ext-enable zmq
#now restart php-fpm container
#container info:
#No LSB modules are available.
@faiyazalam
faiyazalam / access environment variable in web encore - pimcore symfony.txt
Created January 27, 2023 14:50
access environment variable in web encore - pimcore symfony
//inside webpack config file
var Encore = require('@symfony/webpack-encore');
var dotenv = require('dotenv');
Encore
// ...
// define the environment variables
.configureDefinePlugin(options => {
const env = dotenv.config();
@faiyazalam
faiyazalam / pimcore10-docker-compose.yml
Created August 31, 2022 05:43
Pimcore 10.x Docker compose file
services:
redis:
image: redis:alpine
command: [ redis-server, --maxmemory 128mb, --maxmemory-policy volatile-lru, --save "" ]
db:
image: mariadb:10.7
working_dir: /application
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb-file-per-table=1]
volumes:
@faiyazalam
faiyazalam / pimcore-migration-command.txt
Last active October 5, 2021 17:06
Pimcore Migration Command
bin/console pimcore:migrations:migrate -s pimcore_core -n
Run this command after composer update.
@faiyazalam
faiyazalam / cpanel-cron-job.txt
Last active May 14, 2020 06:55
How to create a Cron job in cPanel - Symfony Pimcore ?
Here is a sample command:
/usr/local/bin/ea-php72 /home/atunp/public_html/bin/console app:test
@faiyazalam
faiyazalam / How-to-run-composer-with-a-specifig-PHP-version-on-cPanel.txt
Created January 26, 2020 08:15
How to run composer with a specifig PHP version on cPanel?
syntax:
COMPOSER_MEMORY_LIMIT=-1 php-path composer-path update
example:
1) COMPOSER_MEMORY_LIMIT=-1 ea-php72 /opt/cpanel/composer/bin/composer update
2) COMPOSER_MEMORY_LIMIT=-1 /opt/cpanel/ea-php72/root/usr/bin/php /opt/cpanel/composer/bin/composer update