This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| # --- Configuration --- | |
| CONTAINER_NAME="octoprint" | |
| BACKUP_FILENAME="/tmp/octoprint-full-snapshot-$(date +%F).tar.gz" | |
| TEMP_DIR="/tmp/octoprint_backup_staging" | |
| # --- This script MUST be run as root/sudo --- | |
| if [ "$EUID" -ne 0 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # A plugin that registers a hotkey (Shift+W) to close pseudocode windows. | |
| # | |
| # HOW TO INSTALL AND USE: | |
| # 1. Save this file as "close_pseudocode_plugin.py". | |
| # 2. Find your IDA plugins directory. | |
| # 3. Copy the "close_pseudocode_plugin.py" and "ida_plugin.json" file into that directory. | |
| # 4. Restart IDA Pro. The hotkey will now be active. | |
| # 5. Press Shift+W anytime to run the script. | |
| import ida_kernwin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use an official Python runtime as a parent image | |
| FROM python:3.13-slim | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy the requirements file into the container at /app | |
| COPY requirements.txt . | |
| # Install any needed packages specified in requirements.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import random | |
| import os | |
| def memory_churn_for_debugging(): | |
| """ | |
| Allocates 2GB of string-like data, waits for a debugger to attach, | |
| then enters a maximum-speed loop to continuously and randomly modify the data. | |
| """ | |
| target_bytes = 2 * 1024 * 1024 * 1024 # 2 GB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| def fill_memory_with_strings(): | |
| """ | |
| Fills approximately 2GB of memory with unique strings. | |
| """ | |
| target_bytes = 2 * 1024 * 1024 * 1024 # 2 GB | |
| strings = [] | |
| total_size = 0 | |
| counter = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| llmx() { | |
| # If no query was provided, show usage and exit. | |
| if [ -z "$*" ]; then | |
| echo "Usage: llmx <your query for a command>" | |
| return 1 | |
| fi | |
| # --- HISTORY MANAGEMENT --- | |
| # 1. Manually add the command YOU just typed to the history. | |
| # We use $FUNCNAME instead of $0 for reliability. This is the fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ESP8266WiFi.h> | |
| #include <Wire.h> | |
| #include <INA226_WE.h> // Upewnij się, że ta biblioteka jest zainstalowana | |
| // --- Konfiguracja Sieci i Serwera --- | |
| const char *ssid = "ESP_POMIAROWY"; | |
| WiFiServer server(80); | |
| // --- Konfiguracja INA226 --- | |
| #define I2C_ADDRESS 0x40 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Clear the console output for a clean view | |
| consul.console.clear() | |
| -- Shortcut function to write messages into the Consul console | |
| function wr(x) | |
| consul.console.write(x) | |
| end | |
| -- Get the first army from the first alliance | |
| local army1 = bm:alliances():item(1):armies():item(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- clear the console output for a nice view | |
| consul.console.clear() | |
| -- shortcut for writing into consul console | |
| function wr(x) | |
| consul.console.write(x) | |
| end | |
| wr("how many alliances in battle?") | |
| wr(bm:alliances():count()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import seaborn as sns | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import argparse | |
| import os | |
| def parse_marlin_output(text_output): | |
| """ | |
| Parses Marlin's G29 T output robustly. | |
| It identifies only the actual data rows and ignores headers or other text. |
NewerOlder