Skip to content

Instantly share code, notes, and snippets.

@DoumanAsh
DoumanAsh / ls-errors.json
Last active March 1, 2024 08:32
nushell ls bug
[
{
"type": "error",
"code": "unknown",
"details": "Error extracting glob pattern"
},
{
"type": "file",
"size": 1501,
"modified": "2023-08-16 10:35:36.158743465 +09:00"
@DoumanAsh
DoumanAsh / alacritty.toml
Created February 21, 2024 07:14
Alacritty workaround for tmux tabs
# Mac OS settings with tmux
[shell]
program = "/opt/homebrew/bin/tmux"
args = [
"new-session",
"-A",
"-D",
"-s",
"main"
@DoumanAsh
DoumanAsh / termination.rs
Created February 14, 2024 10:58
tokio's signal handler to await termination
use core::future::Future;
use core::pin::Pin;
use core::task;
use std::io;
///Future that resolves when program is requested to terminate
#[must_use = "Future does nothing without polling"]
pub struct Termination {
#[cfg(unix)]
term: tokio::signal::unix::Signal,
@DoumanAsh
DoumanAsh / acme.sh
Last active February 12, 2024 01:26
Simple nginx config to hide redis behind TLS proxy (includes minimal configuration to run acme.sh)
# Make sure to create folder /www and grant write access to nginx and yourself
$DOMAIN="your domain"
# Create file structure to serve static file with challenge
sudo mkdir /www
sudo mkdir /www/.well-known/
sudo mkdir /www/.well-known/acme-challenge
sudo chown nginx /www/.well-known/acme-challenge
#As example grant group write permission (e.g. you want www to belong to nginx user and anyone in nginx group) do:
@DoumanAsh
DoumanAsh / waker.rs
Created February 10, 2024 02:59
AtomicWaker
use core::{ptr, task, hint, mem};
use core::cell::UnsafeCell;
use core::sync::atomic::{AtomicBool, AtomicU8, Ordering};
mod noop {
use core::{ptr, task};
const VTABLE: task::RawWakerVTable = task::RawWakerVTable::new(clone, action, action, action);
const WAKER: task::RawWaker = task::RawWaker::new(ptr::null(), &VTABLE);
@DoumanAsh
DoumanAsh / sample.log
Created February 6, 2024 06:33
kube-state-metrics with filter --resources=pods,cronjobs,jobs
# HELP kube_cronjob_annotations Kubernetes annotations converted to Prometheus labels.
# TYPE kube_cronjob_annotations gauge
# HELP kube_cronjob_labels [STABLE] Kubernetes labels converted to Prometheus labels.
# TYPE kube_cronjob_labels gauge
# HELP kube_cronjob_info [STABLE] Info about cronjob.
# TYPE kube_cronjob_info gauge
kube_cronjob_info{namespace="default",cronjob="demo",schedule="* * * * *",concurrency_policy="Forbid"} 1
# HELP kube_cronjob_created [STABLE] Unix creation timestamp
# TYPE kube_cronjob_created gauge
kube_cronjob_created{namespace="default",cronjob="demo"} 1.707200821e+09
@DoumanAsh
DoumanAsh / sasl_plain.md
Last active March 21, 2024 02:07
Kafka TLS config

Variables:

  • KAFKA_HOSTNAME - Hostname with your kafka service;
  • USERNAME - username;
  • PASSWORD - password

Kafka

@DoumanAsh
DoumanAsh / test.md
Last active February 11, 2023 09:01
We couldn’t find that file to show.
155:DataManager (extras):309:in `frame_count=': Argument 0: Expected fixnum, TypeError
from 155:DataManager (extras):309:in `on_after_load'
from 167:Default System Options Setup:77:in `on_after_load'
from 764:Self Switch Reset:63:in `on_after_load'
from 733:Scene_Title (custom):324:in `command_quickload'
from 062:Window_Selectable:212:in `call'
from 062:Window_Selectable:212:in `call_handler'
from 063:Window_Command:136:in `call_ok_handler'
from 062:Window_Selectable:322:in `process_ok'
from 296:Mouse Window Integration (CURRENT):304:in `process_handling'
import com.datastax.driver.core.exceptions.NoHostAvailableException;
import io.lettuce.core.RedisCommandExecutionException;
import org.slf4j.Logger;
import java.util.concurrent.Callable;
public class ExponentialBackoff {
private final long delay;
private final long maxAttempts;
private final Logger logger;