Skip to content

Instantly share code, notes, and snippets.

View tuna2134's full-sized avatar
🌙
眠たい

tuna2134@コマリン親衛隊 tuna2134

🌙
眠たい
View GitHub Profile

k3s + wireguard cluster

Install wireguard

apt-get install wireguard-tools

Generate wireguard key

Generate private key

Manifests

apiVersion: sharding.k8s.io/auto
kind: AutoShardingBot
metadata:
  name: komari-sama
  labels:
    app: sukisuki
spec:
 metadata:
INTERFACE=eth0
clear
echo "[+] checking packages" && sudo apt-get update > /dev/null && sudo apt-get install wireguard qrencode jq -y > /dev/null &&
echo "[+] creating keypars" && rm -rf /etc/wireguard/keypars && mkdir /etc/wireguard/keypars &&
wg genkey | sudo tee -a /etc/wireguard/keypars/server.key > /dev/null
sudo cat /etc/wireguard/keypars/server.key | wg pubkey | tee -a /etc/wireguard/keypars/server.pub > /dev/null
wg genkey | tee -a /etc/wireguard/keypars/client.key > /dev/null
sudo cat /etc/wireguard/keypars/client.key | wg pubkey | tee -a /etc/wireguard/keypars/client.pub > /dev/null
echo "[+] creating config files"
sudo cat <<EOF > /etc/wireguard/wg0.conf
use std::{env, sync::Arc};
use tokio::task::JoinSet;
use twilight_gateway::{Event, Intents, Shard, ShardId};
use twilight_http::Client as HttpClient;
use twilight_model::http::interaction::{InteractionResponse, InteractionResponseData, InteractionResponseType};
use vesper::framework::Framework;
use vesper::prelude::*;
#[command]
#[description = "テスト"]

Message forward API

My memo docs

Example payload

{
    "message_reference": {
        "type": 1,
        "channel_id": 111111111111111111,
        "guild_id": 111111111111111111,
struct {};
#[view]
impl NewView {
#[button(name = "hello", style = ButtonStyle.green)]
async fn hello(&self, interaction: Interaction, button: Button) -> anyhow::Result<()> {
interaction.response.send_message("hello").await?;
Ok(())
}
}

Keybase proof

I hereby claim:

  • I am tuna2134 on github.
  • I am tuna2134 (https://keybase.io/tuna2134) on keybase.
  • I have a public key ASA3-omlV3svhtuo5tolVhVSJ3xKqZ_gC6OOUvqxUgiK8Ao

To claim this, I am signing this object:

name: Renovatebot auto-merge
on:
pull_request:
permissions:
contents: write
pull-requests: write
jobs:
#/bin/bash -eu
cat /etc/fstab | sed /swap/d | tee /etc/fstab
swapoff -a
# Install Containerd
cat <<EOF | tee /etc/modules-load.d/containerd.conf
overlay
br_netfilter
EOF
FROM rust:slim AS builder
WORKDIR /src/builder
RUN apt-get update && apt-get install -y musl-tools
ARG TARGETARCH
RUN if [ $TARGETARCH = "amd64" ]; then \
echo "x86_64" > /tmp/arch; \
elif [ $TARGETARCH = "arm64" ]; then \