Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
@vsoch
vsoch / download.py
Created Nov 2, 2019
Provides a wrapper script to download a Snakemake Blob, and then extract to a location. This should be moved to be packaged alongside snakemake
View download.py
#!/usr/bin/env python
import argparse
import datetime
from google.cloud import storage
def download_blob(bucket_name, source_blob_name, destination_file_name):
"""Downloads a blob from the bucket."""
storage_client = storage.Client()
@vsoch
vsoch / backup.sh
Created Oct 21, 2019
An example of using rsync to backup three folders in Documents to an external drive, checking that it's mounted first
View backup.sh
#!/bin/bash
output=/media/$USER/My\ Passport/vubuntu/
if [ ! -d "$output" ]; then
echo "$output not found, is drive connected to computer?"
exit 1
fi
for folder in "Personal" "Transcripts" "Resume"; do
rsync -avzh /home/$USER/Documents/$folder $output
@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)
@vsoch
vsoch / Dockerfile
Created Jul 19, 2019
An example Dockerfile using MicroSecurity scanner from AquaSec. You need to first get a token, and replace variables in the file.
View Dockerfile
FROM YOURCONTAINERHERE
# docker run --rm -it aquasec/microscanner --register <email address>
# docker build -t dirty-container .
RUN apk add --no-cache ca-certificates && update-ca-certificates
ADD https://get.aquasec.com/microscanner .
RUN chmod +x microscanner
RUN ./microscanner YOURTOKENHERE
@vsoch
vsoch / README.md
Created Jul 11, 2019
Apache with Singularity and without sudo
View README.md

Apache with Singularity

Start with this recipe

Bootstrap: docker
From:httpd:2.4.37
%startscript
httpd-foreground
@vsoch
vsoch / result.json
Last active Jul 11, 2019
Example of using the monitor_gpu decorator
View result.json
{
"commits": [
"7ea1152603baef5f0012905f321586399f816958"
],
"dates": [
"2019-07-11 09:51:36 -0700"
],
"content": [
{
"nvml_driver_version": "418.67",
View data.json
---
layout: null
excluded_in_search: true
permalink: /data.json
---
{
{% for post in site.pages %}{% unless post.excluded_in_search %}{% if added %},{% endif %}{% assign added = false %}
"{{ site.title | slugify }}-{{ post.url | slugify }}": {
"id": "{{ site.title | slugify }}-{{ post.url | slugify }}",
"title": "{{ site.title }}: {{ post.title | xml_escape }}",
@vsoch
vsoch / Dockerfile
Last active May 15, 2019
An example multistage Dockerfile to install gvim and then throw the extra stuff away!
View Dockerfile
FROM ubuntu:18.04 as base
# docker build -t vanessa/vim .
RUN apt-get update && apt-get install -y git \
gcc \
libncurses5-dev \
libncursesw5-dev \
build-essential
@vsoch
vsoch / result.json
Last active May 11, 2019
An example of using the watchme psutils decorator to monitor resource usage of a function
View result.json
[
{
"num_ctx_switches": {
"voluntary": 1,
"involuntary": 0
},
"ionice": {
"ioclass": "IOPRIO_CLASS_NONE",
"value": 4
},
@vsoch
vsoch / Singularity
Last active May 8, 2019
An example of setting a custom environment variable already defined in the container
View Singularity
Bootstrap: docker
From: centos:7
# sudo singularity build lamps.simg Singularity
%environment
now=`date '+%Y_%m_%d'`
hostname=`hostname`
APPNAME="lammps"