This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # To get an Ubuntu 16.04 XFCE desktop: sudo sh -e ~/Downloads/crouton -t xfce,cli-extra,xiwi,extension -r xenial | |
| # For CLI-only: sudo sh -e ~/Downloads/crouton -t cli-extra -r xenial | |
| # To run the latest version: | |
| # curl https://gist.githubusercontent.com/bdunnette/75fdc4b15b9599cd5fdf/raw/setup-chroot.sh | sh | |
| sudo apt-get install -y nano curl git language-pack-en build-essential software-properties-common | |
| sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list | |
| gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 | |
| gpg -a --export E084DAB9 | sudo apt-key add - | |
| sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh user1234@my-virtual-host.oit.umn.edu | |
| sudo su - swadm | |
| sudo su - mysql | |
| mysql -u root -p | |
| CREATE USER 'olab'@'localhost' IDENTIFIED BY 'my_olab_database_password'; | |
| GRANT ALL PRIVILEGES ON olab.* TO 'olab'@'localhost'; | |
| OAuth callback URL: http://my-virtual-host.oit.umn.edu/home/loginOAuthCallback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| A constant-space parser for the GeneOntology OBO v1.2 format | |
| Modified from work by Uli Koehler: http://techoverflow.net/blog/2013/11/18/a-geneontology-obo-v1.2-parser-in-python/ | |
| """ | |
| from __future__ import with_statement | |
| from collections import defaultdict | |
| import types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for s in *.svs | |
| do | |
| echo "$s" | |
| #To generate a reasonable-sized JPEG, we'll export level 1 of the SVS file (level 0 = full magnification, which many image processing programs don't handle well) | |
| time vips jpegsave $s[level=1] $s.jpeg | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import gspread | |
| import requests | |
| cases = requests.get("http://slides.pathology.umn.edu/ISP/cases.json").json() | |
| # Login with your Google account | |
| gc = gspread.login(sys.argv[1], sys.argv[2]) | |
| # Open a worksheet from spreadsheet with one shot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sendEmails() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var startRow = 2; // First row of data to process | |
| var dataRange = sheet.getRange(startRow, 1, sheet.getLastRow(), sheet.getLastColumn()) | |
| // Fetch values for each row in the Range. | |
| var data = dataRange.getValues(); | |
| for (i in data) { | |
| var row = data[i]; | |
| var notificationSent = row[3]; | |
| Logger.log(notificationSent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| echo "Extracting HTML Files" | |
| for f in ~/*.tar | |
| do | |
| tar xvf "$f" --wildcards '*.html' | |
| done | |
| for n in 0 1 2 3 4 5 6 7 8 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import feedparser | |
| import urllib | |
| feed = feedparser.parse('http://ws.audioscrobbler.com/2.0/user/lazymofo/podcast.rss') | |
| for item in feed.entries: | |
| item_url = item.links[0].href | |
| print item_url | |
| file = urllib.urlretrieve(item_url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import hashlib | |
| import os | |
| import sys | |
| import csv | |
| # Set the directory you want to start from | |
| rootDir = sys.argv[1] | |
| BLOCKSIZE = 65536 | |
| csv_filename = "checksums.csv" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import os | |
| import os.path | |
| import zipfile | |
| from lxml import etree | |
| from lxml import objectify | |
| tempdir = 'temp' | |
| docfile = zipfile.ZipFile(sys.argv[1]) | |
| docfile.extractall(tempdir) |