This commit is contained in:
Gilles Mouchet 2024-05-22 18:04:00 +02:00
parent 04981febe6
commit 947ae0e444
3 changed files with 75 additions and 0 deletions

29
files/os/gmo-cfg.sh Normal file
View File

@ -0,0 +1,29 @@
# source prompt color: https://robotmoon.com/bash-prompt-generator/^
if [ $(whoami) == "gilles" ]; then
#export PS1="\[\033[0;32m\][\[\033[1;94m\]\u\[\033[0;33m\]@\h \[\033[0;32m\]\W]# \[\033[0;37m\]"
export PS1="\[\e[38;5;216m\]\u\[\e[38;5;160m\]@\[\e[38;5;202m\]\h \[\e[38;5;131m\]\w \[\033[0m\]$ "
elif [ $(whoami) == "blutch" ]; then
export PS1="\[\033[0;32m\][\[\033[1;94m\]\u\[\033[0;33m\]@\h \[\033[0;32m\]\W]# \[\033[0;37m\]"
elif [ $(whoami) == "root" ]; then
export PS1="\[\033[0;32m\][\[\033[0;31m\]\u\[\033[0;31m\]@\h \[\033[0;32m\]\W]# \[\033[0;37m\]"
else
export PS1="[\u@\h \W]\$ "
fi
# Aliases
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ls='ls --color=auto'
alias sudo='sudo --preserve-env=PATH env' # https://www.petefreitag.com/blog/environment-variables-sudo/
if [ "$USER" == "gilles" ]; then
hostnamectl
fi
# execute only if user is gilles or root
#if [[ "$USER" == "gilles" || "$USER" == "root" ]]; then
# # display proxy status
# if [ -f "/usr/local/bin/proxyOnOff.sh" ]; then
# sudo /usr/local/bin/proxyOnOff.sh status
# fi
#fi

0
files/os/profile Normal file
View File

46
misc.yml Normal file
View File

@ -0,0 +1,46 @@
---
- name: set correct time zone
timezone:
name: Europe/Zurich
- name: correct AM/PM rocky 9 bug
lineinfile:
path: /etc/locale.conf
insertafter: EOF
line: LC_TIME=C
- name: secure stack ip part 1
sysctl:
name: net.ipv4.tcp_timestamps
value: "0"
sysctl_set: yes
state: present
reload: yes
- name: secure stack ip part 2
firewalld:
service: dhcpv6-client
permanent: true
state: disabled
- name: forward X11
lineinfile:
dest: /etc/ssh/sshd_config
insertafter: '^#X11UseLocalhost yes'
line: 'X11UseLocalhost no'
- name: unactivate CRTL-DEL
file:
src: /dev/null
dest: /usr/lib/systemd/system/ctrl-alt-del.target
changed_when: false
- name: bash gmo-cfg.sh
copy:
src: os/gmo-cfg.sh
dest: /etc/profile.d/gmo-cfg.sh
- name: add ~/.local/bin in path
lineinfile:
path: /root/.bashrc
line: export PATH=~/.local/bin:$PATH