Skip to content

Instantly share code, notes, and snippets.

View light-bringer's full-sized avatar
:bowtie:
maomao

Debapriya Das light-bringer

:bowtie:
maomao
View GitHub Profile
#!/usr/bin/env python2
"""
Replace line breaks, from one format to another
@Author : Debapriya Das
@Python : 2.7
"""
from __future__ import print_function
@light-bringer
light-bringer / 0. create local branch
Created March 19, 2018 08:20 — forked from aemkei/0. create local branch
push existing local branch to remote
#syntax
git checkout -b name_of_local_branch
#example
git checkout -b experimental
@light-bringer
light-bringer / aes-cbc.py
Created October 28, 2018 14:13 — forked from lopes/aes-cbc.py
Simple Python example of AES in CBC mode.
from hashlib import md5
from base64 import b64decode
from base64 import b64encode
from Crypto import Random
from Crypto.Cipher import AES
# Padding for the input string --not
# related to encryption itself.
BLOCK_SIZE = 16 # Bytes
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Debapriya Das"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
Question1Max. Marks 100.00
The Ultimate FIFA Dream Team Selection Challenge
[Problem Statement]
For the new season of English Premier League, the football club owners are re-strategizing their teams to ensure that they win this season. They need crunch data to build their dream team and guarantee a win. You are required to help the coaches who are not very tech savvy make a quick and effective decision by retrieving the data that they require.
In order to help them, you are required to implement a backend system for FIFA. This system must implement the following:
Microservices architecture that extracts the provided data
import requests
def get_city(ipaddr):
url = "https://www.ipinfo.io/" + str(ipaddr)
response = requests.get(url=url).json()
return response['city']
lines = open('log.txt').readlines()
cities = {}
968c1d4e3784a9c5e7180cf7959edb708d8222192c633d0c707b117fa8fd962e77b4003f87b8459d9583cd4dd8deaf357cbb13b583e913a2eb8eca3a486399e0
@light-bringer
light-bringer / Instructions.txt
Last active December 10, 2019 11:18
Python 3 program to count number of words in txt or doc or docx files
Have a python3 setup ready!
Install docx from pip
~/Desktop/awesome-performance-test-framework master ✗ 6h8m ✖ ⚑ ◒
▶ pip install --pre python-docx
Collecting python-docx
Downloading https://files.pythonhosted.org/packages/e4/83/c66a1934ed5ed8ab1dbb9931f1779079f8bca0f6bbc5793c06c4b5e7d671/python-docx-0.8.10.tar.gz (5.5MB)
|████████████████████████████████| 5.5MB 9.2MB/s
Requirement already satisfied: lxml>=2.3.2 in ./venv/lib/python3.7/site-packages (from python-docx) (4.4.2)
def timeit(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
te = time.time()
if 'log_time' in kw:
name = kw.get('log_name', method.__name__.upper())
kw['log_time'][name] = int((te - ts) * 1000)
else:
print '%r %2.2f ms' % \
{
"data": {
"rdap": {
"nir": null,
"asn_registry": "arin",
"asn": "23148",
"asn_cidr": "204.51.76.0/22",
"asn_country_code": "US",
"asn_date": "2009-06-09",
"asn_description": "TERRENAP, US",