Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Nicholls SamStudio8

View GitHub Profile
@SamStudio8
SamStudio8 / acct_parse.py
Last active Apr 30, 2019
SGE QACCT Parsing
View acct_parse.py
"""
Provides functions for the purpose of parsing a Sun Grid Engine (SGE)
accounting file for job metadata.
"""
__author__ = "Sam Nicholls <msn@aber.ac.uk>"
__copyright__ = "Copyright (c) Sam Nicholls"
__version__ = "0.0.32"
__maintainer__ = "Sam Nicholls <msn@aber.ac.uk>"
@SamStudio8
SamStudio8 / base.Dockerfile
Last active Aug 2, 2019
Compile gpu-racon for the ONT Promethion with CUDA 9.0.176
View base.Dockerfile
# grab an off the shelf container with cuda9
FROM nvidia/cuda:9.0-devel-ubuntu16.04
# update gcc to gcc-6 as the default gcc-5 is too old
RUN apt-get update && apt-get install -y software-properties-common wget git
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt-get install -y gcc-6 g++-6
# update cmake as the default is too old
RUN wget -qO- "https://cmake.org/files/v3.15/cmake-3.15.1-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/
View contiguity.R
library(tidyverse)
assemblies=read_tsv('kraken_summary.bond.tsv')
short_name <- c(
"Bacillus subtilis" = "bs",
"Cryptococcus neoformans" = "cn",
"Enterococcus faecalis" = "ef",
"Escherichia coli" = "ec",
"Lactobacillus fermentum" = "lf",
@SamStudio8
SamStudio8 / shredder.py
Last active Mar 11, 2020
A very bad read generator
View shredder.py
import argparse
import sys
@SamStudio8
SamStudio8 / list_counties.sh
Last active Mar 23, 2020
Generate a list of UK authorities
View list_counties.sh
rm counties.*
rm *csv
# England ######################################################################
curl -O -J -L https://www.registers.service.gov.uk/registers/local-authority-eng/download-csv
# https://www.datadictionary.nhs.uk/data_dictionary/nhs_business_definitions/l/local_authority_de.asp?
# A Local Authority, in relation to England is:
## a County Council
awk -F',' '$6=="CTY" {print $7}' local-authority-eng.csv >> counties.eng.ls
View override_docker_workflow.sh
#!/bin/bash
USER_ID=${LOCAL_USER_ID:-9001}
echo "starting with UID : $USER_ID"
echo "creating RAMPART user"
useradd --shell /bin/bash -u $USER_ID -o -c "" -m rampart
echo "raising RAMPART on $CLIENT $SERVER"
@SamStudio8
SamStudio8 / go.sh
Created Jun 16, 2020
building the kraken2-microbial database
View go.sh
# kraken2-microbial database
## Monday 3rd September 2018
## s.nicholls.1
KDB=$1
kraken2-build --download-taxonomy --threads 24 --db $KDB
kraken2-build --download-library archaea --db $KDB
kraken2-build --download-library bacteria --db $KDB
@SamStudio8
SamStudio8 / http-get-dos.conf
Created Jun 7, 2016
Simple fail2ban DOS jail
View http-get-dos.conf
# Fail2Ban configuration file
#
# NOTE
# You should set up in the jail.conf file, the maxretry and findtime carefully in order to avoid false positives.
#
# Author: http://www.go2linux.org
# Modified by: samnicholls.net
# * Mon 6 Jun 2016 - Updated failregex to capture HOST group correctly
[Definition]
You can’t perform that action at this time.