Skip to content

Instantly share code, notes, and snippets.

View 0leynik's full-sized avatar

Oleynik Dmitry 0leynik

View GitHub Profile
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active June 29, 2024 09:06
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@idleberg
idleberg / atom-macos-context-menu.md
Last active April 27, 2022 00:37
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@alexlee-gk
alexlee-gk / configure_cuda_p70.md
Last active June 21, 2024 03:40
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.

@sergeyprokudin
sergeyprokudin / count_flops.py
Last active October 24, 2019 13:36
Count trainable parameters and FLOPs per sample of a Keras model
import numpy as np
def count_conv_params_flops(conv_layer, verbose=1):
# out shape is n_cells_dim1 * (n_cells_dim2 * n_cells_dim3)
out_shape = conv_layer.output.shape.as_list()
n_cells_total = np.prod(out_shape[1:-1])
n_conv_params_total = conv_layer.count_params()