Compare commits

...

49 Commits
ssh ... main

Author SHA1 Message Date
jfontaine35 c9c1e5ecb8
library 2024-05-02 09:48:05 +02:00
jfontaine35 fcc7c2d1c0
Update .profile 2024-04-30 15:16:55 +02:00
jfontaine35 00ca042fb1
npm 2024-04-30 15:09:42 +02:00
jfontaine35 3f5ee6baa8
Update .profile 2024-04-30 15:08:37 +02:00
jfontaine35 7ec5c1c107
Update .profile 2024-04-30 15:01:22 +02:00
jfontaine35 d484a47b26
suppression du sudo 2024-04-30 15:00:59 +02:00
jfontaine35 d2844c104a
Update .profile 2024-04-30 14:57:39 +02:00
jfontaine35 13297b505a
Update .profile 2024-04-30 14:54:33 +02:00
jfontaine35 d2e77c8f28
MAJ disponibles + Affichage température 2024-04-30 14:44:43 +02:00
jfontaine35 64169a62e0
Fastfetch 2024-04-30 14:11:32 +02:00
jfontaine35 5397588f2f
Update install.sh 2024-01-27 10:38:20 +01:00
jfontaine35 4d44e025a5
Add files via upload 2024-01-27 10:37:14 +01:00
jfontaine35 5d32413b1b
Update .profile 2023-02-28 14:07:44 +01:00
jfontaine35 15e4b5a3ea
Update .profile 2023-02-28 14:04:25 +01:00
jfontaine35 b7af1b59c4
Update .profile 2023-02-03 09:17:32 +01:00
jfontaine35 7b576b97d3
Update .profile 2023-02-02 10:53:27 +01:00
jfontaine35 af6320535c
Update .profile 2023-02-02 10:37:52 +01:00
jfontaine35 28c9ea7a20
Update .profile 2023-02-02 09:42:10 +01:00
jfontaine35 ff85994105
Update .profile 2023-02-01 18:49:25 +01:00
jfontaine35 141ac0927a
Update .profile 2023-02-01 18:41:04 +01:00
jfontaine35 9c61f77418
Update .profile 2023-02-01 18:27:47 +01:00
jfontaine35 8a02eebce4
Update .profile 2023-02-01 18:26:08 +01:00
jfontaine35 9a590c0755
Update .profile 2023-02-01 18:23:51 +01:00
jfontaine35 13f54e1c5c
Update .profile 2023-02-01 18:18:25 +01:00
jfontaine35 befff37104
Update .profile 2023-02-01 16:24:30 +01:00
jfontaine35 4b0787335d
Update .profile 2023-01-31 12:53:25 +01:00
jfontaine35 d3d207973f
Update .profile 2023-01-31 12:52:45 +01:00
jfontaine35 c110e40be6
Update .profile 2023-01-31 12:50:02 +01:00
jfontaine35 a8bf2124a8
Update .profile 2023-01-31 12:42:57 +01:00
jfontaine35 9d12a6a092
Update .profile 2023-01-31 11:48:13 +01:00
jfontaine35 1aa7d9d0c2
Update .profile 2023-01-31 11:44:27 +01:00
jfontaine35 4ffcaea3da
Update README.md 2023-01-31 11:40:02 +01:00
jfontaine35 9d23309844
Update README.md 2023-01-31 11:37:02 +01:00
jfontaine35 5246515149
Update README.md 2023-01-31 11:36:41 +01:00
jfontaine35 27a96c6c83
Create install.sh 2023-01-31 11:34:19 +01:00
jfontaine35 ea924aeeb4
Update .profile 2023-01-31 11:28:56 +01:00
jfontaine35 4a52f49c07
Update .profile 2023-01-31 09:56:19 +01:00
jfontaine35 a497f73654
Update .profile 2023-01-30 22:40:28 +01:00
jfontaine35 18955af6f0
Add files via upload 2022-07-15 17:52:32 +02:00
jfontaine35 7cd00a29c7
Add files via upload 2022-06-14 16:03:02 +02:00
jfontaine35 b049f41717
Update .profile 2021-07-16 09:45:46 +02:00
jfontaine35 ea5920ea1a
Update .profile 2021-07-16 09:39:05 +02:00
jfontaine35 290631cde9
Add files via upload 2021-07-01 22:18:18 +02:00
jfontaine35 a9edc425a9
Update .profile 2021-04-01 15:05:19 +02:00
jfontaine35 e33329b2a2
Update .profile 2021-04-01 15:00:52 +02:00
jfontaine35 37ae56ca1e
Update .profile 2021-03-31 12:11:28 +02:00
jfontaine35 192d1dbd45
Update .profile 2021-03-31 10:18:33 +02:00
jfontaine35 b962262887
Add files via upload 2021-03-17 11:51:40 +01:00
jfontaine35 d344433804
Update .profile 2020-12-31 10:51:21 +01:00
8 changed files with 733 additions and 22 deletions

View File

@ -91,7 +91,6 @@ fi
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias maj='sudo apt update && sudo apt full-upgrade -y'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert

145
.conkyrc Normal file
View File

@ -0,0 +1,145 @@
# --------------------------------------------------------------------------------------------- #
#
# .conkyrc - derived from various examples across the 'net
#
# Some of the sites that proved most usful include:
# http://mylinuxramblings.wordpress.com/2010/03/23/how-to-configure-the-conky-system-monitor/`
# http://crunchbanglinux.org/wiki/conky
# http://lusule.wordpress.com/2008/08/07/how-to-4/
#
# --------------------------------------------------------------------------------------------- #
# -------------------- Conky's Run Time Parameters -------------------- #
update_interval 2.0 # Conky update interval in seconds
total_run_times 0 # Number of updates before quitting. Set to zero to run forever.
no_buffers yes # Subtract file system buffers from used memory?
cpu_avg_samples 2 # Number of cpu samples to average. Set to 1 to disable averaging
net_avg_samples 2 # Number of net samples to average. Set to 1 to disable averaging
# -------------------- Conky's General Look & Feel -------------------- #
# --- defualt values --- #
default_color grey # Default color and border color
default_bar_size 0 6 # Specify a default width and height for bars.
default_gauge_size 25 25 # Specify a default width and height for gauges.
default_graph_size 0 25 # Specify a default width and height for graphs.
default_outline_color green # Default border and text outline color
default_shade_color yellow # Default border and text shading color
# --- predefined colors - http://www.kgym.jp/freesoft/xrgb.html --- #
color0 FFFFFF # white
color1 FFA500 # orange
color2 B22222 # firebrick
color3 696969 # dim gray
color4 D3D3D3 # light gray
color5 2F4F4F # dark slate gray
color6 FFEC8B # light golden rod
color7 54FF9F # sea green
color8 FF8C69 # salmon
color9 FFE7BA # wheat
# --- window layout & options --- #
own_window yes # Conky creates its own window instead of using desktop
own_window_type normal # If own_window is yes, use type normal, desktop, or override
own_window_transparent yes # Use pseudo transparency with own_window?
own_window_colour blue # If own_window_transparent is no, set the background colour
double_buffer yes # Use double buffering (reduces flicker)
use_spacer right # Adds spaces to stop object from moving
maximum_width 600 # Maximum width of window in pixels
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# --- window placment --- #
alignment top_right
# --- borders, margins, and outlines --- #
draw_graph_borders yes # Do you want to draw borders around graphs
border_inner_margin 9 # Window's inner border margin (in pixels)
border_outer_margin 5 # Window's outer border margin (in pixels)
gap_x 10 # Gap between borders of screen and text (on x-axis)
gap_y 40 # Gap between borders of screen and text (on y-axis)
border_width 10 # Window's border width (in pixels)
# --- Text --- #
draw_outline no # Do you want ot draw outlines
draw_shades no # Do you want to draw shades
draw_borders no # Do you want to draw borders around text
uppercase no # set to yes if you want all text to be in uppercase
use_xft yes # use the X FreeType interface library (anti-aliased font)
xftfont Monospace:size=8:weight=bold # Xft font to be used
# -------------------- Conky's Displayed System Monitoring Parameters -------------------- #
TEXT
# Title / Banner message
${color5}
${alignc 40}${font Arial Black:size=22}${time %H:%M:%S}${font}
${alignc}${time %A} ${time %B} ${time %d}, ${time %Y}
$color
# General system information
${color1}SYSTEM INFORMATION ${hr 2}$color
${color0}System: $color$nodename ${alignr}${color0}Uptime: $color$uptime
${color0}Kernel: $color$kernel${alignr}${color0}Arch: $color$machine
${color0}Frequency: $color$freq MHz
${color0}Serial No.: $color${execi 99999 grep Serial /proc/cpuinfo | awk '{ print $3 }'}
${color0}MAC Address: $color${execi 99999 cat /sys/class/net/eth0/address }
# CPU information
${color1}CPU ${hr 2}$color
${color0}Avg. Load: $color $loadavg
${color0}CPU Temperature: $color${acpitemp}°C
${color0}CPU Usage:$color $cpu% ${color7}${cpubar}
${cpugraph 0000ff 00ff00}$color
# Top running processes
${color1}TOP 5 PROCESSES ${hr 2}$color
${color0}Processes:$color $processes ${color0}Running:$color $running_processes
${stippled_hr 2}
${color0}CPU Usage$color
${color3} NAME PID CPU % MEM$color
${color2} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}$color
${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}
${stippled_hr 2}
${color0}Mem Usage$color
${color3} NAME PID CPU % MEM$color
${color2} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}$color
${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${top_mem name 4} ${top_mem pid 4} ${top_mem cpu 4} ${top_mem mem 4}
${top_mem name 5} ${top_mem pid 5} ${top_mem cpu 5} ${top_mem mem 5}
# Memory and swap space untilization
${color1}MEMORY RAM / SWAP ${hr 2}$color
${color0}RAM Usage: ${color}$mem / $memmax
$memperc% ${color6}${membar}$color
${stippled_hr 2}
${color0}Swap Usage: ${color}$swap / $swapmax
$swapperc% ${color6}${swapbar}$color
# File System utilization
${color1}FILE SYSTEM ${hr 2}$color
${color0}SD Card:$color ${fs_used /} / ${fs_size /}
${fs_used_perc /}% ${color8}${fs_bar /}$color
${stippled_hr 2}
${color0}Reads: $color$diskio_read/s${alignr}${color0}Writes: $color$diskio_write/s
${color8}${diskiograph_read 20,100 33FF00 FF3333 scale -t}$color${alignr}${color8}${diskiograph_write 20,100 33FF00 FF3333 scale -t}$color
# Ethernet utilization
${color1}NETWORKING ${hr 2}$color
${color0}Wired (${addr eth0})
${color0}Down:$color ${downspeed eth0}/s ${alignr}${color0}Up:$color ${upspeed eth0}/s
${color0}Total:$color ${totaldown eth0} ${alignr}${color0}Total: $color${totalup eth0}
${color0}${downspeedgraph eth0 25,120 000000 00ff00} ${alignr}${upspeedgraph eth0 25,120 000000 ff0000}$color
${stippled_hr 2}
${color0}Wireless (${addr wlan0})
${color0}Down:$color ${downspeed wlan0}/s ${alignr}${color0}Up:$color ${upspeed wlan0}/s
${color0}Total:$color ${totaldown wlan0} ${alignr}${color0}Total: $color${totalup wlan0}
${color0}${downspeedgraph wlan0 25,120 000000 00ff00} ${alignr}${upspeedgraph wlan0 25,120 000000 ff0000}$color
# Print the tail of the Linux message log
${color1}LOG FILES ${hr 2}$color
${color0}Linux Message Log$color
${color4}${font Arial:size=6}${execi 30 tail -n3 /var/log/messages | fold -w50}$color$font

153
.profile
View File

@ -1,19 +1,45 @@
# ~/.profile: executed by Bourne-compatible login shells.
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in thebash-doc package.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
marker_file=~/.utils_ok
host1="1.1.1.1"
host2="google.fr"
if [ -f "$marker_file" ]; then
echo "Mise à jour des outils déjà faite."
else
touch "$marker_file"
apt install -y neofetch mailutils figlet dnsutils net-tools lm-sensors nodejs npm
apt install -y libxdamage1 libxkbcommon0 libatk-bridge2.0-0 libatk1.0-0 libasound2 libnss3
cd ~
wget https://github.com/fastfetch-cli/fastfetch/releases/download/2.10.2/fastfetch-linux-amd64.deb
dpkg -i fastfetch-linux-amd64.deb
npm install --global fast-cli
fi
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
mesg n || true
##########################################################
# Custom Profile
##########################################################
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;34m\]\u@\h \[\033[01;32m\]\w\[\033[00m\]\$ '
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
@ -27,19 +53,106 @@ alias cp='cp -i'
alias mv='mv -i'
alias maj='apt update && apt full-upgrade -y && apt autoremove -y'
alias sp='source .profile'
alias ep='nano .profile'
clear
neofetch
alias disk="df -h | grep DATAS | sed -e 's/ /:/g' | sed -e 's/::/:/g'"
fastfetch
alias disk="df -h 2>/dev/null | grep '/$' | sed -e 's/ /:/g' | sed -e 's/::/:/g' | sed -e 's/::/:/g'| sed -e 's/::/:/g'"
echo "Bienvenue sur : $(hostname -f) ($(hostname -i)) !"
echo "Bienvenue sur : $(hostname -f) ($(hostname -I)) !"
echo "******************************************************"
echo "Note: Toutes actions sur ce serveur sont enregistrees."
echo "------------------------------------------------------"
echo "Date : $(date) "
echo "Uptime : $(uptime -p)"
echo "Disk : Use->$(disk | cut -d ':' -f4) / Free->$(disk | cut -d ':' -f6) (Use: $(disk | cut -d ':' -f7))"
echo -e "Apache2 : \033[01;32m $(service apache2 status | grep Active | cut -d ' ' -f5,6) \033[01;37m"
echo -e "MariaDB : \033[01;32m $(service mysql status | grep Active | cut -d ' ' -f5,6) \033[01;37m"
echo ""
echo -e "Date d'installation : $(stat / | grep "Birth" | sed 's/Birth: //g' | cut -b 2-11)"
ping -c 1 "$host1" > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "\033[0;31mAucune connexion Internet n'est disponible.\033[0m"
else
nslookup "$host2" > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "\033[0;31mAucune connexion DNS n'est disponible.\033[0m"
else
echo -e "\033[0;32mConnexion à internet : OK.\033[0m"
fi
fi
# Mettre à jour la liste des paquets disponibles
apt-get update > /dev/null
# Obtenir la liste des mises à jour disponibles
updates=$(apt list --upgradable 2>/dev/null | grep -v Listing)
if [[ -z "$updates" ]]; then
echo -e "\e[32mAucune mise à jour disponible.\e[0m" # Affiche en vert s'il n'y a pas de mise à jour
else
# Compter les mises à jour de sécurité
security_updates_count=$(echo "$updates" | grep -e "\s\(security\|sécurité\)\s" | wc -l)
# Compter les autres mises à jour
other_updates_count=$(echo "$updates" | grep -v -e "\s\(security\|sécurité\)\s" | wc -l)
if [[ $security_updates_count -gt 0 || $other_updates_count -gt 0 ]]; then
echo -e "\e[31mNombre de mises à jour de sécurité disponibles : $security_updates_count\e[0m" # Affiche en rouge si des mises à jour sont disponibles
echo -e "\e[31mNombre d'autres mises à jour disponibles : $other_updates_count\e[0m" # Affiche en rouge si des mises à jour sont disponibles
else
echo -e "\e[32mAucune mise à jour disponible.\e[0m" # Affiche en vert s'il n'y a pas de mise à jour
fi
fi
# Utiliser sensors pour obtenir les informations de température
temp_info=$(sensors)
# Extraire la température du système (généralement associée au processeur ou au package thermique)
system_temp=$(echo "$temp_info" | grep "Package" | awk '{print $4}')
# Vérifier si la température du système est disponible
if [[ -z "$system_temp" ]]; then
echo "Impossible de récupérer la température du système."
else
# Extraire la partie numérique de la température (en enlevant le °C et le décimal)
system_temp_int=$(echo "$system_temp" | tr -d '.°C')
# Déterminer la couleur en fonction de la température
if [[ $system_temp_int -gt 550 ]]; then
color='\e[31m' # Rouge pour température > 55°C
elif [[ $system_temp_int -ge 350 && $system_temp_int -le 540 ]]; then
color='\e[32m' # Vert pour température entre 35°C et 54°C
else
color='\e[34m' # Bleu pour température < 35°C
fi
# Afficher la température du système avec la couleur appropriée
echo -e "Température du système : ${color}${system_temp}\e[0m"
fi
cd ~
# Disk : Verification de l'espace restant
#FD=$(echo $(df -h 2>/dev/null | grep '/$' | sed -e 's/ /:/g' | sed -e 's/::/:/g' | sed -e 's/::/:/g'| sed -e 's/::/:/g' | cut -d ':' -f5)| cut -d '%' -f1)
#[ $FD -lt $MaxHDUse ] && libre="\e[01;32;7m $FD% \e[0m" || libre="\e[41;37;5m $FD% \e[0m"
#echo -e "Disk : $(df -h 2>/dev/null | grep '/$' | sed -e 's/ /:/g' | sed -e 's/::/:/g' | sed -e 's/::/:/g'| sed -e 's/::/:/g' | cut -d ':' -f3) / $(df -h 2>/dev/null | grep '/$' | sed -e 's/ /:/g' | sed -e 's/::/:/g' | sed -e 's/::/:/g'| sed -e 's/::/:/g' | cut -d ':' -f4)"
# Verification des services Web
#pidof "pihole-FTL" >/dev/null && echo -e "Pihole-FTL: \e[01;32;7m Service actif \e[0m" || echo -e "Pihole-FTL : \e[41;37;5m Service inactif \e[0m"
#pidof "lighttpd" >/dev/null && echo -e "Lighttpd : \e[01;32;7m Service actif \e[0m" || echo -e "Lighttpd : \e[41;37;5m Service inactif \e[0m"
#pidof "mariadbd" >/dev/null && echo -e "MariaDB : \e[01;32;7m Service actif \e[0m" || echo -e "MariaDB : \e[41;37;5m Service inactif \e[0m"
#pidof "apache2" >/dev/null && echo -e "Apache2 : \e[01;32;7m Service actif \e[0m" || echo -e "Apache2 : \e[41;37;5m Service inactif \e[0m"
# Vérification des agents
#pidof "fusioninventory" >/dev/null && echo -e "Fusion : \e[01;32;7m Service actif \e[0m" || echo -e "Fusion : \e[41;37;5m Service inactif \e[0m"
# Verification des services Proxmox
#pidof "pvedaemon" >/dev/null && echo -e "PVE : \e[01;32;7m Service actif \e[0m" || echo -e "PVE : \e[41;37;5m Service inactif \e[0m"
#pidof "pveproxy" >/dev/null && echo -e "PVE-Proxy: \e[01;32;7m Service actif \e[0m" || echo -e "PVE-Proxy: \e[41;37;5m Service inactif \e[0m"
# Vérification du serveur de temps
#pidof "ntpd" >/dev/null && echo -e "NTP : \e[01;32;7m Service actif \e[0m" || echo -e "NTP : \e[41;37;5m Service inactif \e[0m"
# Envoie du mail d'alertes de connexion.
echo "Merci de vérifier que vous êtes bien à l'originie de cette connexion." | mail -s "Connexion sur : $HOSTNAME avec le compte : $USER" admin@h3campus.fr
# 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
figlet H3 Campus
fast &

221
.zshrc Normal file
View File

@ -0,0 +1,221 @@
# 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/Johnny/.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="agnoster"
# 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="mm/dd/yyyy"
# 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)
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=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# 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"
#Alias
alias maj='sudo apt update && sudo apt upgrade -y && apt autoremove -y && sudo apt-get check'
alias apt="sudo apt"
alias sb="source ~/.bashrc"
alias docker="sudo docker"
alias docker-compose="sudo docker-compose"
alias dps="docker ps -a"
alias cputemp="paste <(cat /sys/class/thermal/thermal_zone0/type) <(cat /sys/class/thermal/thermal_zone0/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C/'"
alias sz="source ~/.zshrc"
alias qn="qownnotes"
alias ez="nano ~/.zshrc"
alias speedo="speedometer -r wlan0 -i 1"
alias spt="/usr/bin/speedtest"
alias vpnparis="sudo apt >/dev/null ; sudo openfortivpn -c /etc/openfortivpn/paris --persistent=120 & ;"
alias vpnpoissy="sudo apt >/dev/null; sudo openfortivpn -c /etc/openfortivpn/poissy --persistent=120 & ;"
alias vpnissy="sudo apt >/dev/null; sudo openfortivpn -c /etc/openfortivpn/issy --persistent=120 & ;"
alias publicip="curl ipecho.net/plain"
alias sshkey="eval `ssh-agent` ; ssh-add /home/Johnny/.ssh/tuxgyver "
alias sshaddkey="ssh-add /home/Johnny/.ssh/tuxgyver_key"
alias majinfo="cd ~/Documents/Web/ ; scp -r -P 2222 * root@192.168.150.213:/var/www/html/"
alias majinfo2="cd ~/Documents/Web/ ; scp -r * root@192.168.180.213:/var/www/html/"
alias killvpn="sudo killall openfortivpn ; echo 'Tous les openvpn ont ete kille !'"
alias p1="ping 192.168.150.1"
alias p1.8="ping 192.168.150.8"
alias p1.12="ping 192.168.150.12"
alias p1.210="ping 192.168.150.210"
alias p1.214="ping 192.168.150.214"
alias p1.215="ping 192.168.150.215"
alias p1.216="ping 192.168.150.216"
alias p1.213="ping 192.168.150.213"
alias p1.220="ping 192.168.150.220"
alias p1.227="ping 192.168.150.227"
alias p1.230="ping 192.168.150.230"
alias p2="ping 192.168.156.1"
alias p2.8="ping 192.168.156.8"
alias p2.210="ping 192.168.150.210"
alias p2.215="ping 192.168.150.215"
alias p2.227="ping 192.168.156.227"
alias p3="ping 192.168.1.254"
alias p3.8="ping 192.168.1.8"
alias p3.227="ping 192.168.7.227"
alias ka="sudo killall anydesk"
alias scan-allports="sudo nmap -sTV -p1-65535 "
alias scan-port="sudo nmap -sTV -p21,22,53,80,139,443,445,2222,4343,8006,8007,5900,8080,8443,10000,19999 "
alias scan-rapide="sudo nmap -sPV "
alias scan-malware='sudo maldet --scan-all '
alias lt='ls --human-readable --size -1 -S --classify'
alias powershell='docker run -it clowa/powershell-core'
alias meteo-meudon='curl wttr.in/meudon'
alias meteo-paris='curl wttr.in/paris'
alias meteo-valbonnais='curl wttr.in/valbonnais'
# 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 ~/.bash_aliases ]; then
. ~/.bash_aliases
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
clear
neofetch
alias disk="df -h 2>/dev/null | grep '/$' | sed -e 's/ /:/g' | sed -e 's/::/:/g' | sed -e 's/::/:/g'| sed -e 's/::/:/g'"
MaxHDUse=75
echo "Bienvenue sur : $(hostname -f) ($(hostname -I)) !"
echo "******************************************************"
echo "Note: Toutes actions sur ce serveur sont enregistrees."
echo "------------------------------------------------------"
echo "Date : $(date) "
echo "Uptime : $(uptime -p)"
echo "Temp. : $(paste <(cat /sys/class/thermal/thermal_zone0/type) <(cat /sys/class/thermal/thermal_zone0/temp) | column -s $' ' -t | sed 's/\(.\)..$/.\1°C/')"
# Disk : Verification de l'espace restant
FD=$(echo $(disk | cut -d ':' -f5)| cut -d '%' -f1)
[ $FD -lt $MaxHDUse ] && libre="\e[01;32;7m $FD% \e[0m" || libre="\e[41;37;5m $FD% \e[0m"
echo -e "Disk : Use->$(disk | cut -d ':' -f3) / Free->$(disk | cut -d ':' -f4) (Use: $libre)"
# Verification des services Web
#pidof "mysqld" >/dev/null && echo -e "MariaDB : \e[01;32;7m Service actif \e[0m" || echo -e "MariaDB : \e[41;37;5m Service inactif \e[0m"
#pidof "apache2" >/dev/null && echo -e "Apache2 : \e[01;32;7m Service actif \e[0m" || echo -e "Apache2 : \e[41;37;5m Service inactif \e[0m"
#pidof "fusioninventory" >/dev/null && echo -e "Fusion : \e[01;32;7m Service actif \e[0m" || echo -e "Fusion : \e[41;37;5m Service inactif \e[0m"
# Verification des services Proxmox
#pidof "pvedaemon" >/dev/null && echo -e "PVE : \e[01;32;7m Service actif \e[0m" || echo -e "PVE : \e[41;37;5m Service inactif \e[0m"
#pidof "pveproxy" >/dev/null && echo -e "PVE-Proxy: \e[01;32;7m Service actif \e[0m" || echo -e "PVE-Proxy: \e[41;37;5m Service inactif \e[0m"
# Vérification du serveur de temps
#pidof "ntpd" >/dev/null && echo -e "NTP : \e[01;32;7m Service actif \e[0m" || echo -e "NTP : \e[41;37;5m Service inactif \e[0m"
# Vérification du serveur CUPS
#pidof "avahi-daemon" >/dev/null && echo -e "CUPS : \e[01;32;7m Service actif \e[0m" || echo -e "CUPS : \e[41;37;5m Service inactif \e[0m"
transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;}
# Tuxtech.fr
figlet Tuxtech.fr

View File

@ -4,6 +4,10 @@ Des alias dont dé-commenter pour avoir les couleurs & activer l'interaction pou
## Des alias pratiques sont définit :
**maj** ---> permet de faire des maj du systeme
**maj** ---> permet de faire des maj du system
**sp** --> recharger le fichier en cas de modification ou pour faire apparaître un résumé de l'état du système.
Installation :
`git clone https://github.com/h3-campus/bashrc && cd bashrc && chmod +x install.sh && ./install.sh`

BIN
fast Normal file

Binary file not shown.

8
install.sh Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
cp .profile ~
cp .bashrc ~
cp .zshrc ~
cp fast /usr/bin/
chmod +x /usr/bin/fast
source ~/.bashrc
source ~/.profile

221
zshrc Normal file
View File

@ -0,0 +1,221 @@
# 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/Johnny/.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="agnoster"
# 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="mm/dd/yyyy"
# 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)
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=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# 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"
#Alias
alias maj='sudo apt update && sudo apt upgrade -y && apt autoremove -y && sudo apt-get check'
alias apt="sudo apt"
alias sb="source ~/.bashrc"
alias docker="sudo docker"
alias docker-compose="sudo docker-compose"
alias dps="docker ps -a"
alias cputemp="paste <(cat /sys/class/thermal/thermal_zone0/type) <(cat /sys/class/thermal/thermal_zone0/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C/'"
alias sz="source ~/.zshrc"
alias qn="qownnotes"
alias ez="nano ~/.zshrc"
alias speedo="speedometer -r wlan0 -i 1"
alias spt="/usr/bin/speedtest"
alias vpnparis="sudo apt >/dev/null ; sudo openfortivpn -c /etc/openfortivpn/paris --persistent=120 & ;"
alias vpnpoissy="sudo apt >/dev/null; sudo openfortivpn -c /etc/openfortivpn/poissy --persistent=120 & ;"
alias vpnissy="sudo apt >/dev/null; sudo openfortivpn -c /etc/openfortivpn/issy --persistent=120 & ;"
alias publicip="curl ipecho.net/plain"
alias sshkey="eval `ssh-agent` ; ssh-add /home/Johnny/.ssh/tuxgyver "
alias sshaddkey="ssh-add /home/Johnny/.ssh/tuxgyver_key"
alias majinfo="cd ~/Documents/Web/ ; scp -r -P 2222 * root@192.168.150.213:/var/www/html/"
alias majinfo2="cd ~/Documents/Web/ ; scp -r * root@192.168.180.213:/var/www/html/"
alias killvpn="sudo killall openfortivpn ; echo 'Tous les openvpn ont ete kille !'"
alias p1="ping 192.168.150.1"
alias p1.8="ping 192.168.150.8"
alias p1.12="ping 192.168.150.12"
alias p1.210="ping 192.168.150.210"
alias p1.214="ping 192.168.150.214"
alias p1.215="ping 192.168.150.215"
alias p1.216="ping 192.168.150.216"
alias p1.213="ping 192.168.150.213"
alias p1.220="ping 192.168.150.220"
alias p1.227="ping 192.168.150.227"
alias p1.230="ping 192.168.150.230"
alias p2="ping 192.168.156.1"
alias p2.8="ping 192.168.156.8"
alias p2.210="ping 192.168.150.210"
alias p2.215="ping 192.168.150.215"
alias p2.227="ping 192.168.156.227"
alias p3="ping 192.168.1.254"
alias p3.8="ping 192.168.1.8"
alias p3.227="ping 192.168.7.227"
alias ka="sudo killall anydesk"
alias scan-allports="sudo nmap -sTV -p1-65535 "
alias scan-port="sudo nmap -sTV -p21,22,53,80,139,443,445,2222,4343,8006,8007,5900,8080,8443,10000,19999 "
alias scan-rapide="sudo nmap -sPV "
alias scan-malware='sudo maldet --scan-all '
alias lt='ls --human-readable --size -1 -S --classify'
alias powershell='docker run -it clowa/powershell-core'
alias meteo-meudon='curl wttr.in/meudon'
alias meteo-paris='curl wttr.in/paris'
alias meteo-valbonnais='curl wttr.in/valbonnais'
# 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 ~/.bash_aliases ]; then
. ~/.bash_aliases
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
clear
neofetch
alias disk="df -h 2>/dev/null | grep '/$' | sed -e 's/ /:/g' | sed -e 's/::/:/g' | sed -e 's/::/:/g'| sed -e 's/::/:/g'"
MaxHDUse=75
echo "Bienvenue sur : $(hostname -f) ($(hostname -I)) !"
echo "******************************************************"
echo "Note: Toutes actions sur ce serveur sont enregistrees."
echo "------------------------------------------------------"
echo "Date : $(date) "
echo "Uptime : $(uptime -p)"
echo "Temp. : $(paste <(cat /sys/class/thermal/thermal_zone0/type) <(cat /sys/class/thermal/thermal_zone0/temp) | column -s $' ' -t | sed 's/\(.\)..$/.\1°C/')"
# Disk : Verification de l'espace restant
FD=$(echo $(disk | cut -d ':' -f5)| cut -d '%' -f1)
[ $FD -lt $MaxHDUse ] && libre="\e[01;32;7m $FD% \e[0m" || libre="\e[41;37;5m $FD% \e[0m"
echo -e "Disk : Use->$(disk | cut -d ':' -f3) / Free->$(disk | cut -d ':' -f4) (Use: $libre)"
# Verification des services Web
#pidof "mysqld" >/dev/null && echo -e "MariaDB : \e[01;32;7m Service actif \e[0m" || echo -e "MariaDB : \e[41;37;5m Service inactif \e[0m"
#pidof "apache2" >/dev/null && echo -e "Apache2 : \e[01;32;7m Service actif \e[0m" || echo -e "Apache2 : \e[41;37;5m Service inactif \e[0m"
#pidof "fusioninventory" >/dev/null && echo -e "Fusion : \e[01;32;7m Service actif \e[0m" || echo -e "Fusion : \e[41;37;5m Service inactif \e[0m"
# Verification des services Proxmox
#pidof "pvedaemon" >/dev/null && echo -e "PVE : \e[01;32;7m Service actif \e[0m" || echo -e "PVE : \e[41;37;5m Service inactif \e[0m"
#pidof "pveproxy" >/dev/null && echo -e "PVE-Proxy: \e[01;32;7m Service actif \e[0m" || echo -e "PVE-Proxy: \e[41;37;5m Service inactif \e[0m"
# Vérification du serveur de temps
#pidof "ntpd" >/dev/null && echo -e "NTP : \e[01;32;7m Service actif \e[0m" || echo -e "NTP : \e[41;37;5m Service inactif \e[0m"
# Vérification du serveur CUPS
#pidof "avahi-daemon" >/dev/null && echo -e "CUPS : \e[01;32;7m Service actif \e[0m" || echo -e "CUPS : \e[41;37;5m Service inactif \e[0m"
transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;}
# Tuxtech.fr
figlet Tuxtech.fr