Skip to content

Instantly share code, notes, and snippets.

View Red-Eyed's full-sized avatar

Vadym Stupakov Red-Eyed

View GitHub Profile
@Red-Eyed
Red-Eyed / pytorch avx benchmark.ipynb
Last active November 8, 2021 20:08
pytorch benchmarks AVX512
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Red-Eyed
Red-Eyed / ssh_scanner.py
Last active March 20, 2022 06:06
ssh scanner
from argparse import ArgumentParser
from concurrent.futures import ThreadPoolExecutor
from ipaddress import ip_network
import socket
try:
from paramiko import SSHClient
except ModuleNotFoundError:
from subprocess import run
import sys
@Red-Eyed
Red-Eyed / ssh-copy-id.bat
Last active December 18, 2022 14:25
ssh-copy-id for windows
type ~/.ssh/id_rsa.pub | ssh USER@HOST "mkdir -p ~/.ssh && LANG=C sed 's/[\d128-\d255]//g' >> ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys"
@Red-Eyed
Red-Eyed / .gitconfig
Last active May 9, 2025 05:38
git and ssh accounts
[includeIf "gitdir:~/Projects/work/"]
path = .gitconfig_job
[includeIf "gitdir:~/Projects/personal/"]
path = .gitconfig_personal
[pull]
rebase = false
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
@Red-Eyed
Red-Eyed / !Android debloat.md
Last active December 18, 2022 14:27
Android debloat

Usefull commands

Get current ativity: dumpsys activity activities | grep mResumedActivity

Uninstall app example: pm uninstall -k --user 0 com.aura.oobe.samsung.gl

Restore removed app example: pm install-existing com.aura.oobe.samsung.gl

@Red-Eyed
Red-Eyed / 0-install-deluge-python.sh
Last active May 22, 2022 15:06
Install deluge-web (used for raspberry pi)
# To use geoip
sudo apt install geoip-database libgeoip-dev
py_ver=`python -c "from sys import version_info as vi; print(f'{vi[0]}.{vi[1]}')"`
sudo apt install python${py_ver}-venv
pip install pipx
pipx install deluge
pipx inject deluge libtorrent GeoIP
@Red-Eyed
Red-Eyed / logging_config.py
Last active September 11, 2024 15:40
Convenient way to set python logging
from pathlib import Path
import logging
import sys
def set_logger(error_file: Path, info_file: Path):
error_file = Path(error_file).expanduser().resolve()
error_file.parent.mkdir(exist_ok=True, parents=True)
info_file = Path(info_file).expanduser().resolve()
info_file.parent.mkdir(exist_ok=True, parents=True)
@Red-Eyed
Red-Eyed / opencv-opencl-android.md
Created September 13, 2022 12:16 — forked from iago-suarez/opencv-opencl-android.md
Setting Up OpenCL for OpenCV on Android, the full story

Setting Up OpenCL for OpenCV on Android, the full story

The tutorial Use OpenCL in Android camera preview based CV application show us how we can use the Transparent API to dramatically increase the performance of some expensive operations.

The first step in order to be able to execute the tutorial example is to re-compile opencv with the correct flags:

# Export your NDK, it will be looked for OpenCV to compile your project. In my case
export ANDROID_NDK=~/graffter/libs/android-ndk-r10d/

# Download the necessary code
#!/usr/bin/env python3
from argparse import ArgumentParser
from functools import partial
from shutil import copy
from subprocess import Popen, PIPE
from shlex import split
import os
import re
import atexit
@Red-Eyed
Red-Eyed / logcat.py
Last active December 18, 2022 14:26
logcat
#!/usr/bin/env python3
from pathlib import Path
import os
import sys
from subprocess import Popen, PIPE, getoutput
from shlex import split
from contextlib import redirect_stdout
import argparse