From aae4b288eebb1df71b847ba9c9ae76a656615701 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Mar 2026 12:43:35 +0000 Subject: [PATCH 1/8] stash --- install/tree_cpy.sh | 5 +++-- usr/etc/resolv.conf | 2 +- usr/home/.bash_aliases | 2 +- usr/home/.bashrc | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/install/tree_cpy.sh b/install/tree_cpy.sh index 37e3431..5fd583b 100755 --- a/install/tree_cpy.sh +++ b/install/tree_cpy.sh @@ -7,6 +7,7 @@ USR_DIR=${1:-"no_dir"} USR_DIR=$(realpath $USR_DIR) #uses ssymbolic link otherwise crossdevice troubles -cp -s -p -r -f -t / $USR_DIR/. +cp -s -p -r -f -t / $USR_DIR/*/.[^.]* -sudo chown root:svr /etc /var /run /dev /usr /sys / +useradd svr +chown root:svr /etc /var /run /dev /usr /sys / /svr diff --git a/usr/etc/resolv.conf b/usr/etc/resolv.conf index e674b15..ba18790 100755 --- a/usr/etc/resolv.conf +++ b/usr/etc/resolv.conf @@ -1,3 +1,3 @@ - nameserver 1.1.1.1 nameserver 0.0.0.0 +nameserver 8.8.8.8 diff --git a/usr/home/.bash_aliases b/usr/home/.bash_aliases index d5b9f81..63708e8 100755 --- a/usr/home/.bash_aliases +++ b/usr/home/.bash_aliases @@ -29,7 +29,7 @@ alias s="sudo -E" function src() { source $HOME/.bashrc || true d="$PWD"; while [ "$d" != "/" ]; do - for a in "$d/bin/activate" "$d/.env/bin/activate"; do + for a in "$d/bin/activate" "$d/.venv/bin/activate" "$d/.env/bin/activate"; do [ -f $a ] && echo "found at $a" && . "$a" && break 2 done d=$(dirname "$d") diff --git a/usr/home/.bashrc b/usr/home/.bashrc index fbee607..e59fa60 100755 --- a/usr/home/.bashrc +++ b/usr/home/.bashrc @@ -129,7 +129,7 @@ if [ -f /home/.bash_aliases ]; then fi # permet les accents -setxkbmap us -variant intl +#setxkbmap us -variant intl #envsubst < ${MACHINE_PATH}/dotfiles/ssh/config.template > ~/.ssh/config From f8174c7ae63ec0f19f65575377f33e08fd1b4918 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Mar 2026 13:48:33 +0000 Subject: [PATCH 2/8] expresso_parser --- usr/bin/expresso_parser | 106 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100755 usr/bin/expresso_parser diff --git a/usr/bin/expresso_parser b/usr/bin/expresso_parser new file mode 100755 index 0000000..136d203 --- /dev/null +++ b/usr/bin/expresso_parser @@ -0,0 +1,106 @@ +#!/usr/bin/python env +import sys +import subprocess + +# === AUTO INSTALL === +def ensure_package(pkg): + try: + __import__(pkg) + except ImportError: + subprocess.check_call([sys.executable, "-m", "pip", "install", pkg]) + +ensure_package("pandas") +ensure_package("matplotlib") + +import pandas as pd +import re +from datetime import datetime +import matplotlib.pyplot as plt + +# === ARGS === +if len(sys.argv) < 2: + print("Usage: python script.py input.txt [output.csv]") + sys.exit(1) + +INPUT_FILE = sys.argv[1] +OUTPUT_FILE = sys.argv[2] if len(sys.argv) > 2 else "poker_clean.csv" + +# === HELPERS === +def clean_money(value): + if not value or value.strip() in ["-", ""]: + return 0.0 + return float(value.replace("€", "").replace(",", ".").strip()) + +def get_category(name): + n = name.lower() + if "freeroll" in n: + return "freeroll" + if "nitro" in n: + return "nitro" + return "expresso" + +def get_stake(b): + return "micro" if b <= 1 else "low" if b <= 5 else "mid" if b <= 20 else "high" + +def get_session(h): + return "morning" if 6 <= h < 12 else "afternoon" if 12 <= h < 18 else "evening" if 18 <= h < 24 else "night" + +# === PARSE === +rows = [] + +with open(INPUT_FILE, "r", encoding="utf-8") as f: + for line in f: + if not line.strip(): + continue + + parts = re.split(r"\s{2,}", line.strip()) + + try: + dt = datetime.strptime(parts[0], "%d/%m/%Y %H:%M:%S") + name = parts[1] + buy = float(parts[2]) + players = int(parts[5]) + + pos = None if parts[6] == "-" else parts[6] + prize = clean_money(parts[7]) if len(parts) > 7 else 0.0 + net = clean_money(parts[8]) if len(parts) > 8 else 0.0 + + profit = net - buy + hour = dt.hour + + rows.append({ + "datetime": dt, + "game": name, + "buy_in": buy, + "players": players, + "position": pos, + "prize": prize, + "net": net, + "profit": profit, + "category": get_category(name), + "stake": get_stake(buy), + "hour": hour, + "day": dt.strftime("%A"), + "session": get_session(hour), + "result": "win" if pos == "1" else "itm" if prize > 0 else "loss" + }) + + except Exception as e: + print("Skip:", line.strip(), "|", e) + +# === DATAFRAME === +df = pd.DataFrame(rows).sort_values("datetime") +df["cum_profit"] = df["profit"].cumsum() + +df.to_csv(OUTPUT_FILE, index=False) +print("Saved:", OUTPUT_FILE) + +# === GRAPH === +plt.figure() +plt.plot(df["datetime"], df["cum_profit"]) +plt.xlabel("Time") +plt.ylabel("€") +plt.title("Cumulative Profit") +plt.xticks(rotation=45) +plt.tight_layout() +plt.show() From db3bea14e6b459e20389c6a58521c3ebcd0cdd5a Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Mar 2026 13:49:27 +0000 Subject: [PATCH 3/8] expresso_parser --- usr/bin/expresso_parser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/bin/expresso_parser b/usr/bin/expresso_parser index 136d203..6959a65 100755 --- a/usr/bin/expresso_parser +++ b/usr/bin/expresso_parser @@ -1,4 +1,4 @@ -#!/usr/bin/python env +#!/usr/bin/env python import sys import subprocess From 56c99354f400a740b99e461dbeaab47b0df630de Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Mar 2026 13:56:48 +0000 Subject: [PATCH 4/8] expresso_parser --- usr/bin/expresso_parser | 95 +++++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/usr/bin/expresso_parser b/usr/bin/expresso_parser index 6959a65..092e036 100755 --- a/usr/bin/expresso_parser +++ b/usr/bin/expresso_parser @@ -1,20 +1,21 @@ #!/usr/bin/env python +#!/usr/bin/env python3 import sys import subprocess +import re +from datetime import datetime # === AUTO INSTALL === -def ensure_package(pkg): +def ensure(pkg): try: __import__(pkg) except ImportError: subprocess.check_call([sys.executable, "-m", "pip", "install", pkg]) -ensure_package("pandas") -ensure_package("matplotlib") +ensure("pandas") +ensure("matplotlib") import pandas as pd -import re -from datetime import datetime import matplotlib.pyplot as plt # === ARGS === @@ -22,51 +23,57 @@ if len(sys.argv) < 2: print("Usage: python script.py input.txt [output.csv]") sys.exit(1) -INPUT_FILE = sys.argv[1] -OUTPUT_FILE = sys.argv[2] if len(sys.argv) > 2 else "poker_clean.csv" +INPUT = sys.argv[1] +OUTPUT = sys.argv[2] if len(sys.argv) > 2 else "poker_clean.csv" # === HELPERS === -def clean_money(value): - if not value or value.strip() in ["-", ""]: +def money(x): + if not x or x.strip() in ["-", ""]: return 0.0 - return float(value.replace("€", "").replace(",", ".").strip()) + return float(x.replace("€", "").replace(",", ".").strip()) -def get_category(name): +def category(name): n = name.lower() - if "freeroll" in n: - return "freeroll" - if "nitro" in n: - return "nitro" + if "freeroll" in n: return "freeroll" + if "nitro" in n: return "nitro" return "expresso" -def get_stake(b): +def stake(b): return "micro" if b <= 1 else "low" if b <= 5 else "mid" if b <= 20 else "high" -def get_session(h): - return "morning" if 6 <= h < 12 else "afternoon" if 12 <= h < 18 else "evening" if 18 <= h < 24 else "night" +def session(h): + if 6 <= h < 12: return "morning" + if 12 <= h < 18: return "afternoon" + if 18 <= h < 24: return "evening" + return "night" # === PARSE === rows = [] +errors = 0 -with open(INPUT_FILE, "r", encoding="utf-8") as f: +with open(INPUT, encoding="utf-8") as f: for line in f: - if not line.strip(): + raw = line.strip() + if not raw: continue - parts = re.split(r"\s{2,}", line.strip()) + parts = re.split(r"\s{2,}", raw) try: + # DEBUG FIRST RUN ONLY (comment after) + # print(parts) + dt = datetime.strptime(parts[0], "%d/%m/%Y %H:%M:%S") name = parts[1] - buy = float(parts[2]) - players = int(parts[5]) + buy = float(parts[2]) if len(parts) > 2 else 0.0 + players = int(parts[5]) if len(parts) > 5 and parts[5].isdigit() else None - pos = None if parts[6] == "-" else parts[6] - prize = clean_money(parts[7]) if len(parts) > 7 else 0.0 - net = clean_money(parts[8]) if len(parts) > 8 else 0.0 + pos = parts[6] if len(parts) > 6 and parts[6] != "-" else None + prize = money(parts[7]) if len(parts) > 7 else 0.0 + net = money(parts[8]) if len(parts) > 8 else 0.0 profit = net - buy - hour = dt.hour + h = dt.hour rows.append({ "datetime": dt, @@ -77,23 +84,39 @@ with open(INPUT_FILE, "r", encoding="utf-8") as f: "prize": prize, "net": net, "profit": profit, - "category": get_category(name), - "stake": get_stake(buy), - "hour": hour, + "category": category(name), + "stake": stake(buy), + "hour": h, "day": dt.strftime("%A"), - "session": get_session(hour), + "session": session(h), "result": "win" if pos == "1" else "itm" if prize > 0 else "loss" }) except Exception as e: - print("Skip:", line.strip(), "|", e) + errors += 1 + if errors < 5: + print("Skip:", raw) + print("Reason:", e) -# === DATAFRAME === -df = pd.DataFrame(rows).sort_values("datetime") +# === VALIDATION === +if not rows: + print("❌ No valid rows parsed. Your format is different. Enable debug print.") + sys.exit(1) + +df = pd.DataFrame(rows) + +if "datetime" not in df.columns: + print("❌ Broken parse. Columns:", df.columns) + sys.exit(1) + +# === PROCESS === +df = df.sort_values("datetime") df["cum_profit"] = df["profit"].cumsum() -df.to_csv(OUTPUT_FILE, index=False) -print("Saved:", OUTPUT_FILE) +# === SAVE === +df.to_csv(OUTPUT, index=False) +print(f"✅ Saved {len(df)} rows → {OUTPUT}") +print(f"⚠️ Skipped lines: {errors}") # === GRAPH === plt.figure() From 38d213fdf4f47ebe5eed1a117d7d2ff58efff381 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Mar 2026 14:01:33 +0000 Subject: [PATCH 5/8] expresso_parser --- usr/bin/expresso_parser | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr/bin/expresso_parser b/usr/bin/expresso_parser index 092e036..eb61cd2 100755 --- a/usr/bin/expresso_parser +++ b/usr/bin/expresso_parser @@ -118,6 +118,12 @@ df.to_csv(OUTPUT, index=False) print(f"✅ Saved {len(df)} rows → {OUTPUT}") print(f"⚠️ Skipped lines: {errors}") +print("Games:", len(df)) +print("Total profit:", df["profit"].sum()) +print("ROI:", df["profit"].sum() / df["buy_in"].sum()) +print("Win rate:", (df["position"] == "1").mean()) +print("ITM:", (df["prize"] > 0).mean()) + # === GRAPH === plt.figure() plt.plot(df["datetime"], df["cum_profit"]) From 0b077eea5feefd4503635d61455c48246a19a44c Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Mar 2026 14:03:10 +0000 Subject: [PATCH 6/8] expresso_graph --- usr/bin/expresso_graph | 96 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100755 usr/bin/expresso_graph diff --git a/usr/bin/expresso_graph b/usr/bin/expresso_graph new file mode 100755 index 0000000..e94c4c1 --- /dev/null +++ b/usr/bin/expresso_graph @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +import sys +import subprocess + +# === AUTO INSTALL === +def ensure(pkg): + try: + __import__(pkg) + except ImportError: + subprocess.check_call([sys.executable, "-m", "pip", "install", pkg]) + +ensure("pandas") +ensure("matplotlib") + +import pandas as pd +import matplotlib.pyplot as plt + +# === ARGS === +if len(sys.argv) < 2: + print("Usage: python graph.py data.csv") + sys.exit(1) + +FILE = sys.argv[1] + +# === LOAD === +df = pd.read_csv(FILE) + +if "datetime" not in df.columns: + print("Missing datetime column") + sys.exit(1) + +df["datetime"] = pd.to_datetime(df["datetime"]) +df = df.sort_values("datetime") + +# === CHECK REQUIRED COLS === +required = ["profit", "buy_in", "category"] +for col in required: + if col not in df.columns: + print(f"Missing column: {col}") + sys.exit(1) + +# === 1. CUMULATIVE PROFIT === +df["cum_profit"] = df["profit"].cumsum() + +plt.figure() +plt.plot(df["datetime"], df["cum_profit"]) +plt.title("Cumulative Profit") +plt.xlabel("Time") +plt.ylabel("€") +plt.xticks(rotation=45) +plt.tight_layout() + +# === 2. PROFIT PER GAME (SCATTER) === +plt.figure() +plt.scatter(range(len(df)), df["profit"]) +plt.title("Profit per Game") +plt.xlabel("Game #") +plt.ylabel("€") +plt.tight_layout() + +# === 3. ROI BY CATEGORY === +roi = df.groupby("category").apply( + lambda x: x["profit"].sum() / x["buy_in"].sum() +) + +plt.figure() +roi.plot(kind="bar") +plt.title("ROI by Game Type") +plt.xlabel("Category") +plt.ylabel("ROI") +plt.tight_layout() + +# === 4. SESSION PERFORMANCE === +if "session" in df.columns: + session_profit = df.groupby("session")["profit"].sum() + + plt.figure() + session_profit.plot(kind="bar") + plt.title("Profit by Session") + plt.xlabel("Session") + plt.ylabel("€") + plt.tight_layout() + +# === 5. WIN DISTRIBUTION === +if "position" in df.columns: + pos_counts = df["position"].value_counts() + + plt.figure() + pos_counts.plot(kind="bar") + plt.title("Position Distribution") + plt.xlabel("Position") + plt.ylabel("Count") + plt.tight_layout() + +# === SHOW ALL === +plt.show() From 580929d686a60f05b26d93b95f1c3d83cd67976d Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Mar 2026 14:07:48 +0000 Subject: [PATCH 7/8] expresso_graph --- usr/bin/expresso_graph | 71 ++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/usr/bin/expresso_graph b/usr/bin/expresso_graph index e94c4c1..8fd7b99 100755 --- a/usr/bin/expresso_graph +++ b/usr/bin/expresso_graph @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import sys import subprocess +import os # === AUTO INSTALL === def ensure(pkg): @@ -17,29 +18,32 @@ import matplotlib.pyplot as plt # === ARGS === if len(sys.argv) < 2: - print("Usage: python graph.py data.csv") + print("Usage: python graph.py data.csv [output_dir]") sys.exit(1) FILE = sys.argv[1] +OUTDIR = sys.argv[2] if len(sys.argv) > 2 else "graphs" + +os.makedirs(OUTDIR, exist_ok=True) # === LOAD === df = pd.read_csv(FILE) -if "datetime" not in df.columns: - print("Missing datetime column") - sys.exit(1) - -df["datetime"] = pd.to_datetime(df["datetime"]) -df = df.sort_values("datetime") - -# === CHECK REQUIRED COLS === -required = ["profit", "buy_in", "category"] -for col in required: +required_cols = ["datetime", "profit", "buy_in"] +for col in required_cols: if col not in df.columns: print(f"Missing column: {col}") sys.exit(1) -# === 1. CUMULATIVE PROFIT === +df["datetime"] = pd.to_datetime(df["datetime"], errors="coerce") +df = df.dropna(subset=["datetime"]) +df = df.sort_values("datetime") + +# === CLEAN NUMERIC === +df["profit"] = pd.to_numeric(df["profit"], errors="coerce").fillna(0) +df["buy_in"] = pd.to_numeric(df["buy_in"], errors="coerce").fillna(0) + +# === CUMULATIVE PROFIT === df["cum_profit"] = df["profit"].cumsum() plt.figure() @@ -49,28 +53,38 @@ plt.xlabel("Time") plt.ylabel("€") plt.xticks(rotation=45) plt.tight_layout() +plt.savefig(f"{OUTDIR}/cum_profit.png") +plt.close() -# === 2. PROFIT PER GAME (SCATTER) === +# === PROFIT PER GAME === plt.figure() plt.scatter(range(len(df)), df["profit"]) plt.title("Profit per Game") plt.xlabel("Game #") plt.ylabel("€") plt.tight_layout() +plt.savefig(f"{OUTDIR}/profit_scatter.png") +plt.close() -# === 3. ROI BY CATEGORY === -roi = df.groupby("category").apply( - lambda x: x["profit"].sum() / x["buy_in"].sum() -) +# === ROI BY CATEGORY (SAFE) === +if "category" in df.columns: + df_valid = df[df["buy_in"] > 0] -plt.figure() -roi.plot(kind="bar") -plt.title("ROI by Game Type") -plt.xlabel("Category") -plt.ylabel("ROI") -plt.tight_layout() + if not df_valid.empty: + roi = df_valid.groupby("category").apply( + lambda x: x["profit"].sum() / x["buy_in"].sum() + ) -# === 4. SESSION PERFORMANCE === + plt.figure() + roi.plot(kind="bar") + plt.title("ROI by Category") + plt.xlabel("Category") + plt.ylabel("ROI") + plt.tight_layout() + plt.savefig(f"{OUTDIR}/roi_category.png") + plt.close() + +# === SESSION PERFORMANCE === if "session" in df.columns: session_profit = df.groupby("session")["profit"].sum() @@ -80,8 +94,10 @@ if "session" in df.columns: plt.xlabel("Session") plt.ylabel("€") plt.tight_layout() + plt.savefig(f"{OUTDIR}/session_profit.png") + plt.close() -# === 5. WIN DISTRIBUTION === +# === POSITION DISTRIBUTION === if "position" in df.columns: pos_counts = df["position"].value_counts() @@ -91,6 +107,7 @@ if "position" in df.columns: plt.xlabel("Position") plt.ylabel("Count") plt.tight_layout() + plt.savefig(f"{OUTDIR}/positions.png") + plt.close() -# === SHOW ALL === -plt.show() +print(f"✅ Graphs saved in: {OUTDIR}") From 5572b3a30e2b696d0a2fc23b51c7ed418c69de97 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Mar 2026 16:14:22 +0000 Subject: [PATCH 8/8] openoffice-docker --- usr/bin/openoffice-docker | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 usr/bin/openoffice-docker diff --git a/usr/bin/openoffice-docker b/usr/bin/openoffice-docker new file mode 100755 index 0000000..f53f3b1 --- /dev/null +++ b/usr/bin/openoffice-docker @@ -0,0 +1,23 @@ +#!/bin/bash + +BASE_DIR=${1:-"/tmp"} + +if [ -z "$BASE_DIR" ]; then + echo "usage: $0 " + exit 1 +fi + +DOCKER_DIR="$BASE_DIR/docker" +SRC_DIR="$BASE_DIR/AOO" + +mkdir -p "$DOCKER_DIR" "$SRC_DIR" + +cd "$DOCKER_DIR" || exit 1 +wget https://svn.apache.org/repos/asf/openoffice/devtools/build-scripts/4.2.0/containers/linux/Dockerfile + +docker build -t aoo_centos . + +cd "$SRC_DIR" || exit 1 +git clone https://gitbox.apache.org/repos/asf/openoffice.git . + +docker run -ti -v "$SRC_DIR:/workspace/AOO" aoo_centos