Skip to content

Instantly share code, notes, and snippets.

apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-gitlab-managed-apps-prometheus-server
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
claimRef:
#!/bin/bash -xe
[ -f /usr/local/bin/gitlab-runner ] || curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
chmod +x /usr/local/bin/gitlab-runner
gitlab-runner register -n \
--url https://gitlab.com \
--registration-token qwerty \
--executor docker \
--description "dind runner" \
#!/bin/bash -xe
cat << EOF > /etc/systemd/system/log-dns-query.service
[Unit]
Description=dns
[Service]
ExecStart=/bin/sh -c "script -q -c \"tcpdump -l port 53 2>/dev/null | grep --line-buffered ' A? ' | cut -d' ' -f8\" | tee -a /var/log/dns.log"
[Install]
#!/bin/bash -xe
cat << EOF > runner-values.yaml
---
concurrent: 4
checkInterval: 3
rbac:
create: true
clusterWideAccess: false
runners:
cat << EOF > config
DRIVE1 /dev/nvme0n1
DRIVE2 /dev/nvme1n1
SWRAID 1
SWRAIDLEVEL 0
BOOTLOADER grub
HOSTNAME $(hostname)
@egeneralov
egeneralov / oneshot.sh
Created September 23, 2019 03:06
egeneralov.nginx + acme.sh
DOMAIN=e-xample.com
PROXY_TO=127.0.0.1:8427
cat << EOF > nginx.yml
---
- hosts: ${DOMAIN}
vars:
upstreams:
@egeneralov
egeneralov / ansible_openssl_CA_example.yml
Created September 19, 2019 04:56
Generate a chain (self signed + one signed by the self signed) of certificates using Ansible OpenSSL module.
---
- hosts: localhost
gather_facts: no
# # darwin
# vars:
# ansible_python_interpreter: /usr/local/bin/python
tasks:
- block:
- apt:
#!/bin/bash -xe
# debian[-based]
apt-get update -q
apt-get install -yq gnupg2 curl apt-transport-https default-jre
curl -sL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" > /etc/apt/sources.list.d/elastic.list
@egeneralov
egeneralov / fast_copy_vm_to_new_vm.sh
Created July 3, 2019 09:20
Just note for juniors
# variables for run
NAME=cloudflare.com
SRCIP=1.1.1.1
# delete droplet
doctl compute droplet delete "${NAME}" --force
# create new droplet
doctl compute droplet create \
#!/bin/sh
# Random UUID for this config
vpnUuid=``
# Address of VPN server
serverName=""
# The group of usernames that is allowed in
groupName=""
# The name of connection type displayed in GUI
labelName=""