Skip to content

Instantly share code, notes, and snippets.

View asraful's full-sized avatar

Asraful Forhad Chowdhury asraful

  • Independent Contractor
  • Tampere,Finalnd
  • X @AsrafulC
View GitHub Profile
@asraful
asraful / SUID.java
Last active August 29, 2015 14:26 — forked from formix/SUID.java
64 bits Sufficiently Unique Id Generator
/****************************************************************************
* Copyright 2009-2015 Jean-Philippe Gravel, P. Eng. CSDP
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@asraful
asraful / springer-free-maths-books.md
Created December 29, 2015 14:07 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
def logIN():
from zabbix_client import ZabbixServerProxy
request = ZabbixServerProxy('http://192.168.70.172/zabbix')
request.user.login(user='admin', password='zabbix')
data = request.host.get(output=['hostid', 'host'])
request.user.logout()
@asraful
asraful / build.gradle
Created April 11, 2017 05:26
Naive way to deploy application to remote server using gradle task named : deploy_dev
remotes {
web01 {
role 'webServers'
host = 'host.example.com'
user = 'userA'
knownHosts = allowAnyHosts
identity = file('id_rsa') //id_rsa generated file for authentication
}
}
@asraful
asraful / zookeeper.sh
Last active December 24, 2017 10:58
zookeeper as service
#!/bin/bash
#/etc/init.d/zookeeper
DAEMON_PATH=/opt/kafka/bin
DAEMON_NAME=zookeeper
PATH=$PATH:$DAMENON_PATH
case "$1" in
#!/bin/bash
#/etc/init.d/kafka
DAEMON_PATH=/opt/kafka/bin
DAEMON_NAME=kafka
PATH=$PATH:$DAMENON_PATH
case "$1" in
@echo off
setlocal enableextensions enabledelayedexpansion
set tm=%time%
set hh=!tm:~0,2!
set mm=!tm:~3,2!
echo "trying to execute.."
if !hh! equ 15 (
if !mm! gtr 15 (
@asraful
asraful / ELK with Nginx.md
Created July 15, 2019 19:32 — forked from Dev-Dipesh/ELK with Nginx.md
Setting up Elasticsearch, Logstash and Kibana with Nginx.

ELK (Elasticsearch Logstash Kibana)

Though we're focused more on server setup procedure in this document, I will still give a very brief explanation in laymen terms for ELK. To those who are starting new in this stack, must have already heard of MVC (Model View Controller), so take it like this:

  • Model => Elasticsearch (for Storage, Indexing & Search)
  • View => Kibana (for DataViz & G-Man, yeah the one in half life 😏)
  • Controller => Logstash (For Logs & Filtering)

@asraful
asraful / redshift_connect.py
Created November 20, 2019 08:40 — forked from varver/redshift_connect.py
Python script to connect with Redshift on AWS with SCHEMA support.
############ REQUIREMENTS ####################
# sudo apt-get install python-pip
# sudo apt-get install libpq-dev
# sudo pip install psycopg2
# sudo pip install sqlalchemy
# sudo pip install sqlalchemy-redshift
##############################################
import sqlalchemy as sa
from sqlalchemy.orm import sessionmaker
@asraful
asraful / logback.xml
Created December 3, 2019 09:33 — forked from HaVonTe1/logback.xml
logback - print filename and line number
<configuration>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>myapp.log</file>
<encoder><pattern>%logger{35} - [%F:%L] - %msg%n</pattern></encoder>
</appender>
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE" />
<!-- add the following line -->
<includeCallerData>true</includeCallerData>