Skip to content

Instantly share code, notes, and snippets.

View listx's full-sized avatar

Linus Arver listx

View GitHub Profile
@dims
dims / run-kubekins-e2e-shell.sh
Last active February 12, 2024 20:17
Drop into the shell inside kubekins-e2e container
# DO NOT TRY THIS ON A MAC or WSL2 :) use a ubuntu vm or something!
# Run the same kubekins container used in the CI job
IMAGE=gcr.io/k8s-staging-test-infra/kubekins-e2e:v20240209-82001bc8c5-main
# Create a temp directory for the DIND docker - see the baked in assumption in some of our images here - https://cs.k8s.io/?q=docker-graph&i=nope&files=&excludeFiles=&repos=kubernetes/test-infra
(sudo mkdir -p /tmp/docker-graph && sudo chmod -R 777 /tmp/docker-graph && cd /tmp/docker-graph && rm -rf *)
# Run as a privileged container, mount both the kubernetes directory and the docker-graph directory
docker run -e DOCKER_IN_DOCKER_ENABLED=true \
@jbott
jbott / build_falood_file_system_in_nix.md
Last active March 11, 2024 08:28
Building falood/file_system mac_listener in a nix environment

Building the Elixir package falood/file_system mac_listener binary in a nix environment

This confused me, so I'm documenting my workaround, which is probably not the correct workaround, but it seemed to work (leaving non-persistent state, lol).

When in a shell with mix and clang provided via nix, the file_system package fails to build the mac_listener binary via clang, with the error (reproduced in a shell):

$ clang -framework CoreFoundation -framework CoreServices -Wno-deprecated-declarations c_src/mac/*.c -o priv/mac_listener
In file included from c_src/mac/cli.c:2:
In file included from c_src/mac/cli.h:4:
@dimo414
dimo414 / _README.md
Last active November 28, 2022 07:25
Bash array expansion patterns for use with -u

Expanding Bash arrays safely with set -u

Prior to Bash 4.4 set -u treated empty arrays as "unset", and terminates the process. There are a number of possible workarounds using array parameter expansion, however almost all of them fail in certain Bash versions.

This gist is a supplement to this StackOverflow post.

@dino-
dino- / string-conversions.hs
Last active August 30, 2024 07:52
A handy illustration of converting between String, Text and ByteString in Haskell
#! /usr/bin/env stack
-- stack --resolver lts-18.8 script
{-# LANGUAGE OverloadedStrings #-}
{-
This is a handy illustration of converting between five of the commonly-used
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy
Text).
@skwair
skwair / grpc_graceful.go
Created May 1, 2018 12:04
gRPC Graceful stop with context.
// shutdown adds a context.Context to the GracefulStop method of
// grpc.Server, allowing to set a timeout before calling Stop.
func shutdown(ctx context.Context, s *grpc.Server) error {
ok := make(chan struct{})
// NOTE: GracefulStop will return instantly
// when Stop it called, preventing this
// goroutine from leaking.
go func() {
s.GracefulStop()
close(ok)
@knadh
knadh / zsh-elapsed-time.md
Last active May 30, 2024 12:32
Elapsed and execution time for commands in ZSH

Elapsed and execution time display for commands in ZSH

Append this to your ~/.zshrc file.

function preexec() {
 timer=$(($(date +%s%0N)/1000000))
@matthewtckr
matthewtckr / PDI-CE-Remove-OSGI.md
Last active August 12, 2018 13:47
Remove OSGI from PDI 6.0 Client

Note:

Unsupported configuration, some functionality (Hadoop, MongoDB, etc) may be lost by removing OSGI. That said, this makes PDI start up much, much quicker

Steps:

Required:

  • Remove plugins/pentaho-big-data-plugin