Skip to content

Instantly share code, notes, and snippets.

View shafinmahmud's full-sized avatar

Shafin Mahmud shafinmahmud

  • Dhaka, Bangladesh
View GitHub Profile
@shafinmahmud
shafinmahmud / JsonFlattener.java
Created November 27, 2019 08:41
Flatten json string to key value map with proper built path
public class JsonFlattener {
private final String jsonString;
public JsonFlattener(String json) {
this.jsonString = json;
}
public Map<String, String> flattenToMap() throws IOException {
Map<String, String> valueMap = new HashMap<>();
# First thing First! Update! Upgrade!
sudo apt-get update && sudo apt-get -y upgrade
# Fixing Time problem by keeping RTC in local time (for dual boot with windows 10)
sudo timedatectl set-local-rtc 1 --adjust-system-clock
# Install vim
sudo apt-get install -y vim
# Download Chrome and install it.
@shafinmahmud
shafinmahmud / default.conf
Created September 17, 2018 07:29
Minimal directive for Nginx static file sharing
# Add following location directive to the default server block located in
# /etc/nginx/conf.d/default.conf (if you installed from official NGINX repository) or,
# /etc/nginx/sites-enabled/default (if you installed from Debian or Ubuntu repositories)
# This location directive serve static content from the root
location /shared {
root /root/directory/of/files/;
autoindex on;
}
@shafinmahmud
shafinmahmud / java_topic_list
Last active December 11, 2020 05:43
Useful Topics on Java
#1 201 Core Java Interview Questions (** this 200 will cover the maximum topics)
https://www.javatpoint.com/corejava-interview-questions
#2 String
a. String in basic
- https://www.javatpoint.com/java-string
b. String vs StringBuilder vs StringBuffer
- https://www.geeksforgeeks.org/g-fact-27-string-vs-stringbuilder-vs-stringbuffer/
- http://javarevisited.blogspot.com/2011/07/string-vs-stringbuffer-vs-stringbuilder.html
- https://www.journaldev.com/538/string-vs-stringbuffer-vs-stringbuilder
@shafinmahmud
shafinmahmud / default
Created February 7, 2018 15:28
Nginx default server config enabled with PhpMyAdmin
# you should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
@shafinmahmud
shafinmahmud / mutiple_ssh_config.txt
Last active January 3, 2018 15:21
Configuring Multiple SSH keys for Multiple github accounts
$ ssh-keygen -t rsa -C "<work-email>"
~/.ssh/id_rsa
~/.ssh/id_rsa_<work-id>
$ ssh-add -D
$ ssh-add ~/.ssh/id_rsa
$ ssh-add ~/.ssh/id_rsa_<work-id>
$ ssh-add -l
@shafinmahmud
shafinmahmud / build.gradle
Last active November 20, 2017 04:57
Sample Java Web application build script with Gradle
apply plugin: 'java'
apply plugin: 'war'
group = 'sample.web'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
-- To see what timezone your MySQL session is using, just execute this:
SELECT @@global.time_zone, @@session.time_zone;
-- If you feel to Change on your specific TimeZone, execute:
SET GLOBAL time_zone = '+6:00';
SET SESSION time_zone = '+6:00';
sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_secure_installation
@shafinmahmud
shafinmahmud / logging.properties
Created August 7, 2017 18:46
tomcat cnf/logging.properties
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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