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 | |
import re | |
import urllib.parse | |
def get_unsubscribe_methods(eml_path): | |
unsubscribe = None | |
with open(eml_path, encoding='ascii', errors='ignore') as f: | |
for line in f: | |
if not line.strip(): |
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
;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;; blink control ;;;;; | |
;;;;; CGA/EGA/VGA ;;;;; | |
; by Soha <[email protected]> ; | |
; with MASM, 2023/12/09 ; | |
;;;;;;;;;;;;;;;;;;;;;;;;; | |
.model small | |
.stack |
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
version 1.0; | |
ns junos = "http://xml.juniper.net/junos/*/junos"; | |
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0"; | |
ns curl extension = "http://xml.libslax.org/curl"; | |
import "../import/junos.xsl"; | |
/* | |
put this file as /var/db/scripts/op/update-ddns.slax | |
and then configure: | |
system { |
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/sh | |
set -e | |
if [ -n "$IF_NETNS" ]; then | |
if [ "$1" = "exec" ]; then | |
shift 1 | |
ip netns exec "$IF_NETNS" $@ | |
else | |
ip -n "$IF_NETNS" $@ |
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/sh | |
# gathering all interfaces with IPv6 link-local address | |
for with_ll in $(cat /proc/net/if_inet6 | grep "^fe80" | tr -s ' ' | cut -d ' ' -f 6 | sort -u); do | |
# POINTOPOINT flag is 1 << 4, filter non-PTP interfaces out | |
if [ $(expr \( $(($(cat /sys/class/net/$with_ll/flags))) / 16 \) % 2) -ne 1 ]; then | |
continue | |
fi | |
cost=65535 | |
ping_rtt=N/A |
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
// compatibility: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries | |
const getQueryParams = s => Object.fromEntries(s.split('&').map(s => s.split('=')).map(a => [a.shift(), a.join('=')].map(s => decodeURIComponent(s || ''))).filter(([k, _]) => k.length > 0)); | |
// window.$_GET = getQueryParams(window.location.search.slice(1)); |
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
addEventListener('fetch', event => event.respondWith(handleRequest(event.request))); | |
// Add environment variable `TGBOT_TOKEN` via Worker-Settings | |
async function requestTelegramBotAPI(method, payload) { | |
return fetch(`https://api.telegram.org/bot${TGBOT_TOKEN}/${method}`, { | |
method: "POST", | |
headers: { | |
"Content-Type": "application/json; charset=utf-8" | |
}, | |
body: !payload ? undefined : JSON.stringify(payload) |
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
--- a/src/gcc/c-family/c-attribs.c | |
+++ b/src/gcc/c-family/c-attribs.c | |
@@ -4894,6 +4894,11 @@ | |
handle_optimize_attribute (tree *node, tree name, tree args, | |
int ARG_UNUSED (flags), bool *no_add_attrs) | |
{ | |
+ if (getenv("ONLINE_JUDGE")) | |
+ { | |
+ error_at (DECL_SOURCE_LOCATION (*node), "%qE attribute is disallowed in online judge mode", name); | |
+ return NULL_TREE; |
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/sh | |
set -e | |
echo "===== Fetching CloudFlare latest IPs =====" | |
IP4LIST=$(curl https://www.cloudflare.com/ips-v4) | |
IP6LIST=$(curl https://www.cloudflare.com/ips-v6) | |
echo "===== Creating Real IP config =====" | |
printf "$IP4LIST\n\n$IP6LIST\n\n" | sed -E 's/(.+)/set_real_ip_from \1;/' - | tee cloudflare_real_ip.conf |
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 logging | |
import cqhttp | |
import telegram | |
import random | |
import traceback | |
import global_vars | |
from bot_constant import * | |
from main.command import command_listener |
NewerOlder