Skip to content

Instantly share code, notes, and snippets.

View wouterds's full-sized avatar
:octocat:
Hello world!

Wouter De Schuyter wouterds

:octocat:
Hello world!
View GitHub Profile
@wouterds
wouterds / system-json.sh
Created August 26, 2024 14:57
Get Linux Debian system stats as a json string
#!/bin/bash
# Get used RAM percentage
ram_used=$(free | awk '/Mem:/ {printf "%.2f", $3/$2 * 100}')
# Get average CPU usage percentage
cpu_used=$(top -bn2 -d 0.5 | grep "Cpu(s)" | tail -n 1 | awk '{print $2 + $4}')
# Get used disk space percentage across all disks
disk_used=$(df -h --total | awk '/total/ {print $5}' | sed 's/%//')
@wouterds
wouterds / system.sh
Created August 26, 2024 14:50
Get Linux Debian system stats
#!/bin/bash
# Get used RAM percentage
ram_used=$(free | awk '/Mem:/ {printf "%.2f", $3/$2 * 100}')
# Get average CPU usage percentage
cpu_used=$(top -bn2 -d 0.5 | grep "Cpu(s)" | tail -n 1 | awk '{print $2 + $4}')
# Get used disk space percentage across all disks
disk_used=$(df -h --total | awk '/total/ {print $5}' | sed 's/%//')
@wouterds
wouterds / docker-compose.yml
Created August 25, 2024 09:25
Ethereum full node using Docker
services:
geth:
image: ethereum/client-go:latest
container_name: geth
restart: unless-stopped
ports:
- "30303:30303/tcp"
- "30303:30303/udp"
- "8545:8545"
volumes:
openapi: 3.0.3
info:
description: Endpoints used by the Mobile App.
version: 3.0.0
title: Mobile API
servers:
- url: https://mobile.api.prd.itsme.services/v3
description: Production
- url: https://mobile.api.e2e.itsme.services/v3
description: E2E
{
"name": "gewoon-genieten-met-play7",
"items": [
{
"id": "tag:telenet.be:paramedics",
"title": "Paramedics",
"synopsis": "",
"seasons": [],
"images": {
"cover": "https://i.imgur.com/QxbZJrl.jpg",
{
"name": "moet-je-zien",
"items": [
{
"id": "tag:telenet.be:demo:de-mol",
"title": "De Mol",
"synopsis": "",
"seasons": [],
"images": {
"cover": "https://i.imgur.com/GTFHSYN.jpg",
{
"name": "nu-op-play5",
"items": [
{
"id": "tag:telenet.be:demo:the-rookie-feds",
"title": "The Rookie: Feds",
"synopsis": "",
"seasons": [],
"images": {
"cover": "https://i.imgur.com/ymUul4f.jpg",
{
"name": "voorproefje-streamz",
"items": [
{
"id": "tag:telenet.be:demo:big-little-lies",
"title": "Big Little Lies",
"synopsis": "",
"seasons": [],
"images": {
"cover": "https://i.imgur.com/FWeCvON.jpg",
sudo chown -R code:code /home/code
sudo chmod 600 /home/code/.ssh/id_rsa
sudo chmod 600 /home/code/.ssh/id_rsa.pub
sudo chmod 600 /home/code/.ssh/id_rsa.pem
sudo chmod 600 /home/code/.ssh/authorized_keys
sudo chmod 700 /home/code/.ssh
00:000 00:000 OC: OpenCore DBG-069-2021-05-03 is loading in Optional mode (0/0)...
00:110 00:110 OC: Boot timestamp - 2021.05.05 20:43:39
00:194 00:083 OCCPU: MP services threads 8 (enabled 8) - Success
00:224 00:030 OCCPU: MP services Pkg 1 Cores 4 Threads 2 - Success
00:254 00:030 OCCPU: Found Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
00:284 00:030 OCCPU: Signature 506E3 Stepping 3 Model 5E Family 6 Type 0 ExtModel 5 ExtFamily 0 uCode C2
00:313 00:029 OCCPU: EIST CFG Lock 1
00:343 00:029 OCCPU: TSC Adjust 0
00:373 00:029 OCCPU: Known Model Core Crystal Clock Frequency 24000000Hz
00:403 00:030 OCCPU: CPUFrequencyFromART 4008000000Hz 4008MHz = 24000000 * 334 / 2