Navigation Menu

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 / gdrive_get_large_file.sh
Created September 26, 2021 03:47 — forked from hershkoy/gdrive_get_large_file.sh
Download large file from Google Drive (2020)
#!/bin/bash
if [ $# != 2 ]; then
echo "Usage: googledown.sh ID save_name"
exit 0
fi
confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id='$1 -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
echo $confirm
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$confirm&id=$1" -O $2 && rm -rf /tmp/cookies.txt
@ssi-anik
ssi-anik / .travis.yml
Last active January 19, 2022 09:36 — forked from willprice/.travis.yml
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@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 / 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 / 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:
@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 / createMongoDbLikeId.php
Created November 1, 2019 15:35 — forked from h4cc/createMongoDbLikeId.php
A PHP function to generate IDs like MongoDB uses with its ObjectIDs
<?php
/**
* Creating MongoDB like ObjectIDs.
* Using current timestamp, hostname, processId and a incremting id.
*
* @author Julius Beckmann
*/
function createMongoDbLikeId($timestamp, $hostname, $processId, $id)
{
@ssi-anik
ssi-anik / ConsumerCommand.php
Created September 14, 2019 06:35 — forked from srigi/ConsumerCommand.php
PHP rdkafka
<?php
declare(strict_types = 1);
namespace App\Kafka;
use RdKafka;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;