Skip to content

Instantly share code, notes, and snippets.

import asyncio
import json
import aioimaplib
import sys
async def wait_for_new_message(host, user, password):
while True:
imap_client = aioimaplib.IMAP4_SSL(host=host)
await imap_client.wait_hello_from_server()
@aont
aont / pipe3.cpp
Last active November 13, 2024 09:13
#include <cstdio>
#include <cstdlib>
#include <csignal>
#include <sys/wait.h>
typedef struct {
int pid;
FILE* stdin;
FILE* stdout;
FILE* stderr;
@aont
aont / wol_persist_ubuntu2404.md
Last active November 11, 2024 10:48 — forked from sghael/gist:6cba5c75a36ed271fa959c35e516e516
Persistent WOL on Ubuntu 24.04
#!./venv/bin/python
import sys
import os
import http.server
import subprocess
# import json
import socket
disk_path_list = ["/dev/sdb", "/dev/sdc"]
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Copy to Clipboard</title>
</head>
<body>
<script>
window.addEventListener('load', (event) => {

Disable Networking connectivity in Standby

  1. on admin terminal
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\F15576E8-98B7-4186-B944-EAFA664402D9 /v Attributes /t REG_DWORD /d 2 /f
  1. open powerplan and set "Disable Networking connectivity in Standby" disabled.

  2. open device manager. disable "Wake on Pattern Match".

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JS Minify</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/bundle.min.js"></script>
</head>
<body>
<script>
(function() {
let browserName;
if(navigator.userAgentData) {
var brandSpecific = navigator.userAgentData.brands.find(function(brand) {return brand.brand == "Google Chrome" || brand.brand == "Microsoft Edge";})
if(brandSpecific) {
browserName = brandSpecific.brand + " " + brandSpecific.version;
} else {
browserName = navigator.userAgentData.brands.map(function (brand, index, array) { return brand.brand + " " + brand.version; }).join(", ")
}
} else {
apt-get install gfortran-mingw-w64-x86-64-win32 gcc-mingw-w64-x86-64-win32
CCPREFIX=x86_64-w64-mingw32-
make -j$(nproc) TARGET=HASWELL NUM_THREADS=256 HOSTCC="gcc" AR=${CCPREFIX}ar CC=${CCPREFIX}gcc RANLIB=${CCPREFIX}ranlib F_COMPILER=${CCPREFIX}gfortran FC=${CCPREFIX}gfortran