This file contains 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
Apple 2 disk help | |
1. Format and Size Detection: | |
• is_woz_format: Checks if the disk image starts with the WOZ signature. | |
• get_image_size_kb: Retrieves the size of the disk image in kilobytes. | |
2. Filesystem Detection: | |
• detect_filesystem: Utilizes the existing autodetection to identify the filesystem and sector order. | |
3. Recommendation Logic: | |
• recommend_mounting: Implements the mounting recommendation rules based on image format, size, and filesystem. |
This file contains 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
# Start SSH Service. | |
wsl sudo service ssh start | |
# WSL2 network port forwarding script v1 | |
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell, | |
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter. | |
# written by Daehyuk Ahn, Aug-1-2020 | |
# Display all portproxy information | |
If ($Args[0] -eq "list") { |
This file contains 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 | |
from PIL import Image | |
import struct | |
# Define the Apple II HRG palette | |
palette = [ | |
(0, 0, 0), # Black | |
(114, 38, 64), # Deep Red | |
(64, 51, 127), # Dark Blue | |
(255, 0, 255), # Purple |
This file contains 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
cat <<'EOF' > /etc/systemd/system/udp-firewall.service | |
[Unit] | |
Description=UDP Firewall Service | |
After=network.target | |
[Service] | |
ExecStart=/usr/bin/node /usr/local/bin/udp_firewall.js | |
Restart=always | |
User=root |
This file contains 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
cat <<'EOF' > /usr/local/bin/udp_firewall.js | |
const dgram = require('dgram'); | |
const { exec } = require('child_process'); | |
const PORT = 6677; | |
const server = dgram.createSocket('udp4'); | |
server.on('listening', () => { |
This file contains 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
cat <<EOF | sudo bash | |
# Flush existing rules and set default policies | |
iptables -F | |
iptables -t nat -F | |
iptables -t mangle -F | |
iptables -t raw -F | |
iptables -X | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT |
This file contains 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 pyshark | |
import logging | |
# Set up logging | |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') | |
def packet_handler(pkt): | |
try: | |
if 'UDP' in pkt: | |
src_addr = pkt.ip.src |
This file contains 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
cat <<'EOF' > index.html | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>ESP Web Tools with Dynamic Manifest</title> | |
<style> | |
#spinner { | |
display: none; |
This file contains 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
NetworkProtocolHTTP::~NetworkProtocolHTTP() | |
{ | |
for (int i = 0; i < collect_headers_count; i++) | |
if (collect_headers[i] != nullptr) | |
{ | |
free(collect_headers[i]); | |
collect_headers[i] = nullptr; | |
} | |
} |
This file contains 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 | |
# | |
# create flask startup scripts for flask apps. | |
# a typical path: /home/ubuntu/yourProject | |
# with a venv at: /home/ubuntu/yourProject/venv | |
# | |
# adiller oct 2023 | |
# | |
################################################################# | |
# Function to display usage notes |
NewerOlder