timedatectl set-timezone Europe/Madrid# wslu - A collection of utilities for WSL https://github.com/wslutilities/wslu
sudo apt install wslusudo apt update
sudo apt full-upgrade
sudo apt install ubuntu-restricted-extrassudo dpkg-reconfigure locales
sudo locale-gen es_ES.UTF-8
export LANG=es_ES.UTF-8
echo "export LANG=es_ES.UTF-8" >> .zshrc
man -Les man
man mansudo apt install -y tmux git unzip curl wget fail2ban
sudo apt install -y ncdu
sudo apt install -y software-properties-common apt-transport-https
sudo apt install -y ssh
sudo apt install -y pssh
# htop, nvtop, ctop
sudo apt install -y atop
sudo apt install -y htop
sudo apt install -y nvtop
sudo apt install -y bashtop
sudo apt install -y glances
sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.7/ctop-0.7.7-linux-amd64 -O /usr/local/bin/ctop
sudo chmod +x /usr/local/bin/ctop
# sudo apt install -y ctop
# Mouse in ubuntu server (General Purpose Mouse interface)
sudo apt install -y gpm
# hardware
sudo apt install hwinfo
# iostat
sudo apt install -y nmon sysstat
# nmon documentation https://www.ibm.com/docs/en/aix/7.2?topic=n-nmon-command
sudo apt install net-tools network-managersudo apt install -y acl
# Guardar los permisos en un archivo
getfacl -R /ruta/del/directorio > permisos_backup.acl
# Restaurar los permisos más tarde
setfacl --restore=permisos_backup.aclsudo apt install -y auditd
# Gestionar demonio
sudo systemctl start auditd
sudo systemctl enable auditd
sudo systemctl status auditd
# Comprobar soporte para del kernel, puede no tener soporte y no poder auditar
cat /proc/cmdline
# Si ves audit=0, significa que la auditoría está deshabilitada. Para habilitarla, agrega audit=1 a los parámetros del kernel en /etc/default/grub y actualiza GRUB:
# Crear un logger asociado a un programa
sudo auditctl -w /usr/bin/docker -p x -k docker_run_exec
# Busqueda por el logger
sudo ausearch -k docker_run_exec
# Mostrar logs
grep "docker run" /var/log/auth.log # Debian/Ubuntu
# Mostrar los usuarios en ejecutar docker recientemente
grep "docker" /var/log/auth.log | awk '{print $1, $2, $3, $NF}'sudo apt install -y screenHow to use screen command
Iniciar una sesión con screen en una máquina remota
screen -S nombre_sesionDesconectarse de la sesión iniciada y de la máquina remota
nonodev96@maquina_remota:~$ foo
SALIDA COMANDO foo
CTRL+a d
[detached from nombre_sesion]
nonodev96@maquina_remota:~$ exit
logout
Connection to maquina_remota closed.
nonodev96@maquina_local:~$
Volver a conectarse a una sesión iniciada en la máquina remota
screen -r nombre_sesionCerrar una sesión de screen
nonodev96@maquina_remota:~$ bar
SALIDA bar
La ejecución finalizó sin errores.
nonodev96@maquina_remota:~$
CTRL+a k
[screen is terminating]
nonodev96@maquina_remota:~$ exit
logout
Connection to maquina_remota closed.
nonodev96@maquina_local:~$wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.debsudo apt install build-essential gdbsudo apt install -y needrestart apt-listchanges apt-listbugs apt-show-versions
sudo apt install -y lynis
sudo lynis audit system
sudo apt install -y chkrootkit
sudo chkrootkit
sudo apt install -y libpam-tmpdir debsums
sudo ufw enable
sudo apt-get install clamav clamav-daemon
sudo systemctl stop clamav-freshclam
sudo freshclam
sudo systemctl start clamav-freshclam
sudo systemctl enable clamav-freshclam
curl -s "https://get.sdkman.io" | bashwget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /opt/miniconda-installer.sh
bash /opt/miniconda-installer.shcurl https://pyenv.run | bashDependencies and configuration
sudo apt install python3-pip# dependencies
sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-devAdd to ~/.bashrc or ~/.zshrc
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"Install Anaconda (Optional)
sudo apt install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
Manual installing and updating
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bashsh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"plugins=(git zsh-syntax-highlighting zsh-autosuggestions zsh-completions)
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
curl -sS https://download.spotify.com/debian/pubkey_0D811D58.gpg | sudo apt-key add -
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt update && sudo apt install spotify-clientsudo snap install vlcsudo apt-get install apt-transport-https ca-certificates curl gnupg
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.iowget https://files.devwithlando.io/lando-stable.deb
sudo dpkg -i lando-stable.debwget https://packages.microsoft.com/config/ubuntu/22.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-7.0
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-7.0sudo apt update
sudo apt upgrade
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustc --version# gparted
sudo apt install gparted
# evolution
sudo apt install evolution
# clamav
sudo apt install clamav
# ulauncher
sudo add-apt-repository ppa:agornostal/ulauncher && sudo apt update && sudo apt install ulauncher
# typora
wget -qO - https://typora.io/linux/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/typora.asc
sudo add-apt-repository 'deb https://typora.io/linux ./' && sudo apt-get update && sudo apt-get install typora
sudo dpkg -i DEB_PACKAGEfunction cd() {
builtin cd "$@"
if [[ -z "$VIRTUAL_ENV" ]] ; then
## If env folder is found then activate the vitualenv
if [[ -d ./.env ]] ; then
source ./.env/bin/activate
fi
if [[ -d ./venv ]] ; then
source ./venv/bin/activate
fi
else
## check the current folder belong to earlier VIRTUAL_ENV folder
# if yes then do nothing
# else deactivate
parentdir="$(dirname "$VIRTUAL_ENV")"
if [[ "$PWD"/ != "$parentdir"/* ]] ; then
deactivate
fi
fi
}