Skip to content

Instantly share code, notes, and snippets.

View gchaix's full-sized avatar
😺

Greg Chaix gchaix

😺
View GitHub Profile
# Detect server type environment and modify prompt
# git prompt settings
export GIT_PS1=1
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWCOLORHINTS=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
# Set the initial prompt. Red prompt if user is root
if [[ ${EUID} == 0 ]] ; then
# $Id: screenrc,v 1.15 2003/10/08 11:39:03 zal Exp $
#
# /etc/screenrc
#
# This is the system wide screenrc.
#
# You can use this file to change the default behavior of screen system wide
# or copy it to ~/.screenrc and use it as a starting point for your own
# settings.
#
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
@gchaix
gchaix / java.env
Last active July 20, 2017 23:29 — forked from logic/java.env
Zookeeper RPM spec for CentOS and Fedora, including python bindings
ZOO_LOG4J_PROP="INFO,ROLLINGFILE"
ZOO_LOG_DIR="/var/log/zookeeper/"
@gchaix
gchaix / nginx-cors.conf
Created April 6, 2017 23:46 — forked from himyouten/nginx-cors.conf
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests

Keybase proof

I hereby claim:

  • I am gchaix on github.
  • I am gchaix (https://keybase.io/gchaix) on keybase.
  • I have a public key ASCECah1aOibvrMVZvHQ9Q90E7b17e66mSy7gcagf1jiQgo

To claim this, I am signing this object:

# git-prompt
export GIT_PS1=1
if [ -f /usr/local/bin/git-prompt.sh ] && [ $GIT_PS1 -ne 0 ]; then
source /usr/local/bin/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWCOLORHINTS=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
#export PS1=${PS1}$(__git_ps1 "\n(%s)\$ ")
if [ "${SERVER_TYPE_PROMPT}" ]; then
PROMPT="${SERVER_TYPE_PROMPT}\[\033]0;\u@\h:$PWD\007\]"
@gchaix
gchaix / zfs-snapshot.sh
Created April 25, 2016 20:00 — forked from ertug/zfs-snapshot.sh
Automatic ZFS Snapshot Rotation
#!/bin/bash
##
# original code: http://andyleonard.com/2010/04/07/automatic-zfs-snapshot-rotation-on-freebsd/
# 07/17/2011 - ertug: made it compatible with zfs-fuse which doesn't have .zfs directories
##
# Path to ZFS executable:
ZFS=/usr/local/sbin/zfs
@gchaix
gchaix / 503.mysql.sh
Created April 25, 2016 19:55 — forked from geoffgarside/503.mysql.sh
FreeBSD periodic/daily script for running MySQL backups
#! /bin/sh
#
# $FreeBSD$
#
# Maintenance shell script to backup mysql databases
# Put this in /usr/local/etc/periodic/daily, and it will be run
# every night
#
# By Geoff Garside <Geoff.Garside at m247.com>, Mon, Jan 24 13:04:18 GMT 2010
#
@gchaix
gchaix / mysql_repl_check.sh
Created April 19, 2016 22:36
mysql replication check script
#!/bin/bash
#--- Configurables ------------------------------------------
# replication delay threshold
TH_SECONDS_BEHIND=5
# notifcation email (if blank, no email will be sent)
EMAIL_ADDR=""
#------------------------------------------------------------