Skip to content

Instantly share code, notes, and snippets.

View jcfr's full-sized avatar
🎯
Focusing

Jean-Christophe Fillion-Robin jcfr

🎯
Focusing
View GitHub Profile
@jcfr
jcfr / Dockerfile
Last active August 2, 2018 15:20
Manylinux docker file to install libtiff and openslide
#FROM quay.io/pypa/manylinux1_x86_64
FROM dockcross/manylinux-x64
# FROM quay.io/pypa/manylinux1_i686
# Includes glibc 2.5
RUN mkdir /build
WORKDIR /build
RUN yum install -y \
# for easier development
#
# slicer_check_cmake_https
#
# Check if CMake supports downloading files using the HTTPS protocol. Fail if
# HTTPS is unsupported.
#
# CMake should support HTTPS when compiled with CMAKE_USE_OPENSSL enabled.
#
# Based on the script created by Jean-Christophe Fillion-Robin:
# https://gist.github.com/jcfr/e88a2a7cbc4ddd235186
#!/bin/bash
#
# This script maintained at https://gist.github.com/jcfr/0bb9b695a5f1511a4b66f9e872d44743
#
#
# Source: https://lebkowski.name/docker-volumes/#recap
#
@jcfr
jcfr / slicer_git_history_350_largest_files.txt
Created March 27, 2018 20:17
List of the 350 largest files committed into Slicer Git history based of Slicer/Slicer@27109 mapping to r27109 from 2018-03-26
size pack_size sha location
55MiB 55MiB 2cadcca7dd65c008c03ca0786ed3b02ad86cc900 Modules/Meshing/Testing/Data/CA05042124RFinal.img.gz
22MiB 4.9MiB 56760af8680e9ff7e857a97b384fb9c0b974ea11 Modules/Meshing/Testing/Data/lumbar_smoothed_04075.stl
15MiB 4.6MiB 0b64a9fbd9a0b02f65c726da71b7128013b94e3a Modules/CLI/RigidRegistration/Data/Baseline/RigidRegistrationTest02.nrrd
13MiB 13MiB d8ffda6d56ebd27758e54d3550dd64ff362a9589 Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData/OutDefField_orientedImage.nii.gz
13MiB 7.0MiB f56677b93dfcf31975dd86e2b4cff954795467e5 Modules/CLI/ModelToLabelMap/Data/Input/OAS10001.img
12MiB 11MiB 82101881013d74236903d672b5e85b138cd96acd Modules/TumorGrowth/Testing/Script-Results/TG_Deformable_Deformation_Inverse.mha
12MiB 11MiB 3d8a4983f4df3b7c5f77f6d945ce415d0495c1c7 Modules/TumorGrowth/Testing/GUI-Results/TG_Deformable_Deformation_Inverse.mha
@jcfr
jcfr / git_list_largest_file_from_history.sh
Last active March 28, 2018 03:41
Shell script listing the N largest file found in the history of a git-versioned project
#!/bin/bash
set -eo pipefail
#
# This script will list the N largest files found in the history of a Git project.
#
# References:
# * https://docs.acquia.com/article/removing-large-files-git-without-losing-history
# * https://stackoverflow.com/questions/10622179/how-to-find-identify-large-files-commits-in-git-history
@jcfr
jcfr / docker_tag_exists_locally_or_dockerhub.sh
Created March 20, 2018 05:52
Two bash functions to check if a given image is available locally or on dockhub
#
# Usage: docker_tag_exists_locally image[:tag]
#
function docker_tag_exists_locally {
image_name=${1##library/} # Strip "library/" suffix
found=$(docker images -q "$image_name" 2> /dev/null; return $?)
[[ $found == "" ]] && return 1 || return 0
}
#
@jcfr
jcfr / build_latest_openssl_curl_git.sh
Last active April 1, 2018 05:31
Script allowing to build and install the latest Curl/OpenSSL/Git
#!/bin/bash
#
# The content of this script has been copied from https://github.com/pypa/manylinux/tree/master/docker/build_scripts
# and is licensed under the MIT License (MIT) like the original scripts.
#
# It was originally created to update the version of openssl/curl/git used on some end-of-life
# build machines used to build extensions for the version 4.8.1 of 3D Slicer. Note that
# the 3D Slicer infrastructure is being updated to use docker images based of centos.
# See https://github.com/dockbuild/dockbuild
@jcfr
jcfr / _README.md
Last active January 25, 2018 22:37
Convenience script to retrieve Midas item download stats

Requirements

  • Python 2.7 (required by pydas)
  • pip install pydas

Example

$ export MIDAS_EMAIL=...
$ export MIDAS_API_KEY=...
@jcfr
jcfr / packages-kitware-com_redirects
Last active January 22, 2018 18:03
List of redirect links associated with retired packages.kitware.com server
##
## How to read this file ?
##
# This file contains a list of redirection. Redirection are the non-empty line that do not start with "#"
# A redirection is formatted as:
# <source_link> <destination_link>
@jcfr
jcfr / patch_mpdecimal_header_names.sh
Created November 6, 2017 20:53
Patch Python/Modules/_decimal/libmpdec/ headers to avoid conflict with system headers like io.h and memory.h
#!/usr/bin/env bash
#
# Run this script from "Modules/_decimal/libmpdec/" directory
#
# It will rename all local headers adding prefix "mpd_"
#
script_name=$(basename $0)