Skip to content

Instantly share code, notes, and snippets.

@mralexjuarez
mralexjuarez / ohq.sh
Last active June 25, 2019 17:30
A work-in-progress one hitter quitter install script for Open edX
## A One Hitter Quitter Script to Setup Open edX
## Variables
export CONFIG_DIR="/opt/edx"
export OPENEDX_RELEASE=open-release/ironwood.master
## Usage for the ohq
if [ -z $1 ]; then
echo "Usage: $0 <LMS DOMAIN NAME>"
exit 1
fi
## Place the following in to ~/.bashrc
w4hoami="$(whoami)@$(echo $SSH_CONNECTION | awk '{print $1}')"export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local6.debug "$whoami [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[ ]*//" ) [$RETRN_VAL]"'
## Place the following under /etc/rsyslog.d/bash.conf
local6.* /var/log/commands.log # Log commands to /var/log/commands
@mralexjuarez
mralexjuarez / Lsyncd Technical Session.md
Last active May 29, 2024 12:18
Quick Tutorial on Using Lsyncd

Lsyncd Technical Session

So what is lsyncd?

Lsyncd is a tool used to keep a source directory in sync with other local or remote directories. It is a solution suited keeping directories in sync by batch processing changes over to the synced directories.

When would we use lsyncd?

So the generic use case is to keep a source directory in sync with one or more local and remote directories.

Vagrant Introduction

The problem: I need to test something or learn something new and it takes too long to get a clean machine up and running.

The problem: Well it works on MY machine. Why not yours?

On their site their tag line is "Create and configure lightweight, reporducible, and portable development environments."

On their site they show it is this easy to get started.

@mralexjuarez
mralexjuarez / ansible-roles-oneliner
Created July 4, 2014 07:20
One-Liner to Create Ansible roles directory structure.
mkdir -p tasks handlers templates files vars meta ; touch tasks/main.yml handlers/main.yml vars/main.yml meta/main.yml
@mralexjuarez
mralexjuarez / .vimrc
Last active February 10, 2017 23:54
My standard .vimrc file
"" General
set number " Show line numbers
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=+++ " Wrap-broken line prefix
set textwidth=100 " Line wrap (number of cols)
set showmatch " Highlight matching brace
set hlsearch " Highlight all search results
set smartcase " Enable smart-case search
set ignorecase " Always case-insensitive