Skip to content

Instantly share code, notes, and snippets.

View bretonics's full-sized avatar
:octocat:
Decoding the world, one line at a time

Andrés Bretón bretonics

:octocat:
Decoding the world, one line at a time
View GitHub Profile
@bretonics
bretonics / Brewfile
Last active July 25, 2022 02:23
Homebrew and Mac App Assets
tap "brewsci/bio"
tap "brewsci/science"
tap "heroku/brew"
tap "homebrew/autoupdate"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/services"
#!/bin/sh
#
# Adapted from original source: https://bitbucket.org/snippets/atlassian/qedp7d
# Docs: https://git-scm.com/docs/githooks
# git prepare-commit-msg hook for automatically prepending an issue key
# from the start of the current branch name to commit messages.
COMMIT_MSG_FILE=$1 # $1 is the file name containing log message
COMMIT_SOURCE=$2 # $2 is the commit message source (message | template | squash | commit)
@bretonics
bretonics / .shell_colors
Created April 3, 2021 12:43
Shell Color Output Variables
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# COLOR OUTPUT (3/4 bit version)
NC="\033[0m" # Color reset
# Normal (0;)
BLACK="\033[0;30m"
RED="\033[0;31m"
GREEN="\033[0;32m"
YELLOW="\033[0;33m"
BLUE="\033[0;34m"
@bretonics
bretonics / add-sftp-user
Created February 25, 2019 16:35
Automate adding new SFTP chrooted accounts
#!/usr/bin/env bash
# Automate adding new SFTP accounts (chrooted)
# --------------------------------------------------------------------------------
#
if [ $# == 0 ]; then
echo "Usage: add-sftp-user EMAILS "
echo "Automates adding a SFTP user account, delagating all tasks and sending confirmation email."
else
@bretonics
bretonics / disk-usage-alert.cron
Created February 22, 2019 21:03
Available disk usage alert setup to run weekly on crontab
#!/bin/bash
# /etc/cron.weekly/
LIMIT="85"
MAILTO=""
SUBJECT="Disk Usage Alert!"
BODY="WARNING! $(hostname) disk space is currently at ${USED}% capacity."
@bretonics
bretonics / Brewfile
Last active September 11, 2022 14:51
macOS Tips and Tricks
tap "brewsci/bio"
tap "brewsci/science"
tap "heroku/brew"
tap "homebrew/autoupdate"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/services"
@bretonics
bretonics / template.qsub
Last active August 2, 2018 15:02
Template file for Sun Grid Engine (SGE) job submissions
#!/bin/bash -l
# template.qsub - Template file for Sun Grid Engine (SGE) job submissions
# Andrés Bretón, http://andresbreton.com
# Template from https://gist.github.com/bretonics/1dc5d0926aefa7787ebf48a0bad5316b
#-------------------------------------------------------------------------------
# ENVIRONMENTAL VARIABLES AVAILABLE
@bretonics
bretonics / CR_counts.qsub
Last active November 4, 2020 00:51
Template file to run Cell Ranger on Sun Grid Engine (SGE)
#!/bin/bash -l
# cellranger.qsub - A template file to run Cell Ranger on Sun Grid Engine (SGE)
# Andrés Bretón ~ http://andresbreton.com, dev@andresbreton.com
# Template from https://gist.github.com/bretonics/f6c57474bb077d2acd293092cf7fa449#
#-------------------------------------------------------------------------------
# ENVIRONMENTAL VARIABLES AVAILABLE
@bretonics
bretonics / crontab
Last active May 25, 2022 23:20
Crontab template
# Crontab - Crontab template to automate virtual world
# Template from https://gist.github.com/bretonics/9a48a3b9ef32d93d15f45c3f007550b4
# Andrés Bretón ~ http://andresbreton.com, dev@andresbreton.com
# ==============================================================================
# MIN(0-59) HOUR(0-23) DOM(1-31) M(1-12) DOW(0-6) CMD
# |__________|_________|_______|________|______ |__MINUTE of
# |_________|_______|________|______ |__HOUR of
@bretonics
bretonics / .bash_functions
Last active December 15, 2019 22:37
Bash Functions
# .bash_functions - User bash functions
# Template from https://gist.github.com/bretonics/894d8c2d1d4813c36b7d36e9a97aedd6
#-------------------------------------------------------------------------------
# SYSTEM
mkcd() {
mkdir $1; cd $1
}