Skip to content

Instantly share code, notes, and snippets.

@markasoftware
markasoftware / enterprise_token.rb
Last active May 18, 2024 09:26
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
@walm
walm / 1_server-stats-json.sh
Last active January 28, 2024 17:11
Simple Linux Server stats as JSON
#!/bin/sh
echo -n '{'
# memory as "mem": { "current": 800, "total": 1024, "load", 82 } where amount is in MB and load in %
free -m | awk 'NR==2{printf "\"mem\": { \"current\":%d, \"total\":%d, \"load\": %.2f }", $3,$2,$3*100/$2 }'
echo -n ','
# diska as "disk": { "current": 6, "total": 40, "used": 19 } where amount is in GB and used in %
df -h | awk '$NF=="/"{printf "\"disk\": { \"current\":%d, \"total\":%d, \"used\": %d }", $3,$2,$5}'