Skip to content

Instantly share code, notes, and snippets.

View skurscheid's full-sized avatar

Sebastian Kurscheid skurscheid

View GitHub Profile
@skurscheid
skurscheid / get_conda_packages.R
Last active April 24, 2020 22:37
Obtain names of R packages in a format compatible for installation via conda
condaPackages <- function(x){
lapply(names(x$otherPkgs), function(y){
if ("git_url" %in% names(x$otherPkgs[[y]])){
repo = "bioconductor-"
} else {
repo = "r-"
}
paste(repo, y, sep ="")
})
}
@skurscheid
skurscheid / gist:5b8aca3bf4c33dc5584bfe7fea34889b
Created June 29, 2018 02:20
GNU parallel - redirect output per job to separate files
parallel md5sum {} ">" {}.md5 ::: *.gz
@skurscheid
skurscheid / getTrueName.c
Created February 5, 2018 23:29
C function to enable bash shells to "cd" into macOS aliases
// getTrueName.c
// http://web.archive.org/web/20100110234300/http://www.macosxhints.com/dlfiles/getTrueName.txt
//
// DESCRIPTION
// Resolve HFS and HFS+ aliased files (and soft links), and return the
// name of the "Original" or actual file. Directories have a "/"
// appended. The error number returned is 255 on error, 0 if the file
// was an alias, or 1 if the argument given was not an alias
//
// BUILD INSTRUCTIONS
@andyrbell
andyrbell / scanner.sh
Last active July 9, 2024 16:43
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@danielecook
danielecook / snakemake.md
Last active June 20, 2016 03:44
Snakemake shortcuts

Rerun rules with code changes.

  snakemake -R `snakemake --list-code-changes`

Rerun rules with any changes

  snakemake -R `snakemake --list-version-changes --list-code-changes --list-input-changes`
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 19, 2024 20:54
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@davidliwei
davidliwei / gtf2bed.py
Created August 18, 2011 23:44
Converting Cufflinks predictions (.GTF) into .BED annotations
#!/usr/bin/env python3
'''
gtf2bed.py converts GTF file to BED file.
Usage: gtf2bed.py {OPTIONS} [.GTF file]
History
Nov.5th 2012:
1. Allow conversion from general GTF files (instead of only Cufflinks supports).
2. If multiple identical transcript_id exist, transcript_id will be appended a string like "_DUP#" to separate.
'''
@zaius
zaius / background.sh
Created January 16, 2011 23:29
How to redirect a running process output to a file and log out
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)