Skip to content

Instantly share code, notes, and snippets.

View keuv-grvl's full-sized avatar

Keuv Grvl keuv-grvl

  • Bordeaux, France
View GitHub Profile
@keuv-grvl
keuv-grvl / svg2png.sh
Last active December 8, 2016 16:28
Convert ./svg/*.svg to ./png/*.png
#!/usr/bin/env bash
command -v inkscape >/dev/null 2>&1 || { echo >&2 "Inkscape is not installed. Aborting."; exit 1; }
# SVG files must be in "./svg/" and PNG files will be outputed in './png/'
echo "starting..."
mkdir -p ./png/
rm ./png/*png
## ./svg/ can contain links to SVG files.
@keuv-grvl
keuv-grvl / set_up_my_ubuntu.sh
Last active September 18, 2015 09:56
Personal Ubuntu (14.04+) setup script
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root." ;
exit 1 ;
fi
#-- little clean up ----------------------------------
apt-get -yqq autoremove software-center landscape-client-ui-install example-content rhythmbox* thunderbird* totem totem-common unity-lens-shopping unity-lens-friends unity-scope-musicstores unity-scope-video-remote ;
@keuv-grvl
keuv-grvl / .zshrc
Last active February 2, 2023 11:27
My .zshrc file, with cool stuff
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
setopt extendedglob
unsetopt autocd
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
@keuv-grvl
keuv-grvl / pandoc.md2pdf.sublime-build
Last active September 23, 2024 16:00
Convert Markdown to PDF within Sublime Text using Pandoc
{
"cmd": ["pandoc --latex-engine=xelatex --filter=pandoc-citeproc -o '$file_base_name.pdf' '$file_name'"],
"selector": "text.html.markdown",
"shell": true
}
@keuv-grvl
keuv-grvl / join_rec.sh
Last active February 3, 2017 17:37
Join multiple files by their first columns
# usage: join_rec file1.tsv file2.tsv file3.tsv file*.tsv
# do not try to join 23k files...
function join_rec {
f1=$1; f2=$2;
shift 2;
if [ $# -gt 0 ]; then
join -a1 -a2 -e 0 -o auto -t$'\t' "$f1" "$f2" | join_rec - "$@" ;
else
join -a1 -a2 -e 0 -o auto -t$'\t' "$f1" "$f2" ;
fi
@keuv-grvl
keuv-grvl / memo.sh
Last active September 18, 2019 15:14
Various tips to write bash scripts
#!/usr/bin/env bash
#-- Set some useful bash options
set -e # this script exits on error
set -o pipefail # a pipeline returns error code if any command fails
set -u # unset variables as an error, and immediately exit
set -x # print each command on STDERR before running it, useful for logging and debugging
set +x # turn off 'set -x'

List of packages from Bioconda

git clone https://github.com/bioconda/bioconda-recipes.git
cd bioconda-recipes/recipes/
ls > ~/bioconda.pkglist

List of packages from Conda-forge

@keuv-grvl
keuv-grvl / maxbin.makefile
Last active January 27, 2017 14:55
makefile for MaxBin 2.2.1 (with help from @Celforyon)
# usage: make -f maxbin.makefile
# Config
DEBUG := 0
BUILDDIR := build
# End config
CXX := g++
CXXFLAGS := -MMD -Wall -Wextra -ansi -pedantic -std=c++11
LDFLAGS := -lpthread
@keuv-grvl
keuv-grvl / generic.cpp.makefile
Created January 27, 2017 13:07
Generic make file to comple C++11 project
# Config
DEBUG := 0
BUILDDIR := build
SOURCEDIR := src
PREFIX :=
# End config
CXX := g++
CXXFLAGS := -fopenmp -MMD -Wall -Wextra -ansi -pedantic -std=c++11
LDFLAGS := -lpthread -lboost_system -fopenmp -Wl,-rpath=$(PREFIX)/lib/
@keuv-grvl
keuv-grvl / gg_color_hue.R
Created September 7, 2017 10:58
Generate a ggplot2 color palette
# generate a ggplot2 color palette
gg_color_hue <- function(n) {
hues = seq(15, 375, length = n + 1)
hcl(h = hues, l = 65, c = 100)[1:n]
}