Skip to content

Instantly share code, notes, and snippets.

View shojibMahabub's full-sized avatar
🦊
! today

Mahabub Elahi shojibMahabub

🦊
! today
  • Veefin Public Limited
  • Dhaka, Bangladesh
  • 20:29 (UTC +06:00)
View GitHub Profile
@shojibMahabub
shojibMahabub / index.js
Created August 9, 2021 10:29
SDEQ321A-NodeJs-AWS-DesignDoc-MahabubElahi
// Author : Mahabub Elahi
// Email : shojibmahabub630@gmail.com
// Description : A function that will accept the list of folders and will return another list that contains the number of descendent folders each folder has.
// Run : node index.js
getSummary(Folder);
// @param Folder
// @return Array
function getSummary(Folder)
import json
import psycopg2
# I wrote all of DB queries in 'query.py' file
import query as q
# And load json file like this, I renamed the file [data.json]
jsonfile = open('data.json', 'r')
data = json.load(jsonfile)
@shojibMahabub
shojibMahabub / Dockerfile
Last active December 10, 2018 02:44
Dockerfile to serve static html file
########################################
## Dockerfile [ version 3 ]
########################################
## Build
## docker build -t mahabub .
## docker run -p 8080:90 mahabub
########################################
# 1. use ubuntu 16.04 as base image
FROM ubuntu:16.04
@shojibMahabub
shojibMahabub / logparser.py
Created December 7, 2018 20:51
Problem 2 : All requirements are met except requirement number 3.
"""
This programme is used to parse log files.
And sort them according to TOKENS. Also
show statistics about the log.
Author: Mahabub Elahi
Version: 1.0
"""
# read logs from log file
@shojibMahabub
shojibMahabub / salary.txt
Created December 5, 2018 18:07
database query for problem 4
Explanation:
--------------
In order to get the result,
I joined packages to get student's salaries. and joined friends
to get ID. For getting Friends salary I joined Packages once again.
Then I compared between salaries to find the students.
After that I ordered them by salary.
QUERY:
@shojibMahabub
shojibMahabub / linuxuser.txt
Last active December 5, 2018 17:48
Answers of 6 questions from problem set 3 about linux user and group permission.
1.
For adding a new user, in this case which
is 'mahabub', I will use 'adduser'.
Also I will put the 'gecos' option in order to
do the task non-interactively.
command: adduser --disabled-password --gecos "" mahabub
2.
In order to grant root permission to the user
@shojibMahabub
shojibMahabub / iplocator.py
Last active December 9, 2018 11:31
A piece of code that can locate a given IP using ip-api(http://ip-api.com). Run it using 'python iplocator.py' command.
"""
This programme is responsible for finding
geo-location of an IP address using ip-api(http://ip-api.com)
Author : Mahabub Elahi
Version : 2.0
"""
import ipaddress
from requests import get
import os
# def create_directory
# parameter_taken : directory name
# function :
# 1. make directory named var directory
def create_directory(directory):
if not os.path.exists(directory):
print('project created')
os.makedirs(directory)