Skip to content

Instantly share code, notes, and snippets.

View duskvirkus's full-sized avatar
🇺🇦
declare variables not war

Dusk duskvirkus

🇺🇦
declare variables not war
View GitHub Profile
@duskvirkus
duskvirkus / Readme.md
Last active September 25, 2025 15:42
debug docker image file system by entering at shell

How to debug a docker container by entering the shell because I always forget

If not already a service add keep alive to the Dockerfile

ENTRYPOINT ["tail", "-f", "/dev/null"]

Then to enter shell do the following

#!/bin/bash
# Installs s5cmd
if command -v s5cmd &> /dev/null
then
echo "s5cmd is already installed"
exit 0
fi
START_DIR=$(pwd)
import concurrent.futures
from tqdm import tqdm
import random
import time
def run_on_thread_example(packed_args):
arg_one, arg_two = packed_args
import concurrent.futures
from tqdm import tqdm
def run_multiprocess(func, iterator):
with concurrent.futures.ProcessPoolExecutor() as executor:
results = list(tqdm(executor.map(func, iterator), total=len(iterator)))
return results
Table t;
int rows = 8;
int cols = 11;
float rowSize;
float colSize;
ArrayList<String> toDisplay = new ArrayList<String>();
@duskvirkus
duskvirkus / CMakeLists.txt
Created February 17, 2022 10:35
minimal c++ pytorch
cmake_minimum_required(VERSION 3.0)
project(cxxtorch)
find_package(Torch REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
add_executable(cxxtorch main.cxx)
target_link_libraries(cxxtorch "${TORCH_LIBRARIES}")
set_property(TARGET cxxtorch PROPERTY CXX_STANDARD 14)

Local ML Setup

Minimal ubuntu server install to machine learning development setup mostly thanks to lambda.

Currently using ubuntu server 20.04.

By no means is this a definitive guide more a list for me to remember what I like to do I definitly recommend looking into each thing individually for up to date instructions on installation.

Gnome3

Simple Python Profiler

in code:

call configure_profiling

use @profile_decorator on functions you want to time

don't forget to call

@duskvirkus
duskvirkus / os-getcwd-bug.ipynb
Created June 6, 2021 00:59
os-getcwd-bug.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
absl-py
alabaster
albumentations
altair
appdirs
argon2-cffi
arviz
astor
astropy
astunparse