Skip to content

Instantly share code, notes, and snippets.

@TheCulliganMan
TheCulliganMan / last_logins.py
Created August 1, 2023 14:39
Get last ssh logins for a list of boxes.
"""Get last logins for users over the past few months."""
import argparse
import asyncio
import asyncssh
import datetime
from dateparser import parse as parse_date
from typing import List, Tuple, Optional
async def ssh_login(hostname: str, username: str, password: str) -> Optional[asyncssh.SSHClient]:
"""

Keybase proof

I hereby claim:

  • I am theculliganman on github.
  • I am theculliganman (https://keybase.io/theculliganman) on keybase.
  • I have a public key ASDHX_F7noGXju2HMTtCUMTPILkx1bj7z97-0_tanhrjJQo

To claim this, I am signing this object:

guy = "\n".join([
" ` `",
" ` ` `",
" ``.``` . `` ` `. `",
" ``````` ` ` ` ` . . ``",
" ```. `.```. ... ``..```` `",
" ` ` `` .`.`` ..`.``....`.`.`....` .",
" ` ..` `. ..``.`....``....```.....``` `",
" ` `. ``.``.`.````.`.```...`.....``...````",
" ` . ...`,..`..```...``.````. `.```.`` .`",
@TheCulliganMan
TheCulliganMan / Dockerfile
Last active November 24, 2018 00:46
A dockerfile for maker. You must download the GIRI database into the same folder as the dockerfile and rename the database `repeatmaskerlibraries.tar.gz` 🐱
FROM ubuntu:14.04
RUN apt-get update -y
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y openssh-server python-mpi4py python-numpy \
python-virtualenv python-scipy gcc gfortran openmpi-checkpoint binutils
RUN mkdir /var/run/sshd

Tissue Bank Upload

  1. The nginx timeout error:
    • Something is failing to respond...
    • The applicaition doesn't work on heroku, but it also gives the same error on our local servers.
      • The local server is 56 core dual intel xeon processor with 1.5TB of ram, it should be running fast enough.
      • It is runing php 7 (not 5), and homestead in vagrant, which could be a problem, but the app appears to be running fine.
      • I have tried with default nginx and php, and nginx and php with no specified or greatly lengthened timeouts, in both code and setup config.
    • I personally think that aside from the strict input format problems, there is a silent errror with the site model
@TheCulliganMan
TheCulliganMan / chess_moves.py
Created February 21, 2017 21:28
Takes in board configuration in json. returns all possible moves
#/usr/bin/env python
# -*- coding: utf-8 -*-
# Ryan Culligan
import json
class ChessBoard:
"""
Chess Board class
"""
@TheCulliganMan
TheCulliganMan / EloSteps.md
Last active February 6, 2017 16:31
EloRatings Steps

Steps

  1. Save Excel File to *.txt
  • File, Save As, *.txt (MS-DOS)
  • Save to C:\Users\gengraphics\Documents\miguel\elorating\<filename.txt>
  1. Open R Studio
  2. Commands:
library(EloRating)
#!/usr/bin/env python
import os
import subprocess as sp
import multiprocessing
def get_finished():
nexuses = (i for i in os.listdir(os.getcwd()) if i.endswith('.nex'))
for nexus in nexuses:
tree_files = (nexus + '.run{}.p'.format(i) for i in (1, 2))
ll |
grep "Dec 19" |
awk '{ for (i=9; i<=NF; i++) if( $i != $NF ) str = str " " $i; else str = str " " $i "\n"}; END {print str}' |
xargs cat