Skip to content

Instantly share code, notes, and snippets.

View johnrc's full-sized avatar

John Cragun johnrc

View GitHub Profile
@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"))
@johnrc
johnrc / youtube-dl.md
Last active August 29, 2015 14:19
Youtube downloader

How to install

pip install youtube-dl

To download best quality

List the formats available:

youtube-dl -F <youtube url>

Download a specific format based on a number above

@johnrc
johnrc / remote_access.ps1
Last active April 12, 2017 14:30
Powershell commands to remote access a computer
# Get credentials for the box
$credentials = (Get-Credential)
# If above doesn't work do
$password = ConvertTo-SecureString "password" -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential ("username", $password)
Enter-PSSession -ComputerName <computername> -Credential $credentials
# Remove an item