Skip to content

Instantly share code, notes, and snippets.

View ssi-anik's full-sized avatar
💻
Open to remote work!

Syed Sirajul Islam Anik ssi-anik

💻
Open to remote work!
View GitHub Profile
@ssi-anik
ssi-anik / elastic_apm.ini
Created July 10, 2020 18:59
PHP Elastic APM ini file
extension=elastic_apm.so
elastic_apm.bootstrap_php_part_file=/home/apm-agent/apm/src/bootstrap_php_part.php
elastic_apm.enabled=true
elastic_apm.server_url="http://docker.for.mac.localhost:8200"
; elastic_apm.secret_token=
elastic_apm.service_name="PHP APM Test Service"
; service_version= ${git rev-parse HEAD}
elastic_apm.log_level=DEBUG
; Available Log levels
; OFF | CRITICAL | ERROR | WARNING | NOTICE | INFO | DEBUG | TRACE
@ssi-anik
ssi-anik / php.dockerfile
Created July 6, 2020 17:32
Elastic APM agent PHP installation in Docker container
FROM php:7.4-fpm
RUN apt-get update
RUN apt-get install -y libpq-dev libpng-dev curl nano unzip zip git jq supervisor
RUN docker-php-ext-install pdo_pgsql
RUN pecl install -o -f redis
@ssi-anik
ssi-anik / graphql-query-client-side.js
Created July 5, 2020 05:28 — forked from varunon9/graphql-query-client-side.js
Querying to graphql server from browser using JQuery Ajax
var globals = {}; // application wide global variable
globals.constants = {
}
globals.showToastMessage = function(heading, message, icon) {
$.toast({
heading: heading,
text: message,
showHideTransition: 'slide',
@ssi-anik
ssi-anik / Dockerfile
Created June 27, 2020 19:17
PHP dockerfile for rdkafka/kafka/libkafka
FROM php:7.4-fpm
RUN apt-get update
RUN apt-get install -y librdkafka-dev
RUN pecl install channel://pecl.php.net/rdkafka-beta
RUN rm -rf /tmp/pear
@ssi-anik
ssi-anik / docker-compose.yml
Created June 27, 2020 17:00
docker-compose.yml file for kafka-zookeeper
version: '2'
services:
zookeeper:
image: bitnami/zookeeper:3.6.1
ports:
- 2181:2181
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_ENABLE_AUTH=yes
@ssi-anik
ssi-anik / kafka
Created June 14, 2020 21:19 — forked from sonhmai/kafka
kafka basic commands
# BENCHMARK-----------------------------------------------------
#1. Rust kafka-benchmark (https://github.com/fede1024/kafka-benchmark)
# must create topic with 6 partitions first
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 6--topic [scenario]
# replace scenario with one in file kafka-benchmark/config/base_producer.yaml
@ssi-anik
ssi-anik / scripts.php
Created May 29, 2020 14:41
PHP object Lifecycle.
<?php
echo 'script 1 start' . PHP_EOL;
class A12
{
public $script = null;
public function __construct ($script = 's1') {
$this->script = $script;
}
@ssi-anik
ssi-anik / gist:b4e770ba71225c1226ebdaff5df10c2b
Created May 21, 2020 15:22 — forked from wumpz/gist:5846559
list authors of a git repository including commit count and email
git shortlog -e -s -n
@ssi-anik
ssi-anik / 2017_05_19_120000_add_user_api_token_field.php
Created March 27, 2020 09:45
[Laravel] - simple API token authentication
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddUserApiTokenField extends Migration
{
/**
* Run the migrations.
@ssi-anik
ssi-anik / authorize.lua
Created March 26, 2020 17:48 — forked from philwinder/authorize.lua
IVZ: Nginx config for using Lua as the authentication module. You must install nginx with lua support. See "openresty" for linux distros or the vagrant bootstrap shell script.
--[[
Provides custom authorization for nginx.
See the `nginx_authorize_by_lua.conf` for the Nginx config. This lua file is referenced in the config
See testWebserverAccess.sh for unit tests.
To Run nginx (make sure you have the lua, config and htpasswd file):
$ /usr/local/openresty/nginx/sbin/nginx -c /etc/nginx/conf/nginx_authorize_by_lua.conf
Logs are available at: /usr/local/openresty/nginx/logs/lua.log
To write to the log: