Skip to content

Instantly share code, notes, and snippets.

View afahounko's full-sized avatar

Danny afahounko

  • Red Hat
  • Paris - France
View GitHub Profile
@afahounko
afahounko / README.md
Created January 24, 2024 19:18 — forked from mosquito/README.md
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@afahounko
afahounko / content.md
Created January 12, 2024 05:48 — forked from Mishco/content.md
Setup HashiCorp Vault on docker

Setup HashiCorp Vault on docker

Vault secures, stores, and tightly controls access to tokens, passwords, certificates, API keys, and other secrets in modern computing. Vault is primarily used in production environments to manage secrets. Vault is a complex system that has many different pieces. There is a clear separation of components that are inside or outside of the security barrier. Only the storage backend and the HTTP API are outside, all other components are inside the barrier.

Vault_architecture

Figure 1: Architecture of Vault and Spring App (Click to enlarge)

The storage backend is untrusted and is used to durably store encrypted data. When the Vault server is started, it must be provided with a storage backend so that data is available across restarts. The HTTP API similarly must be started by the Vault server on start so that clients can interact with it.

@afahounko
afahounko / k3s_helm_install.sh
Created July 5, 2023 11:48 — forked from icebob/k3s_helm_install.sh
K3S + Helm installing
# Install K3S
curl -sfL https://get.k3s.io | sh -
# Copy k3s config
mkdir $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chmod 644 $HOME/.kube/config
# Check K3S
kubectl get pods -n kube-system
@afahounko
afahounko / curl-websocket.sh
Created January 22, 2023 03:57 — forked from htp/curl-websocket.sh
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@afahounko
afahounko / useApi.ts
Created October 26, 2022 20:25 — forked from mortezasabihi/useApi.ts
Vue 3 axios composition api
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { reactive, toRefs } from 'vue';
import axios,{ AxiosRequestConfig, AxiosError, AxiosResponse } from 'axios';
export enum Status {
IDLE = 'idle',
LOADING = 'loading',
SUCCESS = 'success',
ERROR = 'error',
@afahounko
afahounko / Dynamic Ansible Roles.md
Created August 23, 2022 12:11 — forked from karlvr/Dynamic Ansible Roles.md
Ansible playbook example of running roles dynamically by including a list of role names in a host's vars

I have a heterogenous set of hosts and a mix of different roles that I want to apply to each host. Using groups would mean creating a group for nearly every role, which felt like overkill.

This combination of a playbook and two task scripts runs the roles specified in the host's required_roles variable, in order. It supports a tag named after the role, to run the specific role, and a tag role-partial to activate the role but to require other tags to activate specific tasks in the role (helpful when debugging roles).

@afahounko
afahounko / mount_qcow2.md
Created January 9, 2022 09:37 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@afahounko
afahounko / ipv6_proxmox_online.net.md
Created May 4, 2021 14:33 — forked from zwindler/ipv6_proxmox_online.net.md
Configuring IPv6 block from Online.net On Proxmox Host and Guests

Configuring IPv6 block from Online.net On Proxmox Host and Guests

Following the documentation on online.net would get IPv6 to work only in a simple system installation but won't get IPv6 to work with virtualization environment (Exp. Proxmox) as It's missing some IPv6 forwards and proxies on sysctl.conf.

On Proxmox Host (Or Debian if single Debian Installation)

Enable IPv6 on the System:

  • Change Module Options to Enable IPv6:
@afahounko
afahounko / local_wait.yml
Created July 6, 2020 06:53 — forked from sheldonh/local_wait.yml
Wait for SSH to come up in an Ansible playbook
---
- hosts: demo
tags: wait
gather_facts: no
tasks:
- name: Wait for SSH
local_action: wait_for port=22 host={% if ansible_ssh_host is defined %}{{ ansible_ssh_host }}{% else %}{{ inventory_hostname }}{% endif %}
@afahounko
afahounko / How to use Images as Radio buttons.md
Created January 12, 2020 15:27 — forked from rcotrina94/How to use Images as Radio buttons.md
How to use images for radio buttons (input-radio).