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 / print_hex.c
Created April 11, 2017 07:11 — forked from ishchegl/print_hex.c
Print HEX in C
#include <stdio.h>
#include <string.h>
#define MAX_DATA_LEN 1024
static unsigned char hex_string[MAX_DATA_LEN];
static inline char convert_to_printable(char c)
{
return c < 32 || c > 126 ? '.' : c;
@Red-Eyed
Red-Eyed / .bashrc
Created June 13, 2017 09:18
config: bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
source ~/.bashrc_work > /dev/null 2>&1
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
@Red-Eyed
Red-Eyed / test.py
Created November 24, 2018 19:40
How to fix invalida polygons in shapely
from shapely.geometry import Polygon, MultiPolygon
from shapely.ops import polygonize
import numpy as np
from skimage import draw, io
img = np.zeros(shape=(600, 600, 3), dtype=np.uint8)
coords = np.array([[20, 20], [20, 400], [400, 20], [400, 400]], dtype=np.int32)
p = Polygon(coords)
@Red-Eyed
Red-Eyed / archlinux_gcc_fix
Last active December 19, 2019 07:20
Fix of error:unable to initialize decompress status for section .debug_info
sudo pacman -U http://archlinux.arkena.net/archive/packages/e/elfutils/elfutils-0.174-1-x86_64.pkg.tar.xz http://archlinux.arkena.net/archive/packages/l/libelf/libelf-0.174-1-x86_64.pkg.tar.xz
sudo pacman -U http://archlinux.arkena.net/archive/packages/b/binutils/binutils-2.30-5-x86_64.pkg.tar.xz
@Red-Eyed
Red-Eyed / build_opencv.sh
Created January 15, 2020 08:09
building opencv in linux
#!/bin/bash
cd $(dirname $(readlink -f $0))
mkdir -p build/install
cd build
# on archlinux install:
# pacman -S gcc-fortran intel-tbb openblas cblas lapack lapacke eigen
@Red-Eyed
Red-Eyed / google-chrome-flatpak
Created April 26, 2020 12:01 — forked from cho2/google-chrome-flatpak
Google Chrome Flatpak
//eos3
flatpak remote-add --user eos-apps --no-gpg-verify https://ostree.endlessm.com/ostree/eos-apps
flatpak install --user eos-apps com.google.Chrome
git clone git@github.com:endlessm/eos-google-chrome-app.git
cd eos-google-chrome-app
chmod +x eos-google-chrome-app
./eos-google-chrome-app
//master
flatpak remote-add --user --no-gpg-verify chrome http://blog.kukuh.syafaat.id/google-chrome-flatpak-repo-testing/repo
@Red-Eyed
Red-Eyed / ffmpeg-compress-mp4
Created January 14, 2021 21:51 — forked from lukehedger/ffmpeg-compress-mp4
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@Red-Eyed
Red-Eyed / dataclass_from_dict.py
Created March 18, 2021 13:55 — forked from gatopeich/dataclass_from_dict.py
Python 3.7 dataclass to/from dict/json
from dataclasses import dataclass, fields as datafields
from ujson import dumps, loads
# Note: ujson seamlessly serializes dataclasses, unlike stdlib's json
@dataclass
class Point:
x: float
y: float
# Shallow dataclass can be rebuilt from dict/json:
@Red-Eyed
Red-Eyed / smb.conf
Last active May 26, 2021 05:26
Windows 10 connect to ubuntu over samba
[global]
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
passdb backend = tdbsam
security = user
[public]
comment = MY_PASSPORT
path = /mnt/MY_PASSPORT/data/
browsable = yes
create mask = 0660
@Red-Eyed
Red-Eyed / pytorch avx benchmark.ipynb
Last active November 8, 2021 20:08
pytorch benchmarks AVX512
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.