-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
Conflicts: git/gitconfig keychain/util/keychain/ssh-agent.sh keychain/zsh/profile.d/keychain.sh manifest.rb rbenv/zsh/profile.d/rbenv.sh tmux/tmux.conf tools/bin/histogram tools/bin/notes tools/bin/tabulate vim/vim/ftdetect/javascript.vim vim/vim/ftdetect/markdown.vim vim/vim/plugin/syntax-tools.vim vim/vimrc vundle/vundle.vim zsh/zprofile zsh/zshenv zsh/zshrc
- Loading branch information
Showing
61 changed files
with
4,419 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Toolkit Packages | ||
================ | ||
|
||
This is a set of public packages for | ||
[toolkit](https://github.com/greglook/toolkit). These packages contain | ||
widely-used configuration (commonly known as 'dotfiles') and various utility | ||
scripts I've written over the years. | ||
|
||
License | ||
------- | ||
This is free and unencumbered software released into the public domain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# ~/.bash_profile | ||
# This file is sourced by bash for login shells. | ||
|
||
# source the system-wide bashrc | ||
[[ -f /etc/bash/bashrc ]] && source /etc/bash/bashrc | ||
[[ -f /etc/bashrc ]] && source /etc/bashrc | ||
|
||
# source the user's bashrc | ||
[[ -f ~/.bashrc ]] && source ~/.bashrc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# ~/.bashrc | ||
# This file is sourced by bash for all interactive shells. | ||
|
||
# test for interactive shell. | ||
[[ $- != *i* ]] && return | ||
|
||
# add ~/bin to $PATH | ||
[[ -d $HOME/bin ]] && export PATH="$HOME/bin:$PATH" | ||
|
||
# ls with color | ||
alias ls='ls --color=tty' | ||
|
||
# ignore common commands in history | ||
export HISTIGNORE=$'[ \t]*:&:[fb]g:exit:ls' | ||
|
||
# make bash history play nicely with multiple terminals | ||
shopt -s histappend | ||
|
||
# set command prompt | ||
if [[ $USER == "root" ]]; then | ||
export PS1="\[\033[01;31m\]\h \[\033[01;34m\]\W #\[\033[00m\] " | ||
else | ||
export PS1="\[\033[01;32m\]\u\[\033[01;34m\]@\[\033[01;31m\]\h \[\033[01;34m\]\W \$\[\033[00m\] " | ||
fi | ||
|
||
# update terminal title and bash history whenever the prompt is displayed | ||
#export PROMPT_COMMAND='echo -ne "\033]2;${USER}@${HOSTNAME}: ${PWD}\007" && history -a' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
BoldAsFont=yes | ||
Font=Consolas | ||
FontHeight=10 | ||
Locale=en_US | ||
Charset=UTF-8 | ||
CursorType=block | ||
Term=xterm-256color | ||
Columns=120 | ||
Rows=36 | ||
CopyAsRTF=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/sh | ||
|
||
# Ensure that the user is root. | ||
if [[ $USER -ne "root" ]]; then | ||
echo "Must be root to install a new kernel!" | ||
exit 1 | ||
fi | ||
|
||
# Kernel artifacts. | ||
SRC_DIR="/usr/src/linux" | ||
KERNEL_CONFIG=$SRC_DIR/.config | ||
KERNEL_IMAGE=$SRC_DIR/arch/i386/boot/bzImage | ||
|
||
if [[ ! -f "$KERNEL_CONFIG" ]]; then | ||
echo "Kernel has not been configured!" | ||
exit 1 | ||
fi | ||
|
||
# Parse kernel version from config file. | ||
KERNEL_VERSION=$(head $KERNEL_CONFIG | grep -m 1 -i 'kernel' | grep -o -P '\d+\.\d+\.\d+\-\w+(\-r\d+)?') | ||
if [[ -z $KERNEL_VERSION ]]; then | ||
echo "Could not determine kernel version!" | ||
exit 1 | ||
fi | ||
|
||
# Build kernel. | ||
echo "Building kernel $KERNEL_VERSION..." | ||
cd $SRC_DIR && make | ||
|
||
if [[ $? != 0 || ! -f "$KERNEL_IMAGE" ]]; then | ||
echo "Error building kernel!" | ||
exit 1 | ||
fi | ||
|
||
# Determine size of artifacts. | ||
ARTIFACT_SIZE=$(ls -sL1 $KERNEL_CONFIG $KERNEL_IMAGE | awk '{ SIZE += $1 } END { print SIZE }') | ||
echo "Built kernel image and config occupying $ARTIFACT_SIZE blocks" | ||
|
||
# Boot directory configuration. | ||
BOOT_DIR="/boot" | ||
BOOT_PARTITION=$(grep $BOOT_DIR /etc/fstab | awk '{ print $1 }') | ||
|
||
# Mount boot if needed. | ||
if [[ -n $BOOT_PARTITION ]]; then | ||
if [[ -z $(mount | grep $BOOT_PARTITION) ]]; then | ||
echo "Mounting boot partition $BOOT_PARTITION..." | ||
mount $BOOT_PARTITION | ||
else | ||
echo "$BOOT_PARTITION is already mounted" | ||
fi | ||
|
||
# Check boot filesystem usage. | ||
BOOT_FREE=$(df $BOOT_PARTITION | tail -n 1 | awk '{ print $4 }') | ||
echo "Boot partition $BOOT_PARTITION has $BOOT_FREE blocks available" | ||
if [[ $BOOT_FREE -le $ARTIFACT_SIZE ]]; then | ||
echo "WARNING: $BOOT_PARTITION does not have enough space for kernel artifacts!" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Copy kernel image and config file. | ||
echo "Copying kernel artifacts..." | ||
cp $KERNEL_CONFIG $BOOT_DIR/config-$KERNEL_VERSION | ||
cp $KERNEL_IMAGE $BOOT_DIR/kernel-$KERNEL_VERSION | ||
|
||
# Regenerate grub2 configuration. | ||
grub2-mkconfig -o /boot/grub/grub.cfg | ||
|
||
# Unmount boot if needed. | ||
if [[ -n $BOOT_PARTITION ]]; then | ||
echo "Unmounting $BOOT_PARTITION..." | ||
umount $BOOT_PARTITION | ||
fi | ||
|
||
# Install built kernel modules. | ||
echo "Installing modules..." | ||
cd $SRC_DIR && make modules_install | ||
if [[ $? != 0 ]]; then | ||
echo "Error installing kernel modules!" | ||
exit 1 | ||
fi | ||
|
||
# Re-emerge packages with modules. | ||
echo "Recompiling module-dependent packages..." | ||
emerge @module-rebuild | ||
|
||
echo "Done installing new kernel!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# use current kernel version if none provided | ||
KERNEL=${1:-$(uname -r)} | ||
|
||
find /lib/modules/$KERNEL/ -type f -iname '*.o' -or -iname '*.ko' | ruby -lne 'puts $1 if /^(?:\/[^\/]+){3}\/(.+)\.k?o$/' | sort |
Oops, something went wrong.