Skip to content

Instantly share code, notes, and snippets.

View anis016's full-sized avatar

Sayed Anisul Hoque anis016

View GitHub Profile
@anis016
anis016 / getLinesDifferenceBetweenTwoFiles.py
Last active May 29, 2022 21:06
File comparisons that contains words or sentence
#!/usr/bin/env python2.7
# python getLinesDifferenceBetweenTwoFiles.py --path1=line1.txt --path2=line2.txt
import sys
import os
import argparse
def read_lines_and_compare_files(first_file, second_file):
if not os.path.exists(first_file) or not os.path.exists(second_file):
This gist contains all the easy hacks
@anis016
anis016 / to_buy
Last active November 21, 2019 09:22
Fojat:
https://www.amazon.de/dp/B0725P9D3Q/ref=sr_1_4?crid=173HI3G5ZY877&keywords=kopfh%C3%B6rer+noise-cancelling&qid=1574277000&refinements=p_76%3A419122031%2Cp_72%3A419117031&rnid=669059031&rps=1&s=ce-de&sprefix=Headphones+noise+%2Celectronics%2C149&sr=1-4
https://www.amazon.de/Neutrogena-Norwegische-Moisture-Bodylotion-Sensitive/dp/B01LTHLR68/ref=pd_rhf_se_s_sspa_dk_rhf_search_pt_sub_0_12?_encoding=UTF8&pd_rd_i=B01LTHLR68&pd_rd_r=a741c108-06a0-48be-b95d-e19fbc7681e8&pd_rd_w=3IlqC&pd_rd_wg=SekPi&pf_rd_p=b137599d-7c94-490a-baee-bfa71341f05f&pf_rd_r=KD24DS0QVZRAQHV76TGW&refRID=KD24DS0QVZRAQHV76TGW&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExMEFKVFhSVFhUT0wmZW5jcnlwdGVkSWQ9QTA2MzkxNTEySTlRNUpPMVRXUkU3JmVuY3J5cHRlZEFkSWQ9QTA1MjQwNTAyTTBITk9RU1hLMk04JndpZGdldE5hbWU9c3BfcmhmX3NlYXJjaCZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU&th=1&fbclid=IwAR19EElvObc70v1XAAwKxdwfOhoPpecFCMIhFspldWt5ZX-HIyVdPeNY7dg
https://www.amazon.de/gp/product/B000V3ME00/ref=ox_sc_act_title_2?smid=A3JWKAKR8XB7XF&psc=1
https://www.amazon.de/Pr
@anis016
anis016 / !bash scripts
Last active October 6, 2021 10:13
Useful bash script
This gist contains useful bash scripts
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import random
flatten = lambda l: [item for sublist in l for item in sublist]
random.seed(1024)
USE_CUDA = torch.cuda.is_available()
gpus = [0]
@anis016
anis016 / java joda time operations
Created June 11, 2018 11:32
1) getting earlier date from current date, 2) converting a yyyyMMdd to yyyMM format, 3) date comparision
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
DateTimeFormatter formatter = DateTimeFormat.forPattern( "yyyyMM");
tutorial:
1. https://medium.com/@vivek.yadav/deep-learning-setup-for-ubuntu-16-04-tensorflow-1-2-keras-opencv3-python3-cuda8-and-cudnn5-1-324438dd46f0
2. https://towardsdatascience.com/build-and-setup-your-own-deep-learning-server-from-scratch-e771dacaa252 [for opencv only]
** installing tensorflow-gpu follow above tutorial
** installing pytorch-gpu
# install torch (cuda 9)
$ conda install pytorch torchvision cuda90 -c pytorch
# test gpu install
python -c 'import torch; print(torch.rand(2,3).cuda())'
3bA62813
https://de.pcpartpicker.com/list/37fp8Y
### caseking (Bought)
9. 750W 80+ Gold Certified Fully-Modular ATX Power Supply - 99.90
https://www.caseking.de/en/bitfenix-fury-80-plus-gold-netzteil-semi-modular-750-watt-nebf-003.html
7. Gigabyte - GeForce GTX 1080 8GB WINDFORCE OC 8G Video Card - 609
@anis016
anis016 / add_pycharm_launcer
Last active March 8, 2020 19:21 — forked from rob-murray/add_intellij_launcer
Add pycharm launcher shortcut and icon for ubuntu
// create file:
$ sudo touch /usr/share/applications/pycharm.desktop
$ sudo vim /usr/share/applications/pycharm.desktop
[Desktop Entry]
Version=1.0
Name=PyCharm
GenericName=IDE
Exec="/home/ghost016/IDE/pycharm-community-2019.3.3/bin/pycharm.sh" %f
# building rl4j for the latest snapshot (mvnrepository still doesn't have the latest build)
# build pipeline >> javacpp -> libnd4j -> nd4j -> DataVec -> deeplearning4j -> rl4j
# https://github.com/deeplearning4j/rl4j/issues/73#issuecomment-335732797
0. note about maven version. it must be latest (running 3.5.0)
1. install cmake
1.1 wget https://cmake.org/files/v3.11/cmake-3.11.0-rc2-Linux-x86_64.sh
1.2 chmod a+x cmake-3.6.2-Linux-x86_64.sh
1.3 mkdir /opt/cmake
1.4 sudo sh cmake-3.11.0-rc2-Linux-x86_64.sh --prefix=/opt/cmake --skip-license