Skip to content

Instantly share code, notes, and snippets.

View cjohnson496's full-sized avatar

Charles Johnson cjohnson496

View GitHub Profile
@cjohnson496
cjohnson496 / get_modules.sh
Created April 25, 2017 21:33
Script or function listing kernel modules.
#!/bin/bash
. /etc/sysconfig/kernel
for i in $INITRD_MODULES $DOMU_INITRD_MODULES $MODULES_LOADED_ON_BOOT
do
if ! lsmod | grep"^$i[[:space:]]"&>/dev/null; then
echo $i
fi
done; echo
@cjohnson496
cjohnson496 / stop_services.function
Created April 25, 2017 21:35
Function to stop services, useful when chrooting to tmpfs for / filesystem resize, etc.
stop_services() {
echo "Stopping services, it's probably safe to ignore any errors..."
for service in `chkconfig -list | awk '{print$1}' | grep -v ':\|ssh\syslog\|network\|mdadm\|dbus\|cron\|ccproc\|dnsmasq\|kbd'`; do
chkconfig $service off
/etc/init.d/$service stop
echo -n "Disabling and Stoping $service"
done
}
@cjohnson496
cjohnson496 / copy2tmpfs.sh
Created April 25, 2017 21:39
Initial part of script used to copy /bin/bash, /bin/ls, /bin/rpm, along with their libs to JAIL.
#!/usr/bin/env bash
# Setup JAIL location
J=${JAIL:-/var/chroot/jaildir}
# For continuity define JAIL var.
JAIL=$J
mkdir -p $J/{bin,lib64,lib}
ls $J
cp -afv /bin/{bash,ls,rpm} $J/bin
@cjohnson496
cjohnson496 / README-Template.md
Created May 9, 2017 00:23 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@cjohnson496
cjohnson496 / README.md
Last active May 15, 2017 21:30 — forked from hofmannsven/README.md
My simple Git Cheatsheet
@cjohnson496
cjohnson496 / gist:357a8dfba0ada3903e0435d4286a7503
Created May 26, 2017 17:18 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@cjohnson496
cjohnson496 / 1 - Startup
Created September 6, 2017 05:02 — forked from jamestomasino/1 - Startup
Setup for OSX development environment
- Install XCode
- Make your user an admin
- Create SSH keys
$ ssh-keygen
- Upload public key to Assembla & Github
$ cat ~/.ssh/id_rsa.pub | pbcopy
@cjohnson496
cjohnson496 / SVN_Subversion_on_Mac_OS-X.md
Created September 7, 2017 18:30 — forked from ejlp12/SVN_Subversion_on_Mac_OS-X.md
Subversion (SVN) server on Mac (OS-X)

Install SVN

$ brew options subversion
--universal
	Build a universal binary
--with-gpg-agent
	Build with support for GPG Agent
--with-java
	Build Java bindings
--with-perl
@cjohnson496
cjohnson496 / bootstrapNewMac
Created September 22, 2017 02:46 — forked from natelandau/bootstrapNewMac
A bootstrap script to install my dotfiles and configure a new computer
#!/usr/bin/env bash
# This bootstraps installing ssh-keys to github
# set colors
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
ORANGE="$(tput setaf 172)"
else
@cjohnson496
cjohnson496 / .bash_profile
Created September 22, 2017 03:16 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management