Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
@vsoch
vsoch / snakemake-debugging.sh
Created Oct 20, 2020
Snakemake Debugging on Google Cloud
View snakemake-debugging.sh
# This is a small script (that typically I copy paste) on a Google Cloud instance
# to set up an environment to mimic a worker. It includes installing snakemake,
# retrieving a package with the working directory (which typically has the
# version of snakemake I aim to develop or debug, and then interactively debugging
# or doing this.
sudo apt-get install -y wget bzip2 ca-certificates gnupg2 git
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo chown -R $USER /opt
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda
@vsoch
vsoch / index.php
Last active Oct 19, 2020
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
View index.php
<?php
header('Content-type: text/xml');
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
$feedName = "My Audio Feed";
$feedDesc = "Feed for the my audio files in some server folder";
@vsoch
vsoch / vcademy_mds.m
Created Aug 6, 2013
Multidimensional Scaling: a simple Matlab demonstration
View vcademy_mds.m
% Multidimensional scaling (MDS) Example
% Load matlab cities data
load cities
% This data has cities in rows, and different categories for ratings in
% columns. We will implement MDS to assess city similarity based on
% ratings.
% Step 1: Set up our proximity matrix
@vsoch
vsoch / Singularity
Last active Sep 15, 2020
A quick tutorial on how to generate a Singularity image with loadcaffee
View Singularity
Bootstrap: docker
From: ubuntu:16.04
%runscript
. /torch/install/bin/torch-activate
exec /bin/bash
%labels
MAINTAINER vsochat@stanford.edu
@vsoch
vsoch / gls.py
Last active Sep 2, 2020
Testing Google Life Sciences updated download / upload script (will be put into version control)
View gls.py
#!/usr/bin/env python
# This is a helper script for the Google Life Sciences instance to be able to:
# 1. download a blob from storage, which is required at the onset of the Snakemake
# gls.py download <bucket> <source> <destination>
# workflow step to obtain the working directory.
# 2. Upload logs back to storage (or some specified directory of files)
# gls.py save <bucket> <source-dir> <destination-dir>
# gls.py save <bucket> /google/logs/output source/logs
@vsoch
vsoch / Dockerfile
Last active Aug 25, 2020
Dolmades Files
View Dockerfile
FROM ubuntu:16.04
LABEL version="1.0"
ENTRYPOINT [ "/singularity" ]
RUN mkdir -p /APPS /PROFILES
RUN chmod 0777 /APPS /PROFILES
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get -y install wget less vim software-properties-common python3-software-properties apt-transport-https winbind
RUN wget https://dl.winehq.org/wine-builds/Release.key
@vsoch
vsoch / Singularity
Last active Aug 17, 2020
Singularity image with anaconda + R
View Singularity
From:rocker/ropensci
Bootstrap:docker
%environment
PATH=$PATH:/opt/anaconda3/bin
export PATH
%runscript
Rscript /code/runman.R
View joblib_vs_pickle.py
from sklearn.externals import joblib
import time
import numpy
import pickle
bigarray = numpy.zeros([190,91,190])
bigarray = bigarray.flatten()
### Saving
@vsoch
vsoch / AIRFLOW_FEEDBACK.md
Last active Jan 22, 2020
Apache Airflow Feedback 1/22/2020
View AIRFLOW_FEEDBACK.md

Airflow Feedback

This is feedback about contribution to Apache Airflow.

Background

I first opened up a pull request in early March 2019 to add a Singularity operator to airflow. I am fairly experienced with Singularity (but not Airflow) so largely my strategy was to use an existing operator (Docker) as an example, and go from there. The interaction felt more controlled than usual because I was required to open a JIRA issue, but this wasn't terrible and is understandable for a larger community. A reviewer was very quick

@vsoch
vsoch / cargo-debstatus-nu-0.3.0_10-17-2019.txt
Last active Dec 7, 2019
nu 0.3.0 dependency output from running cargo-debstatus in the root of the repository, and commenting out #default-run = "nu" in Cargo.toml. Do a find for (outdated) to highlight all the packages that were highlighted in yellow on the terminal (that I cannot show here)
View cargo-debstatus-nu-0.3.0_10-17-2019.txt
nu v0.3.0 (/home/vanessa/Documents/Dropbox/Code/rust/nushell-debian/nushell-0.3.0)
├── ansi_term v0.12.1 (in debian)
├── app_dirs v1.2.1
│ ├── ole32-sys v0.2.0
│ │ ├── winapi v0.2.8 (outdated)
│ │ └── winapi-build v0.1.1 (in debian)
│ ├── shell32-sys v0.1.2
│ │ ├── winapi v0.2.8 (outdated)
│ │ └── winapi-build v0.1.1 (in debian)
│ ├── winapi v0.2.8 (outdated)
You can’t perform that action at this time.