Browse Source

Use custom oh-my-zsh plugins for clamav and fbsd

master
Shawn Webb 7 years ago
parent
commit
f4c39cf755
6 changed files with 16 additions and 74 deletions
  1. +1
    -0
      .gitignore
  2. +0
    -7
      env.sh.clamav
  3. +0
    -56
      env.sh.freebsd
  4. +0
    -2
      env.sh.osx
  5. +10
    -4
      setup.zsh
  6. +5
    -5
      zshrc.templ

+ 1
- 0
.gitignore View File

@@ -1,2 +1,3 @@
env.sh
*.swp
zshrc

+ 0
- 7
env.sh.clamav View File

@@ -1,7 +0,0 @@
clam=${HOME}/clamav/clamav-devel

alias sigtool='$(echo ${clam}/sigtool/sigtool)'
alias clamscan='$(echo ${clam}/clamscan/clamscan)'
alias clamd='$(echo ${clam}/clamd/clamd)'
alias clamdcscan='$(echo ${clam}/clamdscan/clamdscan)'
alias clamdtop='$(echo ${clam}/clamdtop/clamdtop)'

+ 0
- 56
env.sh.freebsd View File

@@ -1,56 +0,0 @@
makejobs=7

# Package management
alias pkgv="pkg version '-vIl<'"
alias pkgup="sudo portmaster -awD --no-confirm"

# Kernel/world building
alias fbsdbuild="(cd /usr/src; make -sj${makejobs} buildworld buildkernel KERNCONF=SEC)"

function zsnap() {
mydate=$(date '+%F_%T')

for dataset in ${@}; do
sudo zfs snapshot ${dataset}@${mydate}
if [ ! ${?} -eq 0 ]; then
echo "[-] Could not snapshot ${dataset}@${mydate}. Return value: ${?}"
return 1
fi
done

return 0
}

function fbsdinstall() {
DESTDIR=/
if [ ${#1} -gt 0 ]; then
DESTDIR=${1}
fi

zsnap $(zfs get -H -o value name ${DESTDIR})
if [ ! ${?} -eq 0 ]; then
return 1
fi

(
cd /usr/src
if [ ! ${?} -eq 0 ]; then
echo "[-] Could not change directory to the src tree"
return 1
fi

sudo make -s installkernel KERNCONF=SEC DESTDIR=${DESTDIR}
if [ ! ${?} -eq 0 ]; then
echo "[-] Could not install the kernel to ${DESTDIR}"
return 1
fi

sudo make -s installworld DESTDIR=${DESTDIR}
if [ ! ${?} -eq 0 ]; then
echo "[-] Could not install world to ${DESTDIR}"
return 1
fi
)

return 0
}

+ 0
- 2
env.sh.osx View File

@@ -1,3 +1 @@
#!/usr/bin/env zsh

export PATH=$PATH:/Users/shawn/Downloads/android/dev/android-sdk-macosx/platform-tools:/opt/local/bin:/opt/local/sbin

setup_freebsd.sh → setup.zsh View File

@@ -1,9 +1,9 @@
#!/bin/sh

cd ~
#!/usr/bin/env zsh

GIT=$(which git)

cd ~

rm -f .profile
rm -f .tmux.conf
rm -f .zshrc
@@ -20,9 +20,15 @@ if [ ! -d .vim ] && [ ! ${#GIT} -eq 0 ] || [ ! -f .vimrc ] ; then
)
fi

if [ ! -d .oh-my-zsh ]; then
git clone git://github.com/lattera/oh-my-zsh.git .oh-my-zsh
fi

sed "s,__PLUGINS__,${1}," ~/dotfiles/zshrc.templ > ~/dotfiles/zshrc

ln -s ~/dotfiles/.freebsd_profile .profile
ln -s ~/dotfiles/.tmux.conf .tmux.conf
ln -s ~/dotfiles/.zshrc .zshrc
ln -s ~/dotfiles/zshrc .zshrc

if [ ! -d tmux/logs ]; then
mkdir -p tmux/logs

.zshrc → zshrc.templ View File

@@ -29,7 +29,11 @@ ZSH_THEME="clean"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=()
plugins=(__PLUGINS__)

if [ -f $HOME/dotfiles/env.sh ]; then
source $HOME/dotfiles/env.sh
fi

source $ZSH/oh-my-zsh.sh

@@ -42,8 +46,4 @@ function paste() {
PROMPT='%{$fg[$NCOLOR]%}%B%m[%n]%b%{$reset_color%}:%{$fg[blue]%}%B%d%b%{$reset_color%}%(?.. (%{$fg[red]%}%?%{$reset_color%}%)) %(!.#.$) '
export EDITOR=vim

if [ -f $HOME/dotfiles/env.sh ]; then
source $HOME/dotfiles/env.sh
fi

say() { if [[ "${1}" =~ -[a-z]{2} ]]; then local lang=${1#-}; local text="${*#$1}"; else local lang=${LANG%_*}; local text="$*";fi; mplayer "http://translate.google.com/translate_tts?ie=UTF-8&tl=${lang}&q=${text}" &> /dev/null ; }

Loading…
Cancel
Save