Skip to content

Instantly share code, notes, and snippets.

View Bosek's full-sized avatar

Tomas Bosek Bosek

  • Ostrava, Czech republic
View GitHub Profile
@lassoan
lassoan / FillHolesInSegments.py
Last active September 24, 2024 21:21
Fills all internal holes inside segments. For example, fills in empty regions inside vertebral bodies segmented with Grow from seeds with intensity-based masking.
segmentationNode = slicer.mrmlScene.GetFirstNodeByClass('vtkMRMLSegmentationNode')
# set value to the size of the larges cracks in the segment surfaces
maximumHoleSizeMm = 2.0
############
masterVolumeNode = segmentationNode.GetNodeReference(segmentationNode.GetReferenceImageGeometryReferenceRole())
# Create segment editor to get access to effects
segmentEditorWidget = slicer.qMRMLSegmentEditorWidget()
# To show segment editor widget (useful for debugging):
@ingo-m
ingo-m / debian_install_nvidia_docker.md
Last active May 8, 2024 14:21
Install nvidia docker for GPU-enabled tensorflow on Debian 10

Install nvidia docker for GPU-enabled tensorflow on Debian 10

Overview

  1. Install proprietary nvidia driver
  2. Install nvidia-container-toolkit, containing CUDA (?) (via apt-get)
  3. Install tensorflow docker container

(1) Install proprietary nvidia driver

@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active September 5, 2025 14:09
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@stalniy
stalniy / custom-pick.js
Created January 16, 2019 20:13
Custom pick with support for arrays using asterisk
function get(object, path) {
const fields = Array.isArray(path) ? path : path.split('.')
let cursor = object
for (let i = 0; i < fields.length; i++) {
if (fields[i] === '*') {
// TODO: validation of cursor being an array
const newPath = fields.slice(i + 1)
return cursor.map(item => get(item, newPath))
} else {
@rajibdpi
rajibdpi / Auto-Start a Virtual Machine at XenServer and XCP-NG Server 7.X.md
Last active May 3, 2023 15:09
Auto-Start a Virtual Machine at XenServer and XCP-NG Server 7.X.md

Auto-Start a Virtual Machine at XenServer and XCP-NG Server 7.X.md December 1, 2018 by Rajib Ahmed Enable auto-start on XenServer and XCP-NG Server:

# xe pool-list

output like this:
uuid ( RO) : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX copy the UUID and use:

@MichaelPote
MichaelPote / himawari.ps1
Created February 3, 2016 19:11
Windows Powershell Script to download the latest image from the Himawari-8 satelite, combine the tiles into a single image, convert to jpg and then set as the desktop background.
#
# Himawari-8 Downloader
#
#
#
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image,
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background.
#
# http://himawari8.nict.go.jp/himawari8-image.htm
#