This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author : Mahabub Elahi | |
// Email : [email protected] | |
// 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################## | |
## 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |