Skip to content

Instantly share code, notes, and snippets.

View svenikea's full-sized avatar
🏠
Working from home

John Wick svenikea

🏠
Working from home
View GitHub Profile
@svenikea
svenikea / apache _ssl.md
Last active August 28, 2020 15:29
How to enable SSL/TLS on Apache web server on Arch Linux

First we need to obtain a certificate

Generate an RSA private key

openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:keysize -out file

If an encrypted key is desired, use the -aes-256-cbc option.

Generate a certificate signing request

openssl req -new -sha256 -key private_key -out filename

Generate a self-signed certificate

openssl req -key private_key -x509 -new -days days -out filename

@svenikea
svenikea / Arch_install.md
Last active February 15, 2023 04:02
Arch Linux Installation guide

Arch Linux Installation guide

Update the system clock

timedatectl set-ntp true

To check the service status, use timedatectl status

Optional

timedatectl set-timezone America/Los_Angeles
@svenikea
svenikea / daemon.json
Created March 12, 2021 06:31
Example Docker daemon.json
{
"api-cors-header": "",
"authorization-plugins": [],
"bip": "",
"bridge": "",
"cgroup-parent": "",
"cluster-store": "",
"cluster-store-opts": {},
"cluster-advertise": "",
"debug": true,

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@svenikea
svenikea / docker-clean.md
Created April 14, 2021 05:58 — forked from kuznero/docker-clean.md
Cleanup docker images and containers after failed builds

Cleanup docker images and containers after failed builds

Sometimes, there are some untagged images left behind after failed builds. In order to get rid of those, this script can be used.

#!/bin/bash
docker rm $(docker ps -aq)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
@svenikea
svenikea / docker-compose.yml
Last active June 30, 2022 12:34
docker compose
version: '3'
volumes:
wordpress:
db:
services:
wordpress:
image: wordpress:5.7.1-fpm-alpine
container_name: ${WP_CONTAINER_NAME}
@svenikea
svenikea / cloudSettings
Last active December 4, 2021 06:29
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-12-04T06:29:50.248Z","extensionVersion":"v3.4.3"}

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@svenikea
svenikea / gist:19506a20b572503e1ce10a9a6b759361
Last active June 14, 2022 01:55
AWS CLoudfront IP ranges
{
# us-east-1
"3.231.2.0/25"
"3.234.232.224/27",
"3.236.169.192/26",
"3.236.48.0/23",
"34.195.252.0/24",
"34.226.14.0/24",
# us-east-2
@svenikea
svenikea / README.md
Created December 26, 2022 13:57 — forked from reegnz/README.md
Using terraform for_each and toset instead of count

Using terraform for_each and toset instead of count

Using terraform count and the pain of working with it

If you're using terraform extensively you probably ran into an issue like this.

This is a synthetic example but I still hope the problem is recognizable as something that also happens out in the wild.

First, you have a list variable (in terraform.tfvars)