Skip to content

Instantly share code, notes, and snippets.

View MikeDacre's full-sized avatar

Mike Dacre MikeDacre

View GitHub Profile
@MikeDacre
MikeDacre / tmux-server-12371.log
Created July 23, 2015 18:23
tmux -vvvv server log output for Arch Linux machine; fails to execute tpm
server started, pid 12371
cmdq 0x1b73ce0: bind-key C-b send-prefix (client -1)
cmdq 0x1b73ce0: bind-key C-o rotate-window (client -1)
cmdq 0x1b73ce0: bind-key C-z suspend-client (client -1)
cmdq 0x1b73ce0: bind-key Space next-layout (client -1)
cmdq 0x1b73ce0: bind-key ! break-pane (client -1)
cmdq 0x1b73ce0: bind-key " split-window (client -1)
cmdq 0x1b73ce0: bind-key # list-buffers (client -1)
cmdq 0x1b73ce0: bind-key $ command-prompt -I#S "rename-session '%%'" (client -1)
cmdq 0x1b73ce0: bind-key % split-window -h (client -1)
1,74c1,74
< server started, pid 12371
< cmdq 0x1b73ce0: bind-key C-b send-prefix (client -1)
< cmdq 0x1b73ce0: bind-key C-o rotate-window (client -1)
< cmdq 0x1b73ce0: bind-key C-z suspend-client (client -1)
< cmdq 0x1b73ce0: bind-key Space next-layout (client -1)
< cmdq 0x1b73ce0: bind-key ! break-pane (client -1)
< cmdq 0x1b73ce0: bind-key " split-window (client -1)
< cmdq 0x1b73ce0: bind-key # list-buffers (client -1)
< cmdq 0x1b73ce0: bind-key $ command-prompt -I#S "rename-session '%%'" (client -1)
@MikeDacre
MikeDacre / tmux-server-filtered.diff
Last active August 29, 2015 14:25
Diff of functioning and nonfunctioning tpm tmux server logs. Left file (>) is functional, right file (<) is not
75c75
< cmdq set-option -g default-shell /usr/bin/zsh (client -1)
---
> cmdq set-option -g default-shell /afs/ir/users/d/a/dacre/usr/bin/zsh (client -1)
113c113
< cmdq set-environment -g TMUX_PLUGIN_MANAGER_PATH /home/dacre/.tmux/plugins/ (client 11)
---
> cmdq set-environment -g TMUX_PLUGIN_MANAGER_PATH /afs/ir/users/d/a/dacre/.tmux/plugins/ (client 11)
115c115
< cmdq bind-key I run-shell /home/dacre/.tmux/plugins/tpm/scripts/install_plugins.sh >/dev/null 2>&1 (client 11)
@MikeDacre
MikeDacre / nicstat-PKGBUILD.patch
Created August 11, 2015 18:02
Patch for nicstat PKGBUILD from version 1.92 to 1.95
--- nicstat/PKGBUILD 2015-06-14 06:52:34.000000000 -0700
+++ PKGBUILD 2015-08-11 10:56:27.331639326 -0700
@@ -3,7 +3,7 @@
# vim:set ts=2 sw=2 et ft=sh tw=100: expandtab
pkgname=nicstat
-pkgver=1.92
+pkgver=1.95
pkgrel=3
pkgdesc='Network traffic statics utility'
@MikeDacre
MikeDacre / change_indent_length.py
Created December 11, 2012 19:01
Change number of spaces used for indentation in a file, only change spaces at start of file. Made for python, will work with any file.
#!/bin/env python3
#===============================================================================
#
# FILE: change_indent_length.py
#
# USAGE: cange_indent_length.py [-h] file_name old_tab_length new_tab_length
#
# DESCRIPTION: Change indent length, only change those at start of line
#
# AUTHOR: Michael D Dacre, mike.dacre@gmail.com
@MikeDacre
MikeDacre / selective-backup.py
Last active December 14, 2015 07:48
A simple backup program to create a selective backup by duplicating a directory tree with hard links. This allows users to choose only the files they wish backed up. It requires a third party backup solution (e.g. rsync or CrashPlan), to do the actual backup. The script allows users to choose the backup location, and also uses `find` to search t…
#!/bin/env python3
dsript="""\
#===============================================================================
#
# FILE: selective-backup.py
#
# USAGE: ./selective-backup.py [-o] [-l] [-r] file1 [file2]...[folder1...
#
# DESCRIPTION: Duplicate a directory to a given location using only hard links
# REQUIREMENTS: python3
@MikeDacre
MikeDacre / format_alleleseq_output.py
Created December 15, 2015 01:08
Format the output of the alleleseq pipeline into gene and snp level tab-delimited outputs sorted by tissue
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8 tabstop=4 expandtab shiftwidth=4 softtabstop=4
"""
#============================================================================#
# #
# AUTHOR: Michael D Dacre, mike.dacre@gmail.com #
# ORGANIZATION: Stanford University #
# LICENSE: MIT License, property of Stanford, use as you wish #
# CREATED: 2015-12-13 10:07 #
@MikeDacre
MikeDacre / std-arg.py
Last active December 21, 2015 17:59
Cumbersome python3 functions to give user the choice between either using STDIN, STDOUT, STDERR, or using -i, -o, and -l. The idea is that we want to use the protection of a `with"` statement if using the '-i' and '-o' flags for input and output files, while still allowing the use of STDIN and STDERR. It makes use of sys and argparse. It is cumb…
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8 tabstop=4 expandtab shiftwidth=4 softtabstop=4
"""
#====================================================================================
#
# FILE: std-arg.py
# AUTHOR: Michael D Dacre, mike.dacre@gmail.com
# LICENSE: Open Source
# CREATED: 2013-08-26 10:56
@MikeDacre
MikeDacre / vcf_simplify.py
Last active January 4, 2016 04:28
Simplify a 1000genomes vcf file to a smaller file with all genotypes encoded as 0/1/2, where 0: homozygote 1; 1: heterozygote; 2:homozygote 2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8 tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# Copyright © Mike Dacre <mike.dacre@gmail.com>
#
# Distributed under terms of the MIT license
"""
===============================================================================
@MikeDacre
MikeDacre / bed2vcf.py
Last active January 8, 2016 21:29
Convert simplified bed file(s) plus a reference genome into a vcf file. Formats in source.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Distributed under terms of the MIT license
"""
================================================================================
FILE: bed2vcf (python 3)
AUTHOR: Michael D Dacre, mike.dacre@gmail.com
ORGANIZATION: Stanford University
LICENSE: MIT License, Property of Stanford, Use as you wish