Skip to content

Instantly share code, notes, and snippets.

View MatthewRalston's full-sized avatar
😁
Looking for new opportunities.

Matt Ralston MatthewRalston

😁
Looking for new opportunities.
View GitHub Profile
@MatthewRalston
MatthewRalston / pipeline.py
Created March 1, 2023 21:52
Troubleshooting v1.8 - v2.0 kfp syntax, specifying a gzip decompression schema
#!/bin/env python
import os
import sys
import argparse
from pathlib import Path
import gzip
import kfp.dsl as dsl
@MatthewRalston
MatthewRalston / bash
Created December 27, 2022 19:57
pyenv does not install module correctly with pyproject.toml
(kdb) [matt@argo] git:pyprojecttoml_build_twine+ </ffast2/kdb>>env PYENV_DEBUG=1 pyenv exec kmerdb -h 2>&1 | tee trace.log
+(/home/matt/.pyenv/bin/pyenv:23): enable -f /home/matt/.pyenv/bin/../libexec/pyenv-realpath.dylib realpath
+(/home/matt/.pyenv/bin/pyenv:30): '[' -z '' ']'
++(/home/matt/.pyenv/bin/pyenv:32): type -P greadlink readlink
++(/home/matt/.pyenv/bin/pyenv:32): head -1
+(/home/matt/.pyenv/bin/pyenv:32): READLINK=/usr/bin/readlink
+(/home/matt/.pyenv/bin/pyenv:33): '[' -n /usr/bin/readlink ']'
+(/home/matt/.pyenv/bin/pyenv:58): '[' -z /home/matt/.pyenv ']'
+(/home/matt/.pyenv/bin/pyenv:61): PYENV_ROOT=/home/matt/.pyenv
+(/home/matt/.pyenv/bin/pyenv:63): export PYENV_ROOT
@MatthewRalston
MatthewRalston / pipeline.py
Created December 23, 2022 13:32
A simple kubeflow pipeline step to determine if a file needs decompression
#!/bin/env python
import os
import sys
import argparse
import kfp.dsl as dsl
import kfp.components as comp
import kfp
@MatthewRalston
MatthewRalston / sysinfo.txt
Created March 28, 2021 18:56
Arch linux Steam sysinfo
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen Threadripper 3960X 24-Core Processor
CPU Family: 0x17
@MatthewRalston
MatthewRalston / cacheremove.hook
Created January 23, 2021 03:50 — forked from luukvbaal/cacheremove.hook
yay paccache hooks
[Trigger]
Operation = Remove
Type = Package
Target = *
[Action]
Description = Clearing cache...
When = PostTransaction
Exec = /home/<user>/.local/bin/tools/removehook
@MatthewRalston
MatthewRalston / peerj.tex
Created January 14, 2021 21:57
DCNorris' Peerj Latex template
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$
% Originally coded by Matt Ralston, Jan 14 2021
% Alex Ball's tutorial LaTeX code for making a bibLaTeX oxyear style (biblatex-oxref)
% Bibliography.
@MatthewRalston
MatthewRalston / root_logger.py
Created November 19, 2020 16:05
Root_logger boto update
def get_root_logger(level):
levels=[logging.WARNING, logging.INFO, logging.DEBUG]
if level < 0 or level > 2:
raise TypeError("{0}.get_root_logger expects a verbosity between 0-2".format(__file__))
logging.basicConfig(level=levels[level], format="%(levelname)s: $(asctime)s %(funcName)s L%(lineno)s| %(message)s", datefmt="%Y/%m/%d %I:%M:%S")
root_logger = logging.getLogger(__name__)
for name in logging.Logger.manager.loggerDict.keys():
if ('boto' in name) or ('urllib3' in name) or ('s3' in name):
logging.getLogger(name).setLevel(logging.ERROR)
return root_logger
@MatthewRalston
MatthewRalston / trump-bot-twiml.xml
Last active November 9, 2020 15:45
TrumpBot TwiML
<Response>
<Say voice="alice">Hi, I'd like to say on behalf of democracy that your behavior is unpatriotic, undemocratic, and your allegations have all been debunked. Check the debunking megathread on Twitter by Isaac Saul. Your actions are shameful and undermine democracy. Furthermore, you're wasting Republican money by keeping this line open. So I will continue to waste your time. Someone has to listen to this stuff anyways. Trump failed. Trump is supported by racists and xenophobes. Trump has hurt American health. Trump has hurt the economy through trade wars. Trump is friends with dictators. Trump was installed through election interference. Trump is a sexual predator. And you are supporting him. Trump failed. Trump is supported by racists and xenophobes. Trump has hurt American health. Trump has hurt the economy through trade
@MatthewRalston
MatthewRalston / reader.py
Created June 22, 2019 14:44
Fasta + Bam file validation with S3 support
import os
import sys
import gzip
import io
import tempfile
from Bio import SeqIO, bgzf
import pysam
import boto3
# Logger
@MatthewRalston
MatthewRalston / setup.py
Last active June 22, 2019 05:41
Example setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command