Skip to content
Snippets Groups Projects
Commit 8e6723a4 authored by RIEHM Clement's avatar RIEHM Clement
Browse files

Debut ssh

parents 7d8715f6 66d1b67b
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@
showtabs=false,
tabsize=2
}
\lstset{style=mystyle}
% Info titre
\title{Outils libre coté client}
......@@ -37,8 +38,82 @@
\maketitle
\tableofcontents
\section{Efficacité de l'environnement de travail}
\subsection*{\#1}
\subsection*{\#2}
\subsection*{\#3}
vi en mode par défaut:
\begin{lstlisting}[language=bash]
echo "set editing-mode vi" > ~/.inputrc
\end{lstlisting}
Parametrer nvim en éditeur par défaut sur archlinux :
\begin{lstlisting}[language=bash]
echo "export EDITOR='nvim'" >> ~/.bashrc
\end{lstlisting}
\subsection*{\#4}
Il y avait un mot de passe dans mon history.
D'après son history l’employé a sans doute changer de shell. Il a installé zsh avant que l’history s’arrete.
Les commandes listées dans la variable HISTIGNORE sont désactivées.
\begin{lstlisting}[language=bash]
export HISTIGNORE="&:ls:exit:pwd:clear:history"
\end{lstlisting}
\subsection*{\#5}
\begin{lstlisting}[language=bash]
function mkcd()
{
mkdir $1
cd $1
}
function gitemergency()
{
git add *
git commit -m "emergency commit"
git push origin main
}
\end{lstlisting}
\subsection*{\#6}
\begin{lstlisting}[language=bash]
_backup()
{
local cur prev opts
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
local files=("${cur}"*)
case $COMP_CWORD in
1) opts=`getent passwd | cut -d: -f1`;;
2) opts="now tonight tomorrow";;
3) opts="${files[@]}";;
*);;
esac
COMPREPLY=()
COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
return 0
}
complete -o nospace -F _backup backup
\end{lstlisting}
\subsection*{\#7}
Ajouter vagrant-prompt dans la liste de plugins de ~/.zshrc
plugins=(git vagrant-prompt)
Ajouter \verb|$(vagrant_prompt_info)| au PROMPT dans le themes
\subsection*{\#8}
\subsection*{\#9}
\subsection*{\#10}
\section{SSH}
\subsection{#1}
\subsection*{#1}
\begin{lstlisting}
ssh alice@192.168.56.2
......@@ -46,5 +121,73 @@ ssh alice@192.168.56.2
L'history des utilisateurs sont vides.
\subsection{#}
\section{Git}
\subsection*{\#1}
\begin{lstlisting}[language=bash]
~/git/vagrantssh $ git init
git status
vagrant up
vagrant halt
git status
\end{lstlisting}
Un dossier .vagrant est créé. L’ajouter dans le fichier gitignore pour l’ignorer.
\begin{lstlisting}[language=bash]
echo .vagrant/ >> .gitignore
git add README.md Vagrantfile srv/
git commit -m "Ajout initial"
git log
git show cdc5df9f5ec0abe55cc6d825c5c6008560199688
\end{lstlisting}
\subsection*{\#2.1}
\begin{lstlisting}[language=bash]
git checkout -b new-branche-2000
nvim Vagrantfile
git add -p
\end{lstlisting}
Les modification ne sont pas dans le working directory.
\subsection*{\#2.2}
\begin{lstlisting}[language=bash]
git checkout master
git merge new-branche-2000
git log
git show 8fa8008b2c7eeb6e55115f019b6e7ca3e439a4dd
\end{lstlisting}
Spécificité : Le HEAD -> master
\begin{lstlisting}[language=bash]
commit 8fa8008b2c7eeb6e55115f019b6e7ca3e439a4dd (HEAD -> master, new-branche-2000)
\end{lstlisting}
\begin{lstlisting}[language=bash]
git branch
* master
new-branche-2000
\end{lstlisting}
La branche existe toujours. On peut supprimer la branche.
\subsection*{\#3}
\begin{lstlisting}[language=bash]
git checkout master
git merge new-branche-2000
git log
git show 8fa8008b2c7eeb6e55115f019b6e7ca3e439a4dd
\end{lstlisting}
\subsection*{\#4}
\begin{lstlisting}[language=bash]
git checkout -b forward-new-port
\end{lstlisting}
\begin{lstlisting}[language=bash]
nvim Vagrantfile
git add Vagrantfile
git commit -m "Forward port 80"
\end{lstlisting}
\begin{lstlisting}[language=bash]
git checkout master
nvim Vagrantfile
git add Vagrantfile
git commit -m "Forward port 80"
\end{lstlisting}
\begin{lstlisting}[language=bash]
git merge forward-new-port
\end{lstlisting}
Git demande de corriger le conflit.
>>>>>>> 66d1b67b0bc81a0cb42237dfeb5ada3eb4f3cd8d
\end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment