Skip to content

Instantly share code, notes, and snippets.

View kenichi's full-sized avatar

Kenichi Nakamura kenichi

  • Portland, Oregon
View GitHub Profile
@kenichi
kenichi / Dockerfile
Last active November 7, 2022 21:08
gcloud docker with cli alias for m1
FROM google/cloud-sdk:latest
ARG UID
ARG GID
ARG USERNAME
RUN useradd -u $UID -g $GID $USERNAME
WORKDIR /home/$USERNAME
USER $USERNAME
@kenichi
kenichi / .iex.exs
Created August 29, 2022 17:18
IEX clipboard helper
defmodule KEx do
@moduledoc "custom IEx extensions"
@doc """
Send data to `pbcopy`, a macOS utility that reads STDIN into the clipboard.
"""
def pbcopy(data) do
port = Port.open({:spawn, "/usr/bin/pbcopy"}, [:binary])
send(port, {self(), {:command, data}})
send(port, {self(), :close})
@kenichi
kenichi / Dockerfile
Created July 13, 2022 22:59
dockerfile and compose for local dev with elixir:alpine
FROM elixir:1.13-alpine AS base
RUN apk add --no-cache \
bash \
inotify-tools \
nodejs npm \
openssl
WORKDIR /app
CMD ["mix", "phx.server"]
$ bionode-ncbi search assembly phylos | jq .uid
"874841"
$ bionode-ncbi download assembly 874841
$ cd 874841/
$ gunzip GCA_001865755.1_ASM186575v1_genomic.fna.gz
$ head GCA_001865755.1_ASM186575v1_genomic.fna
$ prefetch SRS4167515
prefetch.2.9.3: 1) Downloading 'SRS4167515'...
prefetch.2.9.3: Downloading via https...
prefetch.2.9.3: 1) 'SRS4167515' was downloaded successfully
prefetch.2.9.3: 'SRS4167515' has 0 unresolved dependencies
$ head SRS4167515_?.fastq
==> SRS4167515_1.fastq <==
@SRS4167515.1 1 length=76
AGTCTTGTCTCCCAGCAACAATCCGAAACCACCATCTCAATGGAAGAGGCTTCTTTCCCAGAACCTCCTCCACTTG
+SRS4167515.1 1 length=76
AAAAAAE///EAE/E</EAEA/A/EAEEEE/EAEE<EEE<E//EEEA//EEAEEA///E//EAEE/E/EAAEEEE/
@SRS4167515.2 2 length=76
GTCTTGTCTCCCAAGCAACAAGCCGAAACCACCATCTCAATGGAAGAGGCTTCTTTCCCAGACCCTCCTCCACTTG
+SRS4167515.2 2 length=76
AAAAAEEEEEEEEEEEEEEE6EEEEEEEEE/EE/EEEEE6EEEEEEEEEEEAEEAEEEAEE66EEEAEEA<AAAEE
$ fastq-dump --split-files SRS4167515.sra
Read 2840859 spots for SRS4167515.sra
Written 2840859 spots for SRS4167515.sra
ncbi/
└── public
└── sra
└── SRS4167515.sra
FROM base_prod_example_php_fpm:latest
COPY --chown=www-data example /var/www/example/
FROM local_example_php_fpm:latest
COPY --chown=www-data \
example/composer.json \
example/composer.lock \
example/composer.phar \
/var/www/example/
COPY --chown=www-data example/vendor /var/www/example/vendor