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 / 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 / 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 / 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 / check-ssl.php
Created January 9, 2025 14:52
check ssl for a given domain
<?php
function checkSsl($domain, $daysThreshold = 7)
{
$port = 443; // Default port for HTTPS
$timeout = 5; // Timeout for the connection
// Open a connection to the domain
$context = stream_context_create([
"ssl" => [