Skip to content

Instantly share code, notes, and snippets.

@sahilseth
sahilseth / reset_docker,sh
Created October 13, 2015 11:10
in case of issues with kitematic
#!/bin/bash
## https://github.com/kitematic/kitematic/blob/master/util/reset
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
sudo rm -f /usr/local/bin/docker*
pkill VirtualBox
pkill VBox
rm -rf ~/Library/Application\ Support/Kitematic/
@sahilseth
sahilseth / OSX-Convert-MOV-GIF.md
Last active September 5, 2021 22:43 — forked from tskaggs/OSX-Convert-MOV-GIF.md
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

brew install ffmpeg [all your options]
##* Example:
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
@sahilseth
sahilseth / install_tldr.sh
Created October 20, 2015 15:01
how to install tldr
##
brew install llvm --with-clang --with-asan
then
brew install tldr
@sahilseth
sahilseth / fix brew.sh
Last active September 24, 2017 18:49
fix issues with brew
# http://stackoverflow.com/questions/14113427/brew-update-failed
cd $(brew --prefix)
git reset --hard HEAD
# cellar on hpcc cluster
# --prefix=~/.linuxbrew/Cellar
git clean -df
brew update
@sahilseth
sahilseth / issue with
Created October 27, 2015 18:05
issue with dplyr
log2(as.numeric(select(clust, PATC53.377)[1,]) / as.numeric(select(clust, one_of(newrefs))[1,]))
VS
as.numeric(select(clust, PATC53.377)[1,]) / as.numeric(select(clust, one_of(newrefs))[1,]) %>% log2()
@sahilseth
sahilseth / subset_tsv.sh
Last active March 21, 2016 16:54
subset a tsv file using R. In this example, get a list of errored commands in flowr.
# idea is to, first filter based on a condition, and then display the results
Rscript -e 'library(dplyr);params::read_sheet("flow_details.txt") %>% filter(exit_code>0)' | less
# we add select, to show only a few columns:
Rscript -e 'library(dplyr);params::read_sheet("flow_details.txt") %>% filter(exit_code>0) %>% select(jobname, jobnm, num, exit_code, cmd)' | less
# add kable, to show results in a markdown format:
Rscript -e 'library(dplyr);library(params);read_sheet("flow_details.txt") %>% filter(exit_code>0) %>% select(jobname, jobnm, num, exit_code, cmd)%>% kable()' | less
@sahilseth
sahilseth / gtf_add_chr.sh
Created November 3, 2015 18:28
Adding chr to a GTF file
awk '{ if($1 !~ /^#/){print "chr"$0} else{print $0} }' Homo_sapiens.GRCh37.75.gtf
@sahilseth
sahilseth / rscript_cmd.sh
Created November 3, 2015 19:48
Storing output from Rscript
Rscript wrangl_00_run_htseq.R | tee wrangl_00_run_htseq.Rout
@sahilseth
sahilseth / identify_large_files.sh
Last active August 5, 2018 10:07
At times .git folder becomes much larger than the code base, and needs shrinking
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
@sahilseth
sahilseth / graph_rfuncs.R
Created November 6, 2015 05:52
create a plot of functions
# http://www.r-bloggers.com/r-function-of-the-day-foodweb/
#install.packages("mvbutils")
library(mvbutils)
foodweb()