Skip to content

Instantly share code, notes, and snippets.

View tuna2134's full-sized avatar
๐ŸŒ™
็œ ใŸใ„

tuna2134 tuna2134

๐ŸŒ™
็œ ใŸใ„
View GitHub Profile
router id 172.16.70.1;
log syslog { info, remote, warning, error, auth, fatal, bug };
log stderr all;
debug protocols {events, states, interfaces};
graceful restart wait 15;
protocol kernel {
ipv4 {
import none;
from transformers import AutoModelForMaskedLM, AutoTokenizer
import torch
from torch import nn
class ORTDeberta(nn.Module):
def __init__(self, model_name):
super(ORTDeberta, self).__init__()
self.model = AutoModelForMaskedLM.from_pretrained(model_name)

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: