Removing Aldente configurations

rm -rf ~/Library/Application\ Support/Aldente

Removing Chrome configurations

rm -rf ~/Library/Google rm -rf ~/Library/Application\ Support/Google rm -rf ~/Library/Caches/Google rm -rf ~/Library/Preferences/com.google.*

Removing Firefox configurations

rm -rf ~/Library/Mozilla rm -rf ~/Library/Application\ Support/Firefox rm -rf ~/Library/Application\ Support/Mozilla rm -rf ~/Library/Caches/Firefox rm -rf ~/Library/Preferences/org.mozilla*

Removing Slack configurations

rm -rf ~/Library/Application\ Support/Slack/ rm -rf ~/Library/Containers/com.tinyspeck.slackmacgap/ rm -rf ~/Library/Preferences/com.tinyspeck.slackmacgap.plist rm -rf ~/Library/Saved\ Application\ State/com.tinyspeck.slackmacgap.savedState rm ~/Library/Safari/LocalStorage/*slack*

A liar user dir in Apache on Ubuntu

Change your_username by your username.

cd /home/your_username mkdir Sites cd /var/www/html sudo ln -s /home/your_username/Sites your_username

Go to your user site:

http://localhost/your_username

Extending SSH connection time

sudo nano "ClientAliveCountMax 2" >> /etc/ssh/sshd_config sudo nano "ClientAliveInterval 120" >> /etc/ssh/sshd_config

Wordpress and PHP 8 on macOS

echo "pcre.jit=0" >> /opt/homebrew/etc/php/8.1/php.ini brew services restart php sudo apachectl restart

In wp-config.php configure DB_HOST as 127.0.0.1 =)

Create MySQL user on macOS

USE mysql; CREATE USER 'your_username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password'; GRANT ALL PRIVILEGES ON * . * TO 'your_username'@'localhost'; FLUSH PRIVILEGES;

MySQL on macOS

brew install mysql brew services start mysql mysql -uroot

Creating a ssh key

ssh-keygen -t ed25519

LoadModule php7_module libexec/apache2/libphp7.so

Add the following lines:

LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so
<FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch>

Configure DirectoryIndex section as follow:

<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>

Then:

brew services restart php sudo apachectl restart

Installing Symfony CLI

  • debian:

    echo 'deb [trusted=yes] https://repo.symfony.com/apt/ /' | sudo tee /etc/apt/sources.list.d/symfony-cli.list sudo apt update sudo apt install symfony-cli

  • macOS:

    brew install symfony-cli/tap/symfony-cli

Apache and PHP on debian

aptitude update aptitude install apache2 ca-certificates apt-transport-https echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add - aptitude update aptitude install php8.1

LoadModule include_module libexec/apache2/mod_include.so LoadModule rewrite_module libexec/apache2/mod_rewrite.so LoadModule php7_module libexec/apache2/libphp7.so Include /private/etc/apache2/extra/httpd-userdir.conf Include /private/etc/apache2/other/*.conf LoadModule authn_core_module libexec/apache2/mod_authn_core.so LoadModule authz_host_module libexec/apache2/mod_authz_host.so LoadModule userdir_module libexec/apache2/mod_userdir.so

Edit the file:

sudo nano /etc/apache2/extra/httpd-userdir.conf

Uncomment the following line:

Include /private/etc/apache2/users/*.conf

Then:

mkdir ~/Sites sudo nano /etc/apache2/users/your_username.conf

Configure as follow:

<Directory "/Users/your_username/Sites/"> AllowOverride All Options Indexes MultiViews FollowSymLinks Require all granted </Directory>

Restart Apache:

sudo apachectl restart

Go to your user site:

http://localhost/~your_username

Adding Homebrew to macOS

Change your_username by your username.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/your_username/.zprofile

Emacs on macOS

brew tap railwaycat/emacsmacport brew install --cask emacs-mac

Git completion on macOS

Add to .zprofile the following lines:

zstyle ':completion:*:*:git:*' script /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash # `compinit` scans $fpath, so do this before calling it. fpath=(/Library/Developer/CommandLineTools/usr/share/git-core $fpath) autoload -Uz compinit && compinit

macOS Terminal keybindings for Home and End

Go to Preferences > Profiles > Keyboard then:

  • Home: update ^← from \033[1;5D to \001
  • End:     update ^→ from \033[1;5C to \005

Starting up MySQL when the server is being powered on

sudo systemctl enable mysql

Basic LaTeX installation

  • macOS: brew install basictex
  • debian: aptitude install texlive-latex-base -R

If you don't want to install you can try Online LaTeX Editor Overleaf =)