Skip to content

Instantly share code, notes, and snippets.

View dadajuice's full-sized avatar
🦇
confusius nebaram neko-chan

David Tucker dadajuice

🦇
confusius nebaram neko-chan
  • Cégep de Sorel-Tracy
  • Sorel-Tracy
View GitHub Profile
@dadajuice
dadajuice / tls_self_signed.md
Created March 5, 2020 18:08
Configuration TLS Debian

TLS (self signed)

sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt

Entrez les informations demandées et assurez-vous d'indiquer votre adresse IP pour Common Name (e.g. server FQDN or YOUR name).

Par la suite, créez un fichier de configurations SSL

sudo vi /etc/apache2/conf-available/ssl-params.conf
@dadajuice
dadajuice / debian_lamp_setup.md
Last active October 18, 2021 19:47
Debian configuration LAMP (PHP 8.0)

Pré-requis

Installation de sudo

su -
update-alternatives --set editor /usr/bin/vim.basic 
apt-get update
apt-get upgrade
apt-get install sudo
@dadajuice
dadajuice / github-multiple-ssh-deploy-keys.md
Created February 26, 2020 15:39
GitHub multiple SSH deploy keys configuration

Problem

GitHub doesn't allow a single SSH deploy key to be used for multiple repositories which make sense from a security stand point. So if you want one server to access multiple repositories with SSH keys, you need to create a specific SSH configuration with aliases to address each repository.

Solution (for authenticated user)

The following solution concerns a user currently logged into the server shell. The whole procedure will make sure that the user can do git commands accessing the remote repository on GitHub (e.g. pull, fetch, branch, etc.). Of course depending on the deploy key setting on GitHub.

  1. Create SSH keys for multiple repositories

By default, the SSH keys registered for a user (private and public) is stored into the hidden folder .ssh located in the user's home directory. The default ssh key is named id_rsa. While creating the keys, it should be renamed using the repository name as suffix. When they asked the save path, make sure to retype the path and use a significant suf

@dadajuice
dadajuice / postgres-install.md
Last active February 24, 2020 16:29
Installation et configuration PostgreSQL

Base de données (PostgreSQL)

Installation

sudo apt-get install postgresql postgresql-contrib

Configuration des rôles

Depuis la console PostgreSQL sudo -u postgres psql, ajouter les rôles nécessaires.