Skip to content

Instantly share code, notes, and snippets.

View simi's full-sized avatar
🇨🇿

Josef Šimánek simi

🇨🇿
View GitHub Profile
@simi
simi / rotate.md
Last active March 21, 2024 19:42

Reforger mission rotation

NOTICE: Both scripts will rotate missions without checking state of previous game. That means on server crash next mission in list will be started from scratch. Use at your own risk.

Windows (PowerShell)

Originally posted by Uro at https://discord.com/channels/105462288051380224/976119935875026964/979127368973168690.

I wrote a PowerShell script that server admins using Windows can implement to programmatically change the server.json config file to switch missions/implement a mission rotation.

meta:
id: paa
file-extension: paa
endian: le
seq:
- id: type
type: u2
enum: pax_type
- id: tags
Mode: Workbench
Command line: "Z:\home\retro\.var\app\com.valvesoftware.Steam\.local\share\Steam\steamapps\common\Arma Reforger Tools\Workbench\ArmaReforgerWorkbench.exe" -EnableWARP
Exception: Access violation. Illegal read by 0x151553f at 0x646979f65470
[QString::fromUtf16]: ??? addr:0x151553f
[QString::fromWCharArray]: ??? addr:0x1458d08
[qt_plugin_query_metadata]: ??? addr:0x2d3141b
[qt_plugin_query_metadata]: ??? addr:0x2d2ee8d
[qt_plugin_query_metadata]: ??? addr:0x2d26a04
[qt_plugin_query_metadata]: ??? addr:0x2d28648
require 'thread'
require 'logger'
POOL_SIZE = 10 # limit for HTTP parallel connections
QUEUE_SIZE = 5 # limit to consume only fixed amount of memory
queue = SizedQueue.new(QUEUE_SIZE)
logger = Logger.new($stdout)
END_MESSAGE = :done
ERROR_MESSAGE = :error

Arma Reforger Grok setup

Originally posted by Uro at https://discord.com/channels/105462288051380224/976119935875026964/984473643033690122.


I went into this having not set up Grafana/influxDB or telegraf before, only using Grafana from an end-user perspective, but I do have years of experience in running servers both using Windows and Linux, these applications are natively Linux but do have Windows installers available, so anyone familiar with configuring things in Linux will be aware of how complicated things can be, especially if you have not read the docs.

If your looking to do similar, it does take some setup and configuring so I'd assume you are comfortable setting these sorts of things up and that you have read the docs for telegraf, influxDB and Grafana and how they can work together, they are really well documented so it is worth following their Installation and Getting Started sections as a bare minimum, otherwise you will :blobkeyboardheadsmash: .

require 'thread'
require 'logger'
POOL_SIZE = 10 # limit for HTTP parallel connections
QUEUE_SIZE = 5 # limit to consume only fixed amount of memory
queue = SizedQueue.new(QUEUE_SIZE)
logger = Logger.new($stdout)
END_MESSAGE = :done
class MyEnumerator
include Enumerable
attr_writer :args
attr_writer :size
attr_reader :generator
attr_reader :lookahead
class MyEnumerator
attr_reader :scope, :block, :opened, :headers
def initialize(scope, headers, &block)
@scope = scope
@block = block
@opened = false
@cursor = PostgreSQLCursor::Cursor.new(scope.send(:to_unprepared_sql))
@headers = headers
@headers_provided = false
# INFO: works well with Ruby 3.0.1
# hangs on any Ruby including https://github.com/ruby/ruby/commit/f9196de1dee6f5ab8b6fe115070b92775a3500fe
# since the yielding code in each method is running in different Fiber (due to be wrapped into Enumerator and next is used)
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }