Skip to content

Instantly share code, notes, and snippets.

J-Donald Tournier jdtournier

View GitHub Profile
View Run_vector_bool_tests.sh
#!/bin/bash
function run {
echo "==========================================="
echo "$@"
echo "==========================================="
"$@" vector_bool.cpp -o vector_bool
time ./vector_bool
echo ""
}
@jdtournier
jdtournier / test_sync.cpp
Created Aug 27, 2018
Sample code to sync via filesystem
View test_sync.cpp
#include <iostream>
#include <string>
#include <stdexcept>
#include <stdexcept>
#include <sstream>
#include <cstring>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@jdtournier
jdtournier / test_memfd_create.cpp
Last active Aug 2, 2018
demo for using memfd_create() to shared raw memory between processes
View test_memfd_create.cpp
//#include <sys/memfd.h>
#include <sys/syscall.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
@jdtournier
jdtournier / module
Last active Jul 16, 2018
bash script to simplify handling of MRtrix3 modules
View module
#!/bin/bash
if [[ $# != 2 ]]; then
cat <<EOD
usage: ./module action target
where:
- action is one of: install update remove
@jdtournier
jdtournier / README.md
Created Mar 14, 2018
generate changelog
View README.md

This script guesses the numbers for the merged pull requests from the last tag, then fetches the corresponding information from GitHub and formats it into markdown format suitable for use in e.g. Discourse.

To use, please add create a 'fetch_changelog_settings' file in the toplevel of your repo folder, with the correct information:

repo = 'MRtrix3/mrtrix3'
user = 'jdtournier'
@jdtournier
jdtournier / install_from_source
Last active Mar 5, 2018
a script to download and compile all dependencies for MRtrix3 for installation on older distributions
View install_from_source
#!/bin/bash
# to be used for installation on older systems when all else fails...
#
# Notes:
#
# - to prevent unnecessary downloads, dependencies are only fetched if the
# 'source_install_files' folder does not already exist. Delete it if you want to
# fetch them again.
#
@jdtournier
jdtournier / read_deps.sh
Created Sep 26, 2017
work out dependencies of executable
View read_deps.sh
#!/bin/bash
readelf -d "$1" 2>/dev/null | sed -n -e 's/^.*NEEDED.*\[\(\S*\)\]/\1/p'
@jdtournier
jdtournier / README.md
Last active Feb 15, 2018
short demo for C++11 extern templates
View README.md

A short demo for C++11 extern templates.

You can’t perform that action at this time.