dotfiles

My dotfiles, nothing really interesting to see ...
git clone https://git.onna.be/dotfiles.git
Log | Files | Refs | README

commit 42f940aa5a1318d009186a9380d241974aa1a024
parent fd5c63a58f54175f660001c11ac9708d948a174f
Author: Paco Esteban <paco@onna.be>
Date:   Tue, 12 Jun 2018 16:39:03 +0200

better handling of CLIP COMMAND, zsh needs explicit word expansion on variables. Also poor mans pastebin function

Diffstat:
zsh/.zsh/aliases.zsh | 16+++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/zsh/.zsh/aliases.zsh b/zsh/.zsh/aliases.zsh @@ -2,7 +2,7 @@ MYOS=$(uname) if [[ "$MYOS" == "Linux" ]]; then alias ls='ls -F --color' alias open="xdg-open" - CLIP_COMMAND="xclip -selection clipboard" + CLIP_COMMAND="xclip -f -selection clipboard" fi if [[ "$MYOS" == "FreeBSD" ]]; then alias ls='ls -F -G' @@ -184,7 +184,17 @@ function pubkey () { KEY="id_rsa-ps_festeban.pub" fi cat ${HOME}/.ssh/${KEY} |\ - tee |\ - $CLIP_COMMAND + ${=CLIP_COMMAND} echo "=> Public key ($KEY) copied to clipboard." } +# poor man's pastebin service (and secure !) +function pastesrv() { + FILENAME="$1" + if [[ -z "$FILENAME" ]]; then + FILENAME=$(tr -cd '[:alnum:]' < /dev/urandom |head -c 8) + fi + ssh r1 "cat > /var/www/pastes/$FILENAME" + echo -n "https://onna.be/paste/$FILENAME" |\ + ${=CLIP_COMMAND} + echo '' +}