Skip to content

Instantly share code, notes, and snippets.

View eschen42's full-sized avatar

Arthur Eschenlauer eschen42

View GitHub Profile
@eschen42
eschen42 / brew-install-gitfs-error.md
Last active May 29, 2017 15:54
'brew install gitfs' and 'brew info gitfs' - "Error: wrong number of arguments (0 for 1..3)"

cannot install formula gitfs

steps to recreate

build and run .linuxbrew/Dockerfile image

run the following in bash and observe output

linuxbrew@78f515fa1f4d:~$ brew update
Already up-to-date.

linuxbrew@78f515fa1f4d:~$ brew update
Already up-to-date.
@eschen42
eschen42 / docker_bash_exec
Last active September 9, 2017 15:06
Run bash in a new or existing container
#!/bin/sh
# Run bash within an already-running container
# arg1 - ID or nickname of a running container
if [ "'${COLUMNS}x'" = "'x'" ]; then
echo Please 'export COLUMNS' before running this script.
else
sudo docker exec -ti $1 bash -c "export TERM=xterm; export COLUMNS=$COLUMNS; /bin/bash"
fi
@eschen42
eschen42 / docker_image_dump
Created September 2, 2017 15:55
Dump a Docker image as the skeleton of a DockerFile
#!/bin/bash
# emit skeletion of DockerFile for the image given by the first (and only) argument
echo "# Here is a skeleton DockerFile for docker image '$1'"
docker history --no-trunc $1 \
| sed '1 d; s/.* ago [ ]*/RUN /; s/[ ][ ]*[0-9.][0-9.]*[kMG]*B[ ][ ]*$//; s/^RUN .bin.sh -c #.nop. [ ]*//' \
| tac
@eschen42
eschen42 / Dockerfile.planemo
Last active September 11, 2017 17:17
Dockerfile to run planemo
# ref: https://gist.github.com/eschen42/d5b7850ea74c6dd8f37714f7d48955fc
# Objective - To create a Docker environment in which I can run planemo
# To build
# sudo docker build -t eschen42/planemo .
# To run and delete the container on exit
# sudo docker run --rm -ti eschen42/planemo
# You will be logged in as the 'debian' user without superuser privileges.
# For superuser privileges, supply arguments, e.g.:
# sudo docker run --rm -ti eschen42/planemo bash -c "export TERM=xterm; /bin/bash"
@eschen42
eschen42 / Dockerfile.devtools
Created January 7, 2018 06:57
Dockerfile with RStudio, R 3.4.3, and devtools
# RStudio with vignette-building capability
# Step 1 - build from this Dockerfile
# docker build -t eschen42/devtools .
# Step 2 - create a home directory
# mkdir ~/rstudio
# Step 3 - run the container with this new directory
# docker run --rm -ti -p 8787:8787 -v ~/rstudio:/home/rstudio eschen42/devtools
# Step 4 - browse to RStudio as http://localhost:8787
FROM rocker/verse:3.4.3
@eschen42
eschen42 / Dockerfile.devplan
Last active January 10, 2018 06:00
Dockerfile to run planemo and rstudio with devtools and planemo
# Planemo and RStudio with vignette-building capability (via R package 'devtools')
# Step 1 - Build from this Dockerfile (you must cd to the directory containing it first)
# docker build -t eschen42/devplan .
# Step 2 - Create a home directory, e.g.:
# mkdir ~/devplan
# Step 3 - Run the container with this new directory; note that the container will create
# files in this directory with UID 1000 (which is user rstudio on the guest), e.g.:
# docker run --name devplan --rm -ti -p 8787:8787 -p 8790:9090 -v ~/devplan:/home/rstudio eschen42/devplan
# Step 4 - On the host, browse to RStudio at http://localhost:8787
# Step 5 - Set up /home/rstudio/.ssh (on the guest; ~/devplan/.ssh on the host) if desired
@eschen42
eschen42 / texlive.profile
Created February 16, 2018 13:46
texlive scripted install for linux_x86_64 into /home/rstudio
## # References
## - https://www.tug.org/texlive/doc/texlive-en/texlive-en.html - The TEX Live Guide
## - http://tug.org/texlive/acquire-netinstall.html - Installing TeX Live over the Internet
## - This documents where to get install-tl, the TEX Live installer
## - http://tug.org/texlive/quickinstall.html - TeX Live - Quick install
## - This documents how to install install-tl, the TEX Live installer
## - Note that, if you want to run the GUI, you will need to install
## - the perl-tk package on Debian, Ubuntu, and other apt-based distributions
## - something similar on other distributions ...
## - http://tug.org/texlive/doc/install-tl.html#PROFILES
@eschen42
eschen42 / ds_rename.py
Created September 17, 2018 13:34
Rename a dataset through Galaxy API
from bioblend import galaxy
galaxy_url = 'http://localhost:9087'
my_api_key = '31df2af1726af56b8bd122f892978529'
history_id = u'f2db41e1fa331b3e'
dataset_id = u'f597429621d6eb2b'
def generate_dataset_metadata(contentsList):
for x in contentsList:
if not x["deleted"]:
yield {'deleted': x["deleted"], 'hid': x["hid"], 'id': x["id"], 'name': x["name"]}
def show_datasets(history_id):
@eschen42
eschen42 / ApplyReduceMovingAverage.icn
Created October 13, 2018 01:20
Icon code for Apply, Reduce, and MovingAverage
procedure Apply(f, L)
local result, x
result := []
every x := !L do put(result, f(x)) | fail
return result
end
procedure Reduce(f, L)
if *L > 1
then return f( L[1], Reduce( f, L[2:0] ) )