Skip to content

Instantly share code, notes, and snippets.

View allquixotic's full-sized avatar
🎯
Focusing

Sean McNamara allquixotic

🎯
Focusing
View GitHub Profile
@allquixotic
allquixotic / run_bepinex.sh
Created June 10, 2024 12:39
MacOS run_bepinex.sh for Valheim
#!/bin/sh
# BepInEx start script
#
# Run the script to start the game with BepInEx enabled
#
# There are two ways to use this script
#
# 1. Via CLI: Run ./run_bepinex.sh <path to game> [doorstop arguments] [game arguments]
# 2. Via config: edit the options below and run ./run.sh without any arguments
[OOC] Ulio Berneir: ===EVENT BEGINS===
[OOC] Ulio Berneir: <It is the morning after your heroic rescue of Belhom Harfort. The lordling was returned safe and sound to Harfort manor, much to relief of Lord Harfort (though of course, he was kinda sour and shout-ey anyway).
[OOC] Ulio Berneir: <Some breakfast was brought in earlier today, courtesy of Priestess Angelle.>
[OOC] Ulio Berneir: (feel free to emote)
Cantia Cara sits at the table, writing diligently in her journal with a cup of coffee.
Endiri Leondril continues munching on the breakfast that Thes'is brought her, petting her spider and writing notes about the little fellow in her journal
Ulio Berneir: "Everyone had breakfast?" Ulio asks the room.
Cantia Cara: "Mhm!"
Endiri Leondril with full cheeks like a chipmunk, she nods to Ulio
Bjarkë Ranrike would keep drinking his mead until its empty. "I'd rather eat rats."
error[E0599]: the method `try_init` exists for struct `SubscriberBuilder<DefaultFields, Format, tracing::level_filters::LevelFilter, std::sync::Mutex<MultiWriter>>`, but its trait bounds were not satisfied
--> src/main.rs:131:10
|
131 | .try_init().expect("setting default subscriber failed");
| ^^^^^^^^ method cannot be called on `SubscriberBuilder<DefaultFields, Format, tracing::level_filters::LevelFilter, std::sync::Mutex<MultiWriter>>` due to unsatisfied trait bounds
|
::: /Users/sean/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.16/src/fmt/fmt_layer.rs:62:1
|
62 | / pub struct Layer<
63 | | S,
@allquixotic
allquixotic / main.rs
Created January 23, 2023 07:24
another jsonrpc failure
use jsonrpsee::{http_client::{HttpClientBuilder, HttpClient}, ws_client::HeaderMap, core::{Error, __reexports::serde::Deserialize}, proc_macros::rpc};
use dotenvy::var;
#[derive(Deserialize)]
pub struct LoginResponse {
session_id: String,
}
#[rpc(client)]
trait Api {
@allquixotic
allquixotic / Python requests + jsonrpcclient - Request Body
Created January 19, 2023 01:30
Enjin API in Rust (broken) vs. Python (works)
POST /api/v1/api.php HTTP/1.1
Host: www.enjin.com
User-Agent: python-requests/2.28.2
Accept-Encoding: gzip, deflate, br
Accept: */*
Connection: keep-alive
Content-Length: 131
Content-Type: application/json
{
@allquixotic
allquixotic / main.rs
Created January 18, 2023 13:56
jsonrpsee logging issue
use jsonrpsee::{http_client::HttpClientBuilder};
use dotenvy::var;
use jsonrpsee::{core::{Error}, proc_macros::rpc};
#[rpc(client)]
pub trait User
{
#[method(name = "User.login", param_kind = map, blocking)]
fn login(&self, email: String, password: String) -> Result<String, Error>;
}
$ DONTRUN=web RUST_BACKTRACE=1 cargo +nightly run
Compiling reminder_rs v1.6.10 (/home/user/reminder-rs)
warning: unused variable: `tzid`
--> src/time_parser.rs:214:61
|
214 | CalendarDateTime::WithTimezone { date_time, tzid } => Some(date_time.timestamp()),
| ^^^^ help: try ignoring the field: `tzid: _`
|
= note: `#[warn(unused_variables)]` on by default
@allquixotic
allquixotic / test.md
Last active December 1, 2021 02:25
UDP network test

Tested with BSD NetCat, not nmap project's NCat!

CLIENT

IP=CHANGEME ; for ((i=1; i<=600;i++)); do echo "$i: Received at $(date '+%s')." | netcat -4unNw1 ${IP} 15384; done

SERVER

Ubuntu 20.04.3

echo "$(dig +short myip.opendns.com @resolver1.opendns.com)"; netcat -vulknp 15384

Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
CPU Family: 0x6
======================
Proton: 1589341500 5.0-7
SteamGameId: 1213210
Command: ['/home/sean/.local/share/Steam/steamapps/common/CnCRemastered/ClientLauncherG.exe', 'DUMP_FULL']
Options: {'forcelgadd'}
======================
ERROR: ld.so: object '/home/sean/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/sean/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/sean/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/sean/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.