Skip to content

Instantly share code, notes, and snippets.

Avatar

Radek Gruchalski radekg

View GitHub Profile
@radekg
radekg / Dockerfile
Created Jun 15, 2021
YugabyteDB multi-stage build
View Dockerfile
FROM centos:7.9.2009 as builder
ARG YB_VERSION=2.7.1.1
RUN yum update -y && yum install -y wget curl \
&& wget https://downloads.yugabyte.com/yugabyte-${YB_VERSION}-linux.tar.gz -O /yugabyte-${YB_VERSION}-linux.tar.gz
FROM centos:7.9.2009
ARG GID=1060
ARG GROUPNAME=myybuser
ARG UID=1060
@radekg
radekg / Certificates.go
Created Mar 24, 2021 — forked from Mattemagikern/Certificates.go
Create x509 certificate chain using Golang. Root CA, Designated CA, server CA
View Certificates.go
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
@radekg
radekg / cloud.cfg
Created Mar 21, 2021 — forked from imduffy15/cloud.cfg
Cloud-init config example for using the none data source provider to setup a box for usage with vagrant on finding no cloud metadata service.
View cloud.cfg
disable_ec2_metadata: True
datasource_list: [ "ConfigDrive", "None"]
datasource:
None:
userdata_raw: |
#!/bin/bash
groupadd vagrant
useradd -d /home/vagrant -s /bin/bash -m -g vagrant -G wheel vagrant
echo "root:vagrant" | chpasswd
@radekg
radekg / lru.go
Last active Apr 11, 2021
Simple LRU
View lru.go
package main
import (
"fmt"
"sync"
)
type item struct {
next *item
previous *item
@radekg
radekg / notes.md
Last active Mar 12, 2018
Kubernetes notes
View notes.md

calico: hostname must be all lowercase

Calico requires the node name to be lowercase. Maybe that's obvious knolwedge but all other components have no problems handling uppercase characters. Error:

[root@k8s-kube-w-8djLQqtkAHJZvaOa centos]# docker ps -a
CONTAINER ID        IMAGE                                      COMMAND             CREATED              STATUS                     PORTS               NAMES
327fa0492135        quay.io/calico/node                        "start_runit"       3 seconds ago        Exited (1) 2 seconds ago                       k8s_calico-node_calico-node-k257k_kube-system_24149352-2567-11e8-94a0-02c64064058a_3
994fe7650e97        quay.io/calico/cni                         "/install-cni.sh"   41 seconds ago       Up 40 seconds                                  k8s_install-cni_calico-node-k257k_kube-system_24149352-2567-11e8-94a0-02c64064058a_0
94122e279a5a        gcr.io/google_containers/pause-amd64:3.0   "/pause"            About a minute ago   Up About a 
@radekg
radekg / reinvent-2017-youtube.md
Created Dec 7, 2017 — forked from stevenringo/reinvent-2017-youtube.md
Links to YouTube recordings of AWS re:Invent 2017 sessions
View reinvent-2017-youtube.md

| Title | Description

View gist:91a8468fc6b26de7420b243b617e55af
Source: https://news.ycombinator.com/item?id=13198567
Always, always, always generate your own SSH moduli.
reply
notyourwork 4 hours ago [-]
For those uninformed you should expand on this to. It is a great suggestion but a statement like this to a uninformed isn't very helpful.
reply
@radekg
radekg / AsyncUtil.java
Last active Apr 13, 2017
Java AsyncUtil.eventually(...) tests
View AsyncUtil.java
package com.gruchalski.testing;
import java.util.UUID;
import java.util.concurrent.*;
import static org.testng.Assert.fail;
public class AsyncUtil {
protected AsyncUtil() {}
@radekg
radekg / .spacemacs
Last active Aug 16, 2016
Emacs for lispy stuff
View .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@radekg
radekg / marathon-infra-helpers.md
Last active Jan 19, 2016
Marathon infra helpers
View marathon-infra-helpers.md

Get mesos working directory from config:

WORKING_DIR=$(cat /etc/mesos-slave/mesos.conf | grep '\-\-work_dir' | awk -F'=' '{print $2}')

Get current slave ID:

SLAVE_ID=$(basename $(readlink $WORKING_DIR/meta/slaves/latest))

Get Marathon ID: