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 / readme.md
Created November 21, 2019 16:33
bitnami container permission issues
  • Create the directory first mkdir -p ~/.backup/rabbitmq/lumen6
  • provide permission to that directory sudo chown -R 1001:1001 ~/.backup/rabbitmq/lumen6
  • sudo chown anik:anik ~/.backup/rabbitmq/lumen6
  • Run docker-compose up -d --build
@ssi-anik
ssi-anik / macchange.md
Created December 27, 2019 13:32
Change mac address on ubuntu

change mac address

  • sudo service network-manager stop
  • sudo ifconfig wlp2s0 down
  • sudo macchanger -r wlp2s0
  • sudo ifconfig wlp2s0 up
  • sudo service network-manager restart

restore mac address

  • sudo service network-manager stop
  • sudo ifconfig wlp2s0 down
@ssi-anik
ssi-anik / server.py
Created January 27, 2020 17:42
Simple Python HTTP Server
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
# Cloned & Updated from: https://gist.github.com/1kastner/e083f9e813c0464e6a2ec8910553e632
import json
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
allow = False
function parser(url) {
return url.replace(/^\/(.*)$/g, '$1');
}
HOST = 'http://127.0.0.1:8080/';
function get(url = '/get') {
fetch(HOST + parser(url), {
method: 'GET',
}).then((data) => data.json()).then((data) => console.log(data));
@ssi-anik
ssi-anik / 100_base.conf
Created March 14, 2020 05:09 — forked from danackerson/100_base.conf
using nginx + lua + redis for redirects and rewrites
# using such a setup requires `apt-get install lua-nginx-redis` under Ubuntu Trusty
# more info @ http://wiki.nginx.org/HttpLuaModule#access_by_lua
http {
lua_package_path "/etc/nginx/include.d/?.lua;;";
lua_socket_pool_size 100;
lua_socket_connect_timeout 10ms;
lua_socket_read_timeout 10ms;
server {
@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:
@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 / 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 / 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 / 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