Skip to content

Commit

Permalink
move ssh and latex_clean
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlivio committed Apr 12, 2023
1 parent 16c24d4 commit cb9b4c6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
2 changes: 0 additions & 2 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ if type ffmpeg &>/dev/null; then source "$BH_LIB/ffmpeg.bash"; fi
if type flutter &>/dev/null; then source "$BH_LIB/flutter.bash"; fi
if type gs &>/dev/null; then source "$BH_LIB/gs.bash"; fi
if type git &>/dev/null; then source "$BH_LIB/git.bash"; fi
if type latexmk &>/dev/null; then source "$BH_LIB/latex.bash"; fi
if type lxc &>/dev/null; then source "$BH_LIB/lxc.bash"; fi
if type meson &>/dev/null; then source "$BH_LIB/meson.bash"; fi
if type pandoc &>/dev/null; then source "$BH_LIB/pandoc.bash"; fi
if type python &>/dev/null; then source "$BH_LIB/python.bash"; fi
if type ssh &>/dev/null; then source "$BH_LIB/ssh.bash"; fi
if type wget &>/dev/null; then source "$BH_LIB/wget.bash"; fi
if type youtube-dl &>/dev/null; then source "$BH_LIB/youtube-dl.bash"; fi
if type zip &>/dev/null; then source "$BH_LIB/zip.bash"; fi
8 changes: 0 additions & 8 deletions lib/latex.bash

This file was deleted.

17 changes: 0 additions & 17 deletions lib/ssh.bash

This file was deleted.

30 changes: 30 additions & 0 deletions os_any.bash
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,34 @@ function decompress_from_url_one_file_and_move_to_bin() {
dir_name="${dir_name%.*}" # XXX
log_msg "coping $dir_name/$2 to $BH_BIN"
cp $dir_name/$2 $BH_BIN
}

#########################
# ssh
#########################

function ssh_fix_permissions() {
chmod 700 $HOME/.ssh/
if test -e $HOME/.ssh/id_rsa; then
chmod 600 $HOME/.ssh/id_rsa
chmod 640 $HOME/.ssh/id_rsa.pubssh-rsa
fi
}

function ssh_send_to_server_authorized_pub_key() {
: ${1?"Usage: ${FUNCNAME[0]} <user@server>"}
ssh "$1" sh -c 'cat - >> ~/.ssh/authorized_keys' <$HOME/.ssh/id_rsa.pub
}

function ssh_send_to_server_priv_key() {
: ${1?"Usage: ${FUNCNAME[0]} <user@server>"}
ssh "$1" sh -c 'cat - > ~/.ssh/id_rsa;chmod 600 $HOME/.ssh/id_rsa' <$HOME/.ssh/id_rsa
}

#########################
# clean
#########################

function latex_clean() {
rm -rf _markdown* *.markdown.lua *.aux *.dvi *.log *.lox *.out *.lol *.pdf *.synctex.gz _minted-* *.bbl *.blg *.lot *.lof *.toc *.lol *.fdb_latexmk *.fls *.bcf
}

0 comments on commit cb9b4c6

Please sign in to comment.