left emtpy
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
// WSExport [[mul:Wikisource:WSexport]] | |
// > WSexport is a tool for exporting Wikisource's texts in EPUB, PDF and other file formats. It was created by user Tpt for French Wikisource, but it's also available for the other Wikisource subdomains. | |
// Copied from https://en.wikisource.org/w/load.php?lang=en&modules=ext.gadget.Easy_LST%2CPurgeTab%2CWSexport%2Ccharinsert%2CcollapsibleTables%2CdynamicLayoutOverrides&skin=vector&version=01fx33l | |
// and modified slightly to adapt to Chinese WikiSource by Gowee@Github. | |
if ($.inArray(mw.config.get('wgNamespaceNumber'), [0, 114]) !== -1) { | |
$(function() { | |
mw.util.addPortletLink('p-electronpdfservice-sidebar-portlet-heading', '//tools.wmflabs.org/wsexport/tool/book.php?' + $.param({ | |
lang: 'zh', | |
format: 'epub-3', | |
page: mw.config.get('wgPageName') |
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
3a4,5 | |
> . $IPKG_INSTROOT/lib/functions/network.sh | |
> | |
45a48 | |
> local dhcp_ipaddr | |
47a51,64 | |
> config_get proto "$net" proto | |
> [ "$proto" = "dhcp" ] && { | |
> local addrs | |
> network_get_ipaddr addrs "$net" |
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
#!/usr/bin/env python3 | |
from time import sleep | |
from collections import namedtuple | |
import json, re, os, csv | |
from urllib.parse import parse_qsl, urljoin, urlparse, urlencode | |
from requests import Session | |
from requests.cookies import create_cookie | |
parse_qs = lambda *args, **kwargs: dict(parse_qsl(*args, **kwargs)) | |
Info = namedtuple("CourseInfo", ["name", "teacher"]) |
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
#!/usr/bin/env python3 | |
import urllib.request | |
import re | |
from collections import namedtuple | |
from math import log | |
def ip2num(ip_address: str) -> int: | |
a, b, c, d = map(int, ip_address.split(".")) | |
return (a << 24) + (b << 16) + (c << 8) + d |
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
#!/usr/bin/env python3 | |
import sys | |
import json | |
from functools import partial | |
from pyrogram import Client, Error | |
from pyrogram.client.types.user_and_chats.dialog import Dialog | |
from pyrogram.client.types.user_and_chats.chat import Chat | |
from pyrogram.api.functions.channels import InviteToChannel | |
eprint = partial(print, file=sys.stderr) |
A script to help detect being added to new groups on Telegram. When detected, logs are sent to Saved Message with a corresponding tag to facilitate locating.
Setup Pyrogram (MTProto) at first: https://docs.pyrogram.ml/start/ProjectSetup.
chmod +x baugd.py
./baugd.py
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
# Modified from OpenVPN systemd service script. | |
[Unit] | |
Description=PPTP Client connection to %I | |
After=syslog.target network.target network-online.target | |
[Service] | |
PrivateTmp=true | |
Type=forking | |
ExecStart=/usr/bin/pon %i persist | |
PIDFile=/run/ppp0.pid |
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
<?php | |
function getRawPostData(){ | |
$eol = "\r\n"; | |
$BOUNDARY = substr(ltrim(explode(";", $_SERVER["CONTENT_TYPE"])[1]), strlen("boundary=")); | |
$postData = ""; | |
foreach($_POST as $name => $value){ | |
$postData .= "--" . $BOUNDARY . $eol; | |
$postData .= 'Content-Disposition: form-data; name="' . $name . '"' . $eol . $eol; | |
$postData .= $value . $eol; | |
} |
NewerOlder