Skip to content

Instantly share code, notes, and snippets.

View Alevsk's full-sized avatar
🐇
Follow the white rabbit

Lenin Alevski Alevsk

🐇
Follow the white rabbit
View GitHub Profile
@Alevsk
Alevsk / install-podman.yaml
Created September 4, 2023 18:15
This Website Is No Longer Running As The Root User: Replacing Docker With Podman
- hosts: "{{ HOSTS }}"
name: Install and configure podman and podman-compose
become: yes
tasks:
- name: Installing podman and podman-compose
ansible.builtin.apt:
name:
- podman
- podman-compose
state: latest
@Alevsk
Alevsk / CVE-2023-39059
Last active August 24, 2023 06:18
CVE-2023-39059
---------------------------------------------------------------
[VulnerabilityType Other]
Remote Command Execution (RCE)
---------------------------------------------------------------
[Affected Component]
@Alevsk
Alevsk / rotate-credentials-from-1password.yaml
Created March 28, 2023 06:09
Ansible playbook to fetch credentials from 1Password and then rotate user credentials
- hosts: "{{ HOSTS }}"
name: Rotate credentials
become: yes
vars:
root_password: "{{ lookup('pipe', 'op item get \"root user\" --fields password') }}"
user_password: "{{ lookup('pipe', 'op item get \"regular user\" --fields password') }}"
tasks:
- name: change user password
no_log: True
ansible.builtin.user:
@Alevsk
Alevsk / add-public-keys.yaml
Created March 28, 2023 06:07
Ansible playbook to install ssh public keys
- hosts: "{{ HOSTS }}"
name: Install authentication keys and certificates
become: yes
tasks:
- name: install public keys
register: pub_keys_installed
ansible.posix.authorized_key:
exclusive: yes
user: "{{ ansible_user }}"
@Alevsk
Alevsk / install-docker.yaml
Last active March 28, 2023 06:07
Ansible playbook to install docker
- hosts: "{{ HOSTS }}"
name: Install Docker
become: yes
vars:
docker_group: docker
tasks:
- name: Install apt-transport-https
ansible.builtin.apt:
name:
- apt-transport-https
#!/bin/sh
node=${1}
if [ -n "${node}" ]; then
nodeSelector='"nodeSelector": { "kubernetes.io/hostname": "'${node:?}'" },'
else
nodeSelector=""
fi
set -x
kubectl run ${USER+${USER}-}sudo --restart=Never -it \
--image overriden --overrides '
@Alevsk
Alevsk / main.go
Last active December 31, 2021 03:44
This is part of my post "Just enough cryptography for better securing your apps"
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/hmac"
"crypto/rand"
"crypto/sha1"
"crypto/sha256"
"encoding/base64"

Keybase proof

I hereby claim:

  • I am alevsk on github.
  • I am alevsk (https://keybase.io/alevsk) on keybase.
  • I have a public key ASBoNZUOO7tZVhnH3TLpVV1-Clcy18vFHjpsxSmv-qzTTwo

To claim this, I am signing this object: