diff --git a/Utils/sldm.sh b/Utils/sldm.sh new file mode 100755 index 0000000..5db66ff --- /dev/null +++ b/Utils/sldm.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# sldm - Super Lightweight Device Mounter + +#TODO: FIXME and make me nicer + + +devices=(/dev/sd??) +dontwant=sda +tomount=/media +for device in ${devices[@]}; do + + last=$(echo $device | awk -F/ '{print $NF}') + + if [ "${device#*$dontwant}" == "$device" ]; then + echo $device + mount | grep $device > /dev/null + if [ $? -ne 0 ]; then + echo "yop" + pa=$tomount/$last + mkdir -p $pa > /dev/null + + mount $device $pa + fi; + echo $device + fi; +done; diff --git a/bashrc b/bashrc index 55165e6..8eab040 100644 --- a/bashrc +++ b/bashrc @@ -1,17 +1,21 @@ shopt -s checkwinsize #Pour pas s'écrire dessus shopt -s histappend +##shopt -s autocd #Like zsh PROMPT_COMMAND='history -a' #For autocompletions -function have() { return 1; } #Some files use have: suppress warnings (yeah: 2>.. ) -function _completion_loader() { return 1; } +#function have() { return 1; } #Some files use have: suppress warnings (yeah: 2>.. ) +#function _completion_loader() { return 1; } #cd /usr/share/bash-completion/completions #for i in *; do source ./$i; done #unset have #unset _completion_loader +complete -cf sudo +complete -cf man + #####ON DEFINIT LES COULEURS red='\033[31m' @@ -107,6 +111,7 @@ alias poule='git pull' alias makew='make' alias BSI2='cd ~/Documents/UniGE/BSI2*/' +alias BSI3='cd ~/Documents/UniGE/BSI3*/' OCTOPUS=~/.my_utils/octopus.sh alias dual='$OCTOPUS monitor dual' @@ -120,6 +125,7 @@ alias volmute='$OCTOPUS volume mute' alias suspend='$OCTOPUS suspend' alias mfilms='cd /dev/shm && mkdir films && sshfs frank@vi-di.fr:/media/ films/' +alias muni='cd /dev/shm && mkdir uni && sshfs villaro0@pc69240:/user/l1/2011/villaro0/ uni/' alias upgrub='sudo grub-mkconfig -o /boot/grub/grub.cfg' @@ -285,9 +291,13 @@ _RoRosetCompletion() return 0 } - complete -F _RoRosetCompletion -o filenames ro roset +function calc() +{ + echo "scale=3;$@" | bc -l +} + # }}} diff --git a/ssh/config b/ssh/config index 3d31def..9e4f042 100644 --- a/ssh/config +++ b/ssh/config @@ -31,7 +31,7 @@ host chuck port 1337 host pc69240 - hostname 2001:620:600:4400:214:4fff:fea8:6d3c + user villaro0 host cuilxa hostname cuilxa.unige.ch