Skip to content

Instantly share code, notes, and snippets.

View Subangkar's full-sized avatar
☺️
Beauty in the Chaos

Subangkar Karmaker Shanto Subangkar

☺️
Beauty in the Chaos
View GitHub Profile
@Subangkar
Subangkar / anaconda-pip.sh
Last active June 30, 2023 07:07
Anaconda, Python & Pip shell commands
# anaconda
conda create -n myenv
conda create -n myenv python=3.9
conda activate myenv
conda deactivate
conda env list
conda info --envs
@Subangkar
Subangkar / rename_files_to_foldername.py
Created September 10, 2021 05:59
Rename every file to the name of its parent folder
#!/usr/bin/env python3
# import shutil
import os
import sys
import re
from shutil import copyfile
dr = str(sys.argv[1])
ext = str(sys.argv[2])
dest = str(sys.argv[3])
@Subangkar
Subangkar / download_drive.py
Last active September 10, 2021 05:57
Downloading Publicly shared files from Google Drive in Python
#taken from this StackOverflow answer: https://stackoverflow.com/a/39225039
import requests
def download_file_from_google_drive(id, destination):
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
token = get_confirm_token(response)
@Subangkar
Subangkar / sshfs-mount.md
Last active September 7, 2020 06:32
Mounting over ssh on windows

Mount remote linux server folder

  • sshfs-win
  • WinFsp
    Open Map Network drive from Win Explorer and add network path as
\\sshfs\user@host/../../path_from_root/
@Subangkar
Subangkar / docker-compose.sh
Last active September 17, 2020 07:07
Useful Docker Commands
docker-compose build
docker-compose up
docker-compose down
@Subangkar
Subangkar / Colab-Notebook.md
Last active December 24, 2021 05:01
Handy snippets/codes for Google Colaboratory Notebooks

Auto Reconnect using Browser console:

Use any one of snippets from the following blocks

function ClickRefresh(){
    console.log("Clicked on refresh button"); 
    document.querySelector("paper-icon-button").click()
}
setInterval(ClickRefresh, 60000)
@Subangkar
Subangkar / linux-commands.sh
Last active December 25, 2021 09:04
Common Linux Commands for remote server machine
# Internet speed Test Check with speedtest-cli
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
# Show free RAM
free -h
vmstat
# Show CPU config
lscpu
@Subangkar
Subangkar / .gitattributes
Created May 16, 2020 13:09
Common git attributes like ignore auto crlf etc.
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto
# Never modify line endings of our bash scripts
*.sh -crlf
# mount annonymous smb share
mount -t cifs //<your shareserver name or ip>/sharefolder -o username=guest,password="" /path_to_mountpoint
# access annonymous smb share
smbclient //host/share -U " "%" "
smbclient //host/share -U guest%
@Subangkar
Subangkar / git-commands.sh
Last active May 16, 2020 13:08
Git basic commands to use it from terminal
# init git repo
git init
# start git ignore
touch .gitignore
# clone repo
git clone <remote-repo-link> <local-repo-folder-name>