Skip to content

Instantly share code, notes, and snippets.

View bhuiyanmobasshir94's full-sized avatar
🎖️
Focused on achievement

Mobasshir Bhuiya bhuiyanmobasshir94

🎖️
Focused on achievement
View GitHub Profile
@bhuiyanmobasshir94
bhuiyanmobasshir94 / populate_feature.py
Created December 11, 2018 17:53
A sample django population script
import os
import pandas as pd
import numpy as np
import random
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'categorized_affect_map.settings')
django.setup()
from classification.models import Category, Feature
from django.utils import timezone
@bhuiyanmobasshir94
bhuiyanmobasshir94 / index.html
Created December 9, 2018 13:42
Folium heatmap demonstration of Bashundhara Area
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script>L_PREFER_CANVAS=false; L_NO_TOUCH=false; L_DISABLE_3D=false;</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
@bhuiyanmobasshir94
bhuiyanmobasshir94 / problem-4.txt
Last active December 11, 2018 17:50
Basic SQL Commands
BEGIN TRANSACTION;
CREATE TABLE Students (ID integer PRIMARY KEY, Name varchar(255));
CREATE TABLE Friends (ID integer PRIMARY KEY, Friend_ID integer);
CREATE TABLE Packages (ID integer PRIMARY KEY, Salary float(23,19));
INSERT INTO Students (ID,Name)
VALUES (1,'Ashley');
INSERT INTO Students (ID,Name)
VALUES (2,'Samantha');
@bhuiyanmobasshir94
bhuiyanmobasshir94 / problem-3.txt
Created December 9, 2018 13:32
Linux basic commands dist - Ubuntu 16.04
# Add User Non-interactively without password
1. sudo adduser --disabled-password --gecos "" username
# Grant root access to the user so s/he can execute sudo without a password.
1. sudo visudo
#After includedir /etc/sudoers.d put-.
2. username ALL=(ALL) NOPASSWD: ALL
# Create a folder named .ssh in the user’s home directory.
1. mkdir /home/username/.ssh
@bhuiyanmobasshir94
bhuiyanmobasshir94 / problem-2.py
Created December 9, 2018 13:30
Log file parsing and sorting demonstration
import re
log_list = []
hosts = set()
hosts_status = set()
test_str = ''
filepath = 'problem-2.txt'
with open(filepath) as fp:
test_str = fp.read().strip()
@bhuiyanmobasshir94
bhuiyanmobasshir94 / problem-1.py
Created December 9, 2018 13:26
Solutions to the problem of getting geo information against IP address
import requests
class Scraper:
''' Request information and Scrape data class '''
def __init__(self,ip=None):
self.address = 'http://ip-api.com/json/'
self.ip = ip
def get_geo_ip_info(self):
'''Collect geo ip info'''