From 0fd6e855bf6e432a136508babd6f69cf459a2d92 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Wed, 21 Sep 2016 01:22:14 +0200 Subject: [PATCH] Need to work on install script --- bash_files | 1 + bashrc | 27 ++++++++++++++++++++++++++ bin/miclisten | 2 ++ bin/micsend | 2 ++ bin/pdf2txt | 9 +++++++++ bin/queue | 11 +++++++++++ bin/upload-dir | 39 ++++++++++++++++++++++++++++++++++++++ bin/upload-dir-to-marietje | 1 + install.sh | 34 +++++++++++++++++++++++++++++++++ ssh/known_hosts | 8 ++++++++ ssh/ssh | 1 + tmux.conf | 37 ++++++++++++++++++++++++++++++++++++ vim/.netrwhist | 5 +++++ vimrc | 25 ++++++++++++++++++++++++ 14 files changed, 202 insertions(+) create mode 160000 bash_files create mode 100644 bashrc create mode 100755 bin/miclisten create mode 100755 bin/micsend create mode 100755 bin/pdf2txt create mode 100755 bin/queue create mode 100755 bin/upload-dir create mode 120000 bin/upload-dir-to-marietje create mode 100755 install.sh create mode 100644 ssh/known_hosts create mode 120000 ssh/ssh create mode 100644 tmux.conf create mode 100644 vim/.netrwhist create mode 100644 vimrc diff --git a/bash_files b/bash_files new file mode 160000 index 0000000..f7b5d45 --- /dev/null +++ b/bash_files @@ -0,0 +1 @@ +Subproject commit f7b5d451634841505d2b84b4beb2bfb465425bc8 diff --git a/bashrc b/bashrc new file mode 100644 index 0000000..4fe2e17 --- /dev/null +++ b/bashrc @@ -0,0 +1,27 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if [ -f /etc/bash_completion ] && ! shopt -oq posix; then + . /etc/bash_completion +fi + +BASHFOLDER=~/.bash_files +if [ -d "$BASHFOLDER" ]; then + for f in $BASHFOLDER/*.active; + do + source "$f"; + done +else + echo "BASHFOLDER (${BASHFOLDER}) Not Found!"; +fi diff --git a/bin/miclisten b/bin/miclisten new file mode 100755 index 0000000..7460238 --- /dev/null +++ b/bin/miclisten @@ -0,0 +1,2 @@ +#! /bin/sh +ssh $@ 'arecord -f cd -t raw | oggenc - -r' | mplayer - diff --git a/bin/micsend b/bin/micsend new file mode 100755 index 0000000..017139b --- /dev/null +++ b/bin/micsend @@ -0,0 +1,2 @@ +#! /bin/sh +arecord -f cd -t raw | oggenc - -r | ssh $@ mplayer - diff --git a/bin/pdf2txt b/bin/pdf2txt new file mode 100755 index 0000000..03f312b --- /dev/null +++ b/bin/pdf2txt @@ -0,0 +1,9 @@ +#! /bin/bash +pdftotext $1 - + +## Function for diffing pdf's for git +# in ~/.gitconfig add +## [diff "pdf"] +## textconv = pdf2txt +# in repo's .gitattributes add +## *.pdf diff=pdf diff --git a/bin/queue b/bin/queue new file mode 100755 index 0000000..4884307 --- /dev/null +++ b/bin/queue @@ -0,0 +1,11 @@ +#!/bin/sh +LIST="" +for arg in $@; do + if [ -f "$arg" ]; then + LIST="$LIST"$'\n'"$(cat "$arg")" + else + LIST="$LIST"$'\n'"$arg" + fi +done; +echo "$LIST" | shuf | marietje +unset LIST diff --git a/bin/upload-dir b/bin/upload-dir new file mode 100755 index 0000000..2757d19 --- /dev/null +++ b/bin/upload-dir @@ -0,0 +1,39 @@ +#!/bin/sh + +tmp_file="./tmp_list"; +com="upload-to-marietje" +remove="n"; + +trap "echo Aborted!; exit;" INT TERM + +if [ ! -f "$tmp_file" ]; then + touch $tmp_file; +fi + +echo "###$(date) - $(id -u -n)" >> $tmp_file; + +for f in ./*; do + name=${f##*/} + if [ "$name" = "$0" ]; then continue + elif [ "$name" = "$tmp_file" ]; then continue + fi + + echo "$com $f"; +# echo | + $com "$f"; + if [ "$?" = "0" ]; then + echo "$f" >> $tmp_file; + fi +done + +if [ "y$remove" = "yy" ]; then + while read p; do + if [[ "$p" == "###"* ]]; then + break + fi + + rm -v \"$p\"; + done < tac "$tmp_file"; +fi + +echo "It's Done!!"; diff --git a/bin/upload-dir-to-marietje b/bin/upload-dir-to-marietje new file mode 120000 index 0000000..00c0112 --- /dev/null +++ b/bin/upload-dir-to-marietje @@ -0,0 +1 @@ +upload-dir \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..05ba484 --- /dev/null +++ b/install.sh @@ -0,0 +1,34 @@ + +BASE="$HOME/.dotfiles" +BAKSUFFIX=".old" + +symlink() +{ + local COMMAND='ln -s ' + [ $# -lt 2 ] && return 1 + + [ $# -gt 2 ] && [ "$3" = "-c" -o "$3" = "--copy" ] $COMMAND = 'echo "cp -r" ' + + if [ ! -h $2 ]; then + echo "MOVING mv \"$2\" \"$2$BAKSUFFIX\" " + fi + + + $COMMAND "$1" "$2" +} + + +# bash +symlink "${BASE}/bashrc" ~/.bashrc +symlink "${BASE}/bash_files/" ~/.bash_files + +# vim +symlink "${BASE}/vimrc" ~/.vimrc +symlink "${BASE}/vim/" ~/.vim + +# tmux +symlink "${BASE}/tmux.conf" ~/.tmux.conf + +# ssh +symlink "${BASE}/ssh/" ~/.ssh + diff --git a/ssh/known_hosts b/ssh/known_hosts new file mode 100644 index 0000000..d2adb97 --- /dev/null +++ b/ssh/known_hosts @@ -0,0 +1,8 @@ +deboone.nl,77.164.84.209 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM3EGmy4OmHna1Uc4rgGKwN5V3Q+HoRBLy/tupM00+jJXc5lHwSvQl/aT+tQpl7XUGiXngh7bk3Oe4sZh7HWCbY= +lilo.science.ru.nl,131.174.30.57 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9awcChQ7EDElJ/hwef2QRDsfvnFouo8WiJD+K3Vy4anfk9a4kQ3Ak8LleN3PS/IP7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fqWD/7B08FyJi3nH4+IV638UAezsPkoPV4Ao8Vwo6X22M4MxmbpGJXIHMWiwdb++zVpaCC5nThPaUMZLAIgEj4RLDke5E1n5ZCTMYwyw1e6pMeCKCZAdfK6IAd7t1nklvr7iLelKkOH4bJgpTKFCW2+BZQ9MR5v4IAZuDK70KK7Y/h4G+oIDwrI0P+g9qkauV2f6+K3gFBundpb6doOQclI9s2dFGYrG29dxE8pcDU7xucrCDzYUVDnJ+SRPtcqle3wlgMNqJ4PPvmuADZmcglbGuuxgWc2Vn6hqaQWGG9LkIRCUd8OtLwjZ23rWJZUyzzwnSf9Ap+iziw== +seaforth.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMPosqtPxx9vN1zY2vAt9zDf6O3NEGvZ253P+gs3ulZWje5bcGycQ/5CS5XW9PRQSHxFZyFYHLnZzqeAhYXAVwQ= +walter.marie-curie.nl,131.174.31.27 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEMpLrg7O3s1kMZmSyhie7ja6OPSqJTUtTsfRQsdUslFd8vlB9dvdMAY0LYHXCJR0/j42OY7UYCOmBjdHOnbxLA= diff --git a/ssh/ssh b/ssh/ssh new file mode 120000 index 0000000..f62e845 --- /dev/null +++ b/ssh/ssh @@ -0,0 +1 @@ +/home/edeboone/.dotfiles/ssh \ No newline at end of file diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..77d76a9 --- /dev/null +++ b/tmux.conf @@ -0,0 +1,37 @@ +# use ^b as prefix +set -g prefix C-b + +# bind-key C-a last-window + +# force a reload of the config file +unbind r +bind r source-file ~/.tmux.conf\; display "Reloaded!" + +# start window numbering at 1 for easier switching +set -g base-index 1 + +# vim shortcuts +setw -g mode-keys vi + +# commands +bind : command-prompt + +# colors +set -g default-terminal "screen-256color" + +# unicode +setw -g utf8 on +set -g status-utf8 on + +# use PREFIX | to split window horizontally and PREFIX - to split vertically +bind | split-window -h +bind - split-window -v + +# status bar config +set -g status-left "#h" +set -g status-left-length 70 +set -g status-right "%a %d-%m-%y :: %H:%M" +#set -g status-right '♪ #(exec amixer get Master | egrep -o "[0-9]+%" | egrep -o "[0-9]*") | ♥#(acpi | cut -d ',' -f 2) | %a %m-%d %H:%M' + + + diff --git a/vim/.netrwhist b/vim/.netrwhist new file mode 100644 index 0000000..8242f59 --- /dev/null +++ b/vim/.netrwhist @@ -0,0 +1,5 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =3 +let g:netrw_dirhist_1='/home/edeboone/Documents/SpaceAstronomy/1516' +let g:netrw_dirhist_2='/home/edeboone/Documents/SpaceAstronomy/1516/p3' +let g:netrw_dirhist_3='/home/edeboone/Documents/SpaceAstronomy/1516/p3/a' diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..a2798bb --- /dev/null +++ b/vimrc @@ -0,0 +1,25 @@ +" Switch syntax highlighting on, when the terminal has colors +" Also switch on highlighting the last used search pattern. +if &t_Co > 2 || has("gui_running") + syntax on + set hlsearch +endif + +filetype plugin on + +if &term=="xterm" + set t_Co=8 + set t_Sb=^[[4%dm + set t_Sf=^[[3%dm +endif + +" Set tabbing stuff +set autoindent +set tabstop=4 +set shiftwidth=4 +set noexpandtab + + +" Don't wake up system with blinking cursor: +" http://www.linuxpowertop.org/known.php +let &guicursor = &guicursor . ",a:blinkon0"