Skip to content

Instantly share code, notes, and snippets.

View lkoelman's full-sized avatar

Lucas lkoelman

View GitHub Profile
@lkoelman
lkoelman / install_powertools.sh
Last active August 30, 2024 09:40
Linux command-line setup: powertools and more
# Install Development tools
# - ripgrep
# - fzf: improved fuzzy finder (better ctrl+r + fuzy autocompletion with ** trigger)
# - bat: cat with syntax higlighting: https://github.com/sharkdp/bat/
# - eza: better ls: https://github.com/eza-community/eza?tab=readme-ov-file
# - tealdeer (tldr)
# - zoxide: `z`, a smarter cd and jump command: https://github.com/ajeetdsouza/zoxide
# With sudo/apt
sudo apt install build-essential \
@lkoelman
lkoelman / ubuntu_cuda_multiple-versions.sh
Last active February 26, 2021 14:24
Ubuntu 20 multiple CUDA versions
# Remove previous cuda and driver installs
# https://stackoverflow.com/questions/56431461/how-to-remove-cuda-completely-from-ubuntu
sudo apt-get --purge remove "*nvidia-driver*"
sudo apt-get --purge remove "cuda*" "*cublas*" "*cufft*" "*curand*" \
"*cusolver*" "*cusparse*" "*npp*" "*nvjpeg*" "cuda*" "nsight*"
sudo apt-get autoremove
sudo rm -rf /usr/local/cuda*
# Remove (comment out) old nvidia repos in file:
sudo nano /etc/apt/sources.list
@lkoelman
lkoelman / bindings.json
Created December 2, 2020 13:25
emacs keybingings for micro text editor
{
"<Ctrl-x><0>": "Unsplit",
"<Ctrl-x><2>": "HSplit",
"<Ctrl-x><3>": "VSplit",
"<Ctrl-x><Ctrl-c>": "QuitAll",
"<Ctrl-x><k>": "Quit",
"<Ctrl-x><Ctrl-f>": "OpenFile",
"<Ctrl-x><Ctrl-s>": "Save",
"<Ctrl-x><Ctrl-w>": "SaveAs",
"<Ctrl-x><b>": "NextTab",
@lkoelman
lkoelman / install_arbor_ubuntu.sh
Last active March 31, 2020 11:09
Installing Arbor simulator on Ubuntu with Python 3 and MPI support
# Based on following sources:
# - https://arbor.readthedocs.io/en/latest/install.html
# - https://github.com/arbor-sim/arbor/blob/master/scripts/travis/build.sh
# Create python 3 environment with MPI support
conda create -n py3arbor python=3
conda activate py3arbor
# Install an mpi distribution and compile python module mpi4py with it
sudo apt install openmpi-bin openmpi-common libopenmpi2 libopenmpi-dev
pip install mpi4py
@lkoelman
lkoelman / NEURON_UCD-Sonic-new_install.sh
Last active July 30, 2019 20:51
Installation of NEURON with Python support on the UCD Sonic cluster (new post-Q2 2019 cluster hardware)
# Load modules required for NEURON Python install
module purge
module load anaconda
# For GCC toolchain load following modules:
module load gcc openmpi/3.1.6
# For Intel toolchain load following instead of gcc and openmpi:
# export FI_PROVIDER=verbs
# module load intel/intel-cc
# module load intel/intel-mkl
@lkoelman
lkoelman / NEURON_UCD-Sonic-old_install.sh
Last active July 18, 2019 09:52
Installation of NEURON with Python support on the UCD Sonic cluster (old pre-Q2 2019 cluster hardware)
# Load modules required for NEURON Python install
module purge
module load gcc intel-mpi anaconda
# Create local Python environment
conda create -n localpy27 python=2 anaconda
source activate localpy27
# Install Python MPI support
# (must install using pip/setup.py when linking to system libraries rather than conda packaged libraries)
#!/bin/bash
# Based on 'scripts and utilities' in Duplicacy user guide: https://forum.duplicacy.com/t/duplicacy-user-guide/1197
################################################################################
# HOWTO
# - Follow steps 1-3 in https://forum.duplicacy.com/t/how-to-run-duplicacy-as-a-cron-job-on-linux/1611
# 1. initialize backup repositories
# 2. save password in preferences
@lkoelman
lkoelman / GENESIS_fedora_install.md
Last active October 16, 2018 11:11
How to install GENESIS 2.4 on Fedora linux
@lkoelman
lkoelman / fsl_fedora_install.md
Last active August 4, 2019 10:20
Install FSL on Fedora Linux

Download the FSL installer (python script) from https://fsl.fmrib.ox.ac.uk/fsldownloads_registration.

Type following commands in a Python interpreter:

from fslinstaller import *
manifest = get_web_manifest(Settings.mirror)
import json
with open('~/manifest.json', 'w') as fp:
 json.dump(manifest, fp)
# -*- coding: utf-8 -*-
r"""
Run a parallel ring network of ball-and-stick cells and write the spike times
to a file.
To execute with MPI across 2 processors::
$ mpiexec -n 2 python ringnet_mpi.py
To modify any simulation parameters, specify individual variables encased in