Skip to content

Instantly share code, notes, and snippets.

View johnrc's full-sized avatar

John Cragun johnrc

View GitHub Profile
@johnrc
johnrc / jenkins-git-backup.sh
Created February 13, 2017 17:05 — forked from abayer/jenkins-git-backup.sh
Example of a script for backing up Jenkins config in git.
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master
@johnrc
johnrc / repset_mongo.sh
Created July 19, 2016 14:02 — forked from massenz/repset_mongo.sh
Creates and initializes a MongoDb replica set: allows the user to choose the number of members and the starting port number; this should also work on a remote host, but I have only tested it so far on localhost
#!/bin/bash
#
# Starts up a MongoDB replica set
#
# There is a lot of documentation about replica sets:
#
# http://docs.mongodb.org/manual/reference/replica-configuration/
# http://docs.mongodb.org/manual/administration/replica-sets/
#
# To read data from a SECONDARY, when in the client, use:
@johnrc
johnrc / .gitignore
Last active June 6, 2016 16:41 — forked from esamson/.gitignore
systemd service file for sonatype nexus. Put this in `$HOME/.config/systemd/user/nexus.service`. Launch with `systemctl --user start nexus`.
default.target.wants/
nexus
@johnrc
johnrc / watch.sh
Created May 3, 2016 22:02
Command to watch for deleted files in a directory
#!/usr/bin/sh
inotifywait -mr -e delete /some/dir
@johnrc
johnrc / git-rpms.md
Created April 11, 2016 19:38
Steps to create the Git RPMs

Git RPMs

Here are the steps to compile and build the Git RPMs using the git.spec provided by the project:

wget http://kernel.org/pub/software/scm/git/git-2.8.1.tar.gz -P ~/rpmbuild/SOURCES
tar xf ~/rpmbuild/SOURCES/git-2.8.1.tar.gz
cp git-2.8.1/git.spec ~/rpmbuild/SPECS
rm -fr git-2.8.1
# install all dependencies (e.g. yum install  -y)
@johnrc
johnrc / rpm-setup.md
Created March 29, 2016 06:26
Commands to create an rpm

RPM Setup

To compile RPMs do the following:

yum install rpmdevtools
useradd makerpm
rpmdev-setuptree
@johnrc
johnrc / npm-publish-tips.md
Last active February 4, 2016 17:03
Tips for publishing to npm

Windows

On Windows, you normally checkout with crlf line endings. When publishing to npm, you don't want this as it will break on *nix. Here's how to prevent:

git clone -c core.autocrlf=false https://github.com/org/npm-module.git
cd npm-module
# test it
npm pack
npm publish
@johnrc
johnrc / git-fundamentals.md
Last active September 1, 2015 21:42
Git Fundamentals

Setup Git

3 locations for settings files

  • System settings in /etc/gitconfig
  • User settings in ~/.gitconfig
  • Project settings in project/.git/config

Determine what you already have set with

git config --global --list

@johnrc
johnrc / eclipse-marketplace-proxy.md
Last active August 29, 2015 14:21
Eclipse marketplace through proxy

Eclipse Marketplace through Proxy

Note this bug if you keep getting disconnected.

You may need to increase the read timed out as explained here.

@johnrc
johnrc / mac-R-install.R
Created May 11, 2015 16:55
Install R packages on Mac
# You can add the options command to ~/.Rprofile
# By setting the pkgType to mac.binary, it'll use the packages
# in http://cran.r-project.org/bin/macosx/contrib/3.x
options(pkgType="mac.binary", repos="http://cran.company.com")
install.packages(c("acepack", "Rcpp"))