Skip to content

Instantly share code, notes, and snippets.

@rbf
rbf / bash_aliases
Last active June 28, 2021 18:10
Enhanced Terminal Prompt for Mac OS X (keywords: bash, shell)
# Repeat a command N times
# From: http://www.stefanoforenza.com/how-to-repeat-a-shell-command-n-times/
repeat() {
n=$1
shift
while [ $(( n -= 1 )) -ge 0 ]
do
"$@"
done
@rbf
rbf / .gitconfig
Last active January 6, 2022 12:28
Useful configuration file for git including common aliases — **THIS GIST IS UNMAINTAINED AND ITS CONTENTS HAS BEEN MOVED TO THE FOLLOWING REPO** https://github.com/rbf/dotfiles/blob/master/git/.gitconfig
###################################################################################
# THIS GIST IS UNMAINTAINED AND ITS CONTENTS HAS BEEN MOVED TO THE FOLLOWING REPO #
# https://github.com/rbf/dotfiles/blob/master/git/.gitconfig #
###################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2012-2018 https://gist.github.com/rbf
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
@rbf
rbf / .gitignore_global
Last active September 13, 2019 13:49
Global git ignore file for compiled source, packages, logs and databases, vim swap files, Mac OS generated files, Xcode, clojure with leiningen and LaTeX projects. **THIS GIST IS UNMAINTAINED AND ITS CONTENTS HAS BEEN MOVED TO THE FOLLOWING REPO** https://github.com/rbf/dotfiles/blob/master/git/.gitignore
###################################################################################
# THIS GIST IS UNMAINTAINED AND ITS CONTENTS HAS BEEN MOVED TO THE FOLLOWING REPO #
# https://github.com/rbf/dotfiles/blob/master/git/.gitignore #
###################################################################################
# To download and add this file to your global git config, run the following command:
# if [ -f /etc/gitignore_global ]; then cp -v /etc/gitignore_global /etc/gitignore_global.backup_$(date +"%Y%m%d%H%M%S"); fi; curl -L https://gist.github.com/rbf/2224744/raw/.gitignore_global -o /etc/gitignore_global; git config --system core.excludesfile /etc/gitignore_global
# if [ -f ~/.gitignore_global ]; then cp -v ~/.gitignore_global ~/.gitignore_global.backup_$(date +"%Y%m%d%H%M%S"); fi; curl -L https://gist.github.com/rbf/2224744/raw/.gitignore_global -o ~/.gitignore_global; git config --global core.excludesfile ~/.gitignore_global
# Original from: http://help.github.com/ignore-files/
@rbf
rbf / gist:3181725
Created July 26, 2012 12:19
Get leiningen
# Following instruction from http://leiningen.org/
# Download the 2.x preview release, which is recommended as of 26jul2012, to your $PATH (here using /usr/local/bin)
sudo curl -L -o '/usr/local/bin/lein' 'https://raw.github.com/technomancy/leiningen/preview/bin/lein'
# For the 1.x stable release run instead:
sudo curl -L -o '/usr/local/bin/lein' 'https://raw.github.com/technomancy/leiningen/stable/bin/lein'
# Set it to be executable
sudo chmod a+x /usr/local/bin/lein
@rbf
rbf / .vimrc
Last active October 9, 2021 20:08
My vimrc config
" Installation notes:
" 1. Download this .vimrc with 'curl -sSL rbf.li/vimrc -o .vimrc'
" 2. Install Pathogen, see https://github.com/tpope/vim-pathogen#installation
" 3. Install the solarized theme, see https://github.com/altercation/vim-colors-solarized#option-2-pathogen-installation-recommended
" 4. Enjoy
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
@rbf
rbf / .tmux.conf
Last active October 9, 2021 19:31
tmux config file
# To download and install this file to your home folder run the following command:
# cp -v ~/.tmux.conf ~/.tmux.conf.backup_$(date +"%Y%m%d%H%M%S"); curl https://gist.githubusercontent.com/rbf/3529029/raw/.tmux.conf -o ~/.tmux.conf
# To download and install this file for all users run the following command:
# cp -v /etc/tmux.conf /etc/tmux.conf.backup_$(date +"%Y%m%d%H%M%S"); curl https://gist.githubusercontent.com/rbf/3529029/raw/.tmux.conf -o /etc/tmux.conf
# The command 'reattach-to-user-namespace' allow to use tools like 'pbcopy' or 'subl .' within tmux.
# SOURCE: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/Usage.md#cross-platform-conditional-usage
if-shell '[ -z "${C9_USER}" ]' "set-option -g default-command 'command -v reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace -l \"$SHELL\" || exec \"$SHELL\"'"
@rbf
rbf / install-cassandra.sh
Created October 9, 2012 14:58
Install Cassandra
#!/bin/bash
# Run this script directly with:
# bash <(curl -sSL https://raw.github.com/gist/3859355/install-cassandra.sh)
CASSANDRA_FILE_NAME="apache-cassandra"
CASSANDRA_VERSION="${1:-1.1.5}" # By default install 1.1.5, the last stable release as of 09oct2012
CASSANDRA_DIR=$CASSANDRA_FILE_NAME-$CASSANDRA_VERSION
CASSANDRA_TARBALL_NAME=$CASSANDRA_DIR-bin.tar.gz
@rbf
rbf / install-opscenter.sh
Created October 11, 2012 12:58
Install OpsCenter from DataStax
#!/bin/bash
# Run this script directly with:
# bash <(curl -sSL https://raw.github.com/gist/3872107/install-opscenter.sh)
OPSCENTER_NAME="opscenter"
OPSCENTER_TARBALL_NAME="$OPSCENTER_NAME.tar.gz"
echo
echo "Installing OpsCenter (last stable version)"
@rbf
rbf / README.md
Last active May 17, 2016 13:05
Bash script to (re)create a set of issue labels in a GitHub repo at once.

Description

Bash script to (re)create a set of issue labels in a GitHub repo at once. This is very handy when we want to replicate a set of labels every time we create a new repo. The repo can be public or private, and belonging to your user or to an organisation your user belongs to.

_Note: The script aims also to be one example of bash

@rbf
rbf / install-subl-config.sh
Created July 22, 2013 14:55
Capture config for Sublime Text 2 into Dropbox, or install it to the current user if already captured.
#!/bin/sh
# The MIT License (MIT)
#
# Copyright (c) 2013 https://gist.github.com/rbf
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of