Skip to content

Instantly share code, notes, and snippets.

@Andor
Andor / components -- victoriametrics.jsonnet
Created December 29, 2022 10:11
qbec victoriametrics via helm
local p = import '../../params.libsonnet';
local params = p.components.victoriametrics;
local k = import '1.21/main.libsonnet';
local vm = importstr 'data://victoriametrics/github.com/VictoriaMetrics/helm-charts/raw/e075725ccd48f81e7794efb8119372f178be132f/packages/victoria-metrics-cluster-0.9.23.tgz';
local resources = {
local ns = k.core.v1.namespace,
namespace::
@Andor
Andor / components--victoriametrics.jsonnet
Last active October 7, 2021 11:03
qbec helm victoriametrics
local p = import '../../params.libsonnet';
local params = p.components.victoriametrics;
local k = import '1.21/main.libsonnet';
local vm = importstr 'data://victoriametrics/github.com/VictoriaMetrics/helm-charts/raw/347d4558d9c25cd341718bf5a2ee167da042c080/packages/victoria-metrics-cluster-0.9.6.tgz';
{
local ns = k.core.v1.namespace,
namespace::
@Andor
Andor / contain.pp
Last active September 16, 2021 16:30
puppet include vs require vs contain
class ntp {
file { '/etc/ntp.conf':
...
require => Package['ntp'],
notify => Class['ntp::service'],
}
contain ntp::service
}
class main {
@Andor
Andor / cloud-init-template.yaml
Created May 12, 2021 10:10
GKE Gitlab-runner with cloud-init
#cloud-config
package_update: true
package_upgrade: false # we will upgrade it with runcmd
fqdn: "${fqdn}"
apt:
primary:
- arches: [default]
@Andor
Andor / cc2538-and-openocd.md
Created November 10, 2020 07:56 — forked from hwhw/cc2538-and-openocd.md
Flashing CC2538 using OpenOCD (&UART)

Flashing CC2538 using OpenOCD (&UART)

Problem description

CC2538 SoCs are Cortex-M4 based SoCs by Texas Instruments for 802.15.4 PAN networking, especially for Zigbee communication using their Zigbee Stack solution. It also is a solid foundation for hobbyist-grade solutions involving Zigbee communication, especially for running a self-implemented Zigbee coordinator (often called "Zigbee gateway" in commercial distribution of similar tech). Software-wise, this is usually done by running "ZNP" (Zigbee Network Processor) firmware on the SoC and using a separate controller/computer to act as the "ZAP" (Zigbee Application Processor). In a hobbyist setting, the former is usually a cheap module from china containing the chip, capacitors and an antenna or antenna connector, while the latter is e.g. a Raspberry Pi or an Intel NUC or whatever floats your boat. The API between both components is specified and so the software side on the ZAP does not need to bother with Zigbee communication states but can act on a

@Andor
Andor / .gitlab-ci.yml
Last active February 28, 2023 15:03
terraform .gitlab-ci.yml
---
variables:
terraform_image: terraform-vault-jq
default:
image:
name: $terraform_image
cache:
key: terraform
paths:
@Andor
Andor / ansible-mysql-docker.yaml
Created October 7, 2019 16:01
Ansible Mysql Docker
- name: run mysql with docker container and wait for healthcheck pass
docker_container:
name: my-mysql
hostname: my-mysql
image: mysql/mysql-server # this image has healthchecks
env: "{{ mysql_docker_env }}"
volumes:
- "{{ mysql_data_directory }}/data:/var/lib/mysql"
- "{{ mysql_data_directory }}/logs:/var/log/mysqld"
- /var/run/mysqld:/var/run/mysqld # we will have ability to connect to mysql from host machine
PLAY [127.0.0.1] ***************************************************************
Tuesday 09 July 2019 16:42:06 +0000 (0:00:00.111) 0:00:00.111 **********
TASK [docker-py] ***************************************************************
changed: [127.0.0.1]
Tuesday 09 July 2019 16:42:11 +0000 (0:00:05.196) 0:00:05.307 **********
TASK [run container] ***********************************************************
changed: [127.0.0.1]
Tuesday 09 July 2019 16:42:13 +0000 (0:00:01.632) 0:00:06.940 **********
@Andor
Andor / cloud-init.template.yaml
Created June 26, 2019 12:55
teamcity-agent with logging to google cloud stackdriver
#cloud-config
package_update: true
package_upgrade: true
write_files:
- path: /etc/default/teamcity-agent
owner: root:root
permissions: '0644'
content: |
@Andor
Andor / devicemapper.sh
Last active June 20, 2019 11:21
script to scrape metrics from devicemapper, useful to use as metadata source
#!/bin/bash
set -e
set -o pipefail
prometheus_format=${DEVICEMAPPER_PROMETHEUS:-true} # influxdb format otherwise
function format_labels {
first=true
echo "$*" | tr , "\\n" | while read -r l; do