Skip to content

Instantly share code, notes, and snippets.

View dillondaudert's full-sized avatar
💭
!!

Dillon Daudert dillondaudert

💭
!!
View GitHub Profile
@dillondaudert
dillondaudert / cronnotes.md
Last active July 9, 2020 16:11
Delete old files from /tmp at regular intervals using cron

Deleting files from /tmp

In this case, I wanted to delete files from /tmp that weren't being removed automatically because the process that created them took a long time to terminate. The following command deletes all files suffixed in .partd, as well as any files in folders suffixed by .partd (what I wanted - note the -type f flag means files only, so not directories) which were last accessed more than 30 minutes ago. The flag -amin +30 indicates last accessed more than 30 minutes ago, and -delete means delete the files found.

find /tmp/*.partd -amin +30 -type f -delete

Creating a basic cron job

@dillondaudert
dillondaudert / atomics.jl
Last active November 20, 2019 17:37
Atomic{Ptr}
# atomic operations for pointers. for test development purposes
import Base.Sys: WORD_SIZE
using Core.Intrinsics: llvmcall
using Base.Threads: llvmtypes, AtomicTypes
mutable struct MyAtomic{V<:Ptr}
value::V
end
@dillondaudert
dillondaudert / startup.jl
Last active October 23, 2019 17:44
Julia REPL startup: OhMyREPL.jl Solarized color theme
atreplinit() do repl
try
@eval using Crayons
@eval import OhMyREPL: Passes.SyntaxHighlighter
@eval function solarized_colorscheme()
# solarized crayons
base03 = crayon"#002b36"
base02 = crayon"#073642"
base01 = crayon"#586e75"
base00 = crayon"#657b83"
@dillondaudert
dillondaudert / parse_dssp.py
Last active February 14, 2018 04:07
Parse DSSP files into csv files using multiprocessing and pandas
# NOTE: This requires the DSSPData class shown in this gist: https://gist.github.com/jlhg/5181883
import os
import pandas as pd
from multiprocessing import Process, Queue
from DSSPData import DSSPData
datapath = "/path/to/dssp/data/"
def _parse(filename):
'''Parse a single .dssp file and return its properties.