Skip to content

Instantly share code, notes, and snippets.

View 0leynik's full-sized avatar

Oleynik Dmitry 0leynik

View GitHub Profile
@0leynik
0leynik / LMDB_val_patches.txt
Created October 26, 2017 12:47 — forked from bearpaw/LMDB_val_patches.txt
Read LMDB in python
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000001.jpg 1
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000002.jpg 1823
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000003.jpg 2903
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000004.jpg 4470
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000005.jpg 4698
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000006.jpg 4797
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000007.jpg 4917
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000008.jpg 5072
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000009.jpg 5177
./cache/flic_win/LMDB/LMDB_val_patches/casino-royale-00039871_00000001_000010.jpg 5271
@0leynik
0leynik / Install NVIDIA Driver and CUDA.md
Created February 11, 2018 16:39 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@0leynik
0leynik / configure_cuda_p70.md
Created February 17, 2018 17:28 — forked from alexlee-gk/configure_cuda_p70.md
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

The error I get:
/usr/bin/ld: cannot find -lopenblas
collect2: error: ld returned 1 exit status
Makefile:568: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
The changes I made:
Makefile.config
#INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
@0leynik
0leynik / ManualHough.py
Created August 16, 2018 07:14 — forked from ri-sh/ManualHough.py
Hough Lines from scratch using opencv and numpy
# imports
import numpy as np
import cv2
import matplotlib.pyplot as plt
# The Hough Transform is a popular algorithm for detecting any shape that can
# be represented in a parametric mathmatical form in binary images. This
# usually means that images need to be thresholded or filtered prior to running
(function(){
'use strict';
if (!confirm('Delete?')) return;
//posts
//var deletePostLink = document.body.querySelectorAll('a.ui_actions_menu_item[onclick^="wall.deletePost"]');
//gifts
// var deletePostLink = document.body.querySelectorAll('a.gift_delete[onclick^="Gifts.deleteGift"]');
@0leynik
0leynik / download-and-upload-files-with-googledrive.ipynb
Last active October 29, 2020 01:14
Download and upload files with GoogleDrive
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0leynik
0leynik / pyplot_figsize_dpi_test.ipynb
Last active May 16, 2019 11:14
Testing dependencies between pyplot figsize and dpi on plot and image
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0leynik
0leynik / add_to_dict.py
Created September 16, 2019 14:01
Add word or words to dictionary file in txt-format
import sys
import re
import os
add_mode = sys.argv[1]
if add_mode == '--word':
words = [sys.stdin.read().strip()]
elif add_mode == '--words':
split_pattern = r'[\ \,\.\:\;\!\?\(\)\{\}\[\]\\\/\|\<\>\$\%\*]+'