Skip to content

Instantly share code, notes, and snippets.

View redbaron's full-sized avatar

Maxim Ivanov redbaron

View GitHub Profile
@redbaron
redbaron / Dockerfile
Created August 15, 2023 09:33
Local telegraf build
FROM golang:1.21 AS build
WORKDIR /app
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build,rw go mod download
COPY . ./
@redbaron
redbaron / .gitdepsignore
Last active July 12, 2022 14:34
Unreal on Mac minimal setup
# add this to the root of UE clone as .gitdepsignore to reduce download size
# every line is turned into regex by converting globs (*, **, ?) to a regex ([^/]*, .*, .).
# every line starting with / is prefixed with ^
# every line NOT ending with / has suffix $
ThirdParty/CEF3/
ThirdParty/ICU/
# ThirdParty/Mono/Mac
ThirdParty/PhysX3/
Python*/
ThirdParty/svn/
@redbaron
redbaron / example.yaml
Last active March 24, 2020 13:06
Ansible jsonnet filter
- name: Load kube-apiserver.yaml
slurp:
src: "{{tmpconfdir.path}}/etc/kubernetes/manifests/kube-apiserver.yaml"
register: "apiserver_yaml"
# Implement https://github.com/kubernetes/kubeadm/issues/1105#issuecomment-544887733
- name: Patch apiserver healthcheck
vars:
mixin: |
{spec+: {containers: [super.containers[0] + {
# Writing component at 'components/generic-app'
# Error reading /tmp/tmp.QYGj9CyWkO/app/environments/default/main.jsonnet: INTERNAL ERROR: (CRASH) runtime error: index out of range
# goroutine 1 [running]:
# runtime/debug.Stack(0xc42651a8e8, 0x10a5180, 0x1988130)
# /usr/local/go/src/runtime/debug/stack.go:24 +0xa7
# github.com/ksonnet/ksonnet/vendor/github.com/google/go-jsonnet.(*VM).evaluateSnippet.func1(0xc426521828)
# /go/src/github.com/ksonnet/ksonnet/vendor/github.com/google/go-jsonnet/vm.go:94 +0x6e
# panic(0x10a5180, 0x1988130)
# /usr/local/go/src/runtime/panic.go:491 +0x283
# github.com/ksonnet/ksonnet/vendor/github.com/google/go-jsonnet.(*interpreter).evaluate(0xc420369d60, 0x193c680, 0xc420b29580, 0x1, 0x4, 0xc420b31710, 0x0, 0x0)
Dec 11 17:36:25 internal1-worker1 multipathd[8579]: 3600a09804d542d744d2b4871417a4a52 Last path deleted, disabling queueing
Dec 11 17:36:25 internal1-worker1 multipathd[8579]: 3600a09804d542d744d2b4871417a4a52: map in use
Dec 11 17:36:25 internal1-worker1 multipathd[8579]: 3600a09804d542d744d2b4871417a4a52: can't flush
Dec 11 17:36:25 internal1-worker1 multipathd[8579]: 3600a09804d542d744d2b4871417a4a52: config error, overriding 'no_path_retry' value
Dec 11 17:36:25 internal1-worker1 multipathd[8579]: flush_on_last_del in progress
Dec 11 17:36:25 internal1-worker1 multipathd[8579]: 3600a09804d542d744d2b4871417a4a52: load table [0 62914560 multipath 3 pg_init_retries 50 retain_attached_hw_handler 0 0 0]
Dec 11 17:36:25 internal1-worker1 multipathd[8579]: flush_on_last_del in progress
Dec 11 17:36:25 internal1-worker1 multipathd[8579]: sdg [8:96]: path removed from map 3600a09804d542d744d2b4871417a4a52
Dec 11 17:36:25 internal1-worker1 multipathd[8579]: sdh: remove path (uevent)
Dec 11 17:36:25 internal1-worker
@redbaron
redbaron / nginx_broken.conf
Created May 12, 2016 12:37
Minimal config which breaks openresty lua parser
worker_processes auto;
events {}
worker_rlimit_nofile 11240;
daemon off;
pid /var/run/nginx.pid;
#############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
<source>
@type tail
path /fluentd/log/main.log
format none
tag x
</source>
<match **>
@type file
path /fluentd/log/output.log
This file has been truncated, but you can view the full file.
# tracer: function_graph
#
# CPU DURATION FUNCTION CALLS
# | | | | | | |
0) 0.045 us | } /* up_write */
0) 2.670 us | } /* vma_link */
0) 0.086 us | uprobe_mmap();
0) | vma_set_page_prot() {
0) 0.060 us | vma_wants_writenotify();
0) 0.330 us | }
let
pkgs = import <nixpkgs> {};
stdenv = pkgs.useGoldLinker pkgs.clangStdenv;
in with builtins; stdenv.mkDerivation {
name = "metaproc";
src = ./.;
buildInputs = [
pkgs.re2
pkgs.libyamlcpp
-module(gcd).
-export([gcd/2, gcd_test/0]).
-spec gcd(integer(), integer()) -> integer().
gcd(A, 0) when is_integer(A)-> A;
gcd(A, B) when is_integer(A), is_integer(B) -> gcd(B, A rem B).
gcd_test() ->
10 = gcd(10, 0),