Skip to content

Instantly share code, notes, and snippets.

View deepwilson's full-sized avatar
🏠
Working from home

Deep Wilson deepwilson

🏠
Working from home
View GitHub Profile
"""Resize all images in a folder"""
from tqdm.notebook import tqdm
import os
import glob
input_folder = r"" #os.getcwd()
output_folder = r""
resize_width = 512
resize_height = 512
# create env
conda create -n env_name
conda activate env_name
# remove env
conda env remove -n env_name
# list all versions from diff channels
conda search package_name
pip install jupyter_contrib_nbextensions
pip install jupyter_nbextensions_configurator
jupyter contrib nbextension install --user
jupyter nbextensions_configurator enable --user

If you want to move WSL2 Linux distro(Ubuntu) from C: drive D: below are the steps.

Export Ubuntu

mkdir D:\backup wsl --export Ubuntu D:\backup\ubuntu.tar Unregister the same distribution to remove it from the C: drive:

wsl --unregister Ubuntu Import Ubuntu

import os
import subprocess
import shutil
def run_command(command, description):
print(f"[INFO] {description}...")
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
output, error = process.communicate()
if process.returncode != 0:
print(f"[ERROR] Failed to execute: {command}")