From 754c32c019aa65533d90879517712ea4113206a6 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 17 Aug 2023 10:06:40 +0200 Subject: [PATCH] replace paths --- README.md | 7 +- assets/.bash_aliases | 9 +- assets/.bash_custom_aliases | 187 ++++++++++++++++++++++++++++ assets/.bashrc | 141 +++++++++++++++++++++ assets/.emacs | 38 ++++++ assets/.gitconfig | 25 ++++ assets/.zshrc | 103 +++++++++++++++ automatisation/cronjob_nextcloud.sh | 12 +- workflow_variables.sh | 5 +- 9 files changed, 510 insertions(+), 17 deletions(-) create mode 100644 assets/.bash_custom_aliases create mode 100644 assets/.bashrc create mode 100644 assets/.emacs create mode 100644 assets/.gitconfig create mode 100644 assets/.zshrc diff --git a/README.md b/README.md index 9afc0ce..0cc880d 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,8 @@ cd ~/Nextcloud/ressources/workflow_nextcloud/ git clone https://forge.chapril.org/tykayn/workflow public_workflow cd public_workflow ``` -Configrer les variables, puis lancer le script d'initialisation +Configrer les variables, avoir le droit d'exécuter des scripts avec `sudo` puis lancer le script d'initialisation ```bash editor workflow_variables.sh -sudo bash ~/Nextcloud/ressources/workflow_nextcloud/public_workflow/initialization/init_workflow.sh +bash ~/Nextcloud/ressources/workflow_nextcloud/public_workflow/initialization/init_workflow.sh ``` - -# TODO -* gestion des secrets automatiques pour les rsync \ No newline at end of file diff --git a/assets/.bash_aliases b/assets/.bash_aliases index e3bf480..1bea642 100644 --- a/assets/.bash_aliases +++ b/assets/.bash_aliases @@ -2,8 +2,7 @@ # these bash aliases are meant to be added in your user folder, # in a file named: .bash_aliases (with the dot at the beginning) # done for my blog http://www.cipherbliss.com - -############################ current - -# load aliases from workflow folder -. $WORKFLOW_PATH/assets/.bash_aliases \ No newline at end of file +# +# load variables +source ~/Nextcloud/ressources/workflow_nextcloud/public_workflow/workflow_variables.sh +source $WORKFLOW_PATH_PUBLIC/install/.bash_custom_aliases \ No newline at end of file diff --git a/assets/.bash_custom_aliases b/assets/.bash_custom_aliases new file mode 100644 index 0000000..d41fd88 --- /dev/null +++ b/assets/.bash_custom_aliases @@ -0,0 +1,187 @@ +#!/bin/bash +# these bash aliases are meant to be added in your user folder, +# in a file named: .bash_aliases (with the dot at the beginning) +# done for my blog http://www.cipherbliss.com +# +# load variables +#echo "load functions to sync files" +source ~/Nextcloud/ressources/workflow_nextcloud/public_workflow/workflow_variables.sh + + +############################ current +alias work="cd $www_folder/scripts/mapping_geojson_to_osm_tags" + +########## lieux ########### +alias dok="docker-compose" +alias dc="docker-compose" +alias dckill="docker container kill $(docker container ls -q)" +alias gow="cd $WORKFLOW_PATH" # go to folder of nextcloud where i store my scripts + +###### lieux locaux +alias goj="ssh -p 3910 tykayn@bbb.liness.org" +alias gopi="ssh pi@192.168.1.2" +alias gofat="ssh tykayn@192.168.1.7" +alias gowork="work" +alias gowww="cd $www_folder" +alias gox="ssh tykayn@proxmox.coussinet.org" +alias gok="ssh debian@ns3247177.ip-164-132-173.eu" # hébergement kimsufi + + +alias gonas="ssh $main_user@$IP_DU_NAS -p20522" +alias gos="cd $stockage_syncable_folder" + +alias goa="ssh root@biliz.cluster.chapril.org" +alias goad="cd /home/poule/encrypted/stockage-syncable/photos/a_dispatcher" +alias goo="cd ~/Nextcloud/textes/orgmode" +alias gown="cd ~/Nextcloud/ressources/workflow_nextcloud" +alias gos="cd /home/poule/encrypted/stockage-syncable" +alias gomob="ssh -6 tykayn@mobilizon.vm.openstreetmap.fr -i .ssh/id_rsa_spaceship" # go to mobilizon osm26 +################ personal info management - file management - PIM ######### +alias gf="python $WORKFLOW_PATH/files_management/guessfilename_custom.py" +alias rff="python $WORKFLOW_PATH/files_management/rename_photo_folder.py" +alias m2a="move2archive --archivepath $stockage_syncable_folder/photos" +alias ex="exiftool '-filename&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/Nextcloud/ressources/workflow_nextcloud/workflow_variables.sh ]; then + . ~/Nextcloud/ressources/workflow_nextcloud/workflow_variables.sh +else + echo "/!\\ bashrc: fichier de variables workflow_nextcloud non trouvé:" + echo "~/Nextcloud/ressources/workflow_nextcloud/workflow_variables.sh" +fi + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +else + echo "/!\\ bashrc: fichier de variables workflow_nextcloud non trouvé:" + echo "~/Nextcloud/ressources/workflow_nextcloud/workflow_variables.sh" +fi + +# 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 ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi +export PATH="$HOME/.rbenv/bin:$PATH" +eval "$(rbenv init -)" + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. +export PATH="$PATH:$HOME/.rvm/bin" +export PATH=$PATH:/var/lib/flatpak/exports/bin +export PATH="$HOME/.rbenv/bin:$PATH" +eval "$(rbenv init -)" +export PATH="$HOME/.rbenv/bin:$PATH" +eval "$(rbenv init -)" diff --git a/assets/.emacs b/assets/.emacs new file mode 100644 index 0000000..35f2de7 --- /dev/null +++ b/assets/.emacs @@ -0,0 +1,38 @@ +;; -*- lexical-binding: t; -*- + +;; The default is 800 kilobytes. Measured in bytes. +(setq gc-cons-threshold (* 50 1000 1000)) + +;; Profile emacs startup +(add-hook 'emacs-startup-hook + (lambda () + (message "*** Emacs loaded in %s seconds with %d garbage collections." + (emacs-init-time "%.2f") + gcs-done))) + + ;; straight el bootstrap https://github.com/raxod502/straight.el#getting-started + (defvar bootstrap-version) + (let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 5)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage)) + + (straight-use-package 'use-package) + (setq straight-use-package-by-default t) + (use-package org) + + + (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") +(set-default-coding-systems 'utf-8) + +(org-babel-load-file "~/Nextcloud/textes/orgmode/config.org") +(server-start) + +(global-set-key (kbd "") 'keyboard-escape-quit) diff --git a/assets/.gitconfig b/assets/.gitconfig new file mode 100644 index 0000000..9478a6e --- /dev/null +++ b/assets/.gitconfig @@ -0,0 +1,25 @@ +[credential] + helper = store +[user] + email = contact@cipherbliss.com + name = tykayn +[filesystem "Ubuntu|11.0.7|/dev/mapper/kubuntu--vg-root"] + timestampResolution = 5000 nanoseconds + minRacyThreshold = 7537 microseconds +[rerere] + enabled = true +[diff] + submodule = log +#[core] +# editor = gedit +[init] + defaultBranch = main +[filesystem "Debian|11.0.16|/dev/mapper/spaceship--vg-root"] + timestampResolution = 6000 nanoseconds + minRacyThreshold = 6565 microseconds +[commit] + gpgsign = false +[checkout] + defaultRemote = origin +[core] + editor = gedit diff --git a/assets/.zshrc b/assets/.zshrc new file mode 100644 index 0000000..3d38210 --- /dev/null +++ b/assets/.zshrc @@ -0,0 +1,103 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. +export ZSH="$HOME/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="robbyrussell" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +HIST_STAMPS="yyyy-dd-mm" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git cp colored-man-pages colorize command-not-found composer symfony2 pip pyenv python debian rbw themes) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +export LANG=fr_FR.UTF-8 + +# Preferred editor for local and remote sessions +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='nano' + else + export EDITOR='gedit' + fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +source ~/.bash_aliases diff --git a/automatisation/cronjob_nextcloud.sh b/automatisation/cronjob_nextcloud.sh index 58d0657..571ffd5 100644 --- a/automatisation/cronjob_nextcloud.sh +++ b/automatisation/cronjob_nextcloud.sh @@ -4,14 +4,14 @@ # tâche à effectuer régulièrement sur les ordis portables # # @author functions_sync by @tykayn - contact at cipherbliss.com -source ~/Nextcloud/ressources/workflow_nextcloud/workflow_variables.sh +source ~/Nextcloud/ressources/workflow_nextcloud/public_workflow/workflow_variables.sh # récupérer les notes du mobile et les stocker dans l'incoming inbox orgmode -bash $WORKFLOW_PATH/archive_from_nextcloud.sh -bash $WORKFLOW_PATH/update_calendar_tkwulfi.sh -bash $WORKFLOW_PATH/get_nextcloud_notes_todo.sh -bash $WORKFLOW_PATH/backup_nextcloud_in_user_home.sh -bash $WORKFLOW_PATH/git_auto_commit_workflow_folder.sh +bash $WORKFLOW_PATH_PUBLIC/archive_from_nextcloud.sh +bash $WORKFLOW_PATH_PUBLIC/update_calendar_tkwulfi.sh +bash $WORKFLOW_PATH_PUBLIC/get_nextcloud_notes_todo.sh +bash $WORKFLOW_PATH_PUBLIC/backup_nextcloud_in_user_home.sh +bash $WORKFLOW_PATH_PUBLIC/git_auto_commit_workflow_folder.sh upPhotosADispatcher diff --git a/workflow_variables.sh b/workflow_variables.sh index ab8247f..d6dfebd 100644 --- a/workflow_variables.sh +++ b/workflow_variables.sh @@ -1,9 +1,10 @@ #!/bin/bash # ajouter dans les scripts avec cette ligne: # -# source ~/Nextcloud/ressources/workflow_nextcloud/workflow_variables.sh +# source ~/Nextcloud/ressources/workflow_nextcloud/public_workflow/workflow_variables.sh # # + export main_user="tykayn" export main_archive_source_ssh_lan="tykayn@192.168.1.14" @@ -81,3 +82,5 @@ exclude_opts=() done export exclude_opts + +bash ./variables.sh \ No newline at end of file