Skip to content

Instantly share code, notes, and snippets.

@physikerwelt
physikerwelt / stream.patch
Created July 14, 2021 21:41
Possible solution for https://phabricator.wikimedia.org/T286542 from 567bc5a9359923b06470c483bfa116ac213d1066 in https://gerrit.wikimedia.org/r/mediawiki/core
diff --git a/includes/http/GuzzleHttpRequest.php b/includes/http/GuzzleHttpRequest.php
index 74edf8e861..3936aae52a 100644
--- a/includes/http/GuzzleHttpRequest.php
+++ b/includes/http/GuzzleHttpRequest.php
@@ -42,6 +42,7 @@ use Psr\Http\Message\RequestInterface;
class GuzzleHttpRequest extends MWHttpRequest {
public const SUPPORTS_FILE_POSTS = true;
+ protected $stream = null;
protected $handler = null;
@physikerwelt
physikerwelt / main.py
Last active June 30, 2021 07:10
python sickle minimal example
# run pip install sickle
from sickle import Sickle
import time
METADATA_PREFIX = 'oai_zb_preview'
METADATA_PREFIX = 'oai_dc'
URL = 'https://oai.zbmath.org/v1/'
@physikerwelt
physikerwelt / minidom.py
Created March 28, 2021 15:06
Can minidom generate invalid XML?
from pyexpat import ExpatError
from xml.dom import minidom
def create_xml_sample(text: str) -> str:
doc = minidom.Document()
root = doc.createElement("root")
normal_text = doc.createTextNode(text)
root.appendChild(normal_text)
doc.appendChild(root)
@physikerwelt
physikerwelt / README.MD
Last active February 14, 2021 08:29
Exploring the arxiv dump of @dginev
@physikerwelt
physikerwelt / ubuntu_unattended_upgrades_gmail.markdown
Created January 21, 2018 03:54 — forked from roydq/ubuntu_unattended_upgrades_gmail.markdown
Unattended upgrades on Ubuntu 14.04 with email notifications

Getting Started

Do yourself a favor and login as root to save yourself some time and headaches:

$ sudo su -

Install unattended-upgrades:

{"name":"restbase","hostname":"web","pid":27303,"level":30,"message":"ControlConnection","info":"Adding host 193.197.89.69:9042","levelPath":"info/table/cassandra/driver","msg":"ControlConnection","time":"2017-12-06T13:37:21.486Z","v":0}
{"name":"restbase","hostname":"web","pid":27303,"level":30,"message":"ControlConnection","info":"Getting first connection","levelPath":"info/table/cassandra/driver","msg":"ControlConnection","time":"2017-12-06T13:37:21.488Z","v":0}
{"name":"restbase","hostname":"web","pid":27303,"level":30,"message":"Connection","info":"Connecting to 193.197.89.69:9042","levelPath":"info/table/cassandra/driver","msg":"Connection","time":"2017-12-06T13:37:21.492Z","v":0}
{"name":"restbase","hostname":"web","pid":27303,"level":30,"message":"Connection","info":"Trying to use protocol version 3","levelPath":"info/table/cassandra/driver","msg":"Connection","time":"2017-12-06T13:37:21.501Z","v":0}
{"name":"restbase","hostname":"web","pid":27303,"level":30,"message":"HostConnectionPool","info":"Conn
paths:
/{api:v1}:
x-modules:
# swagger options, overriding the shared ones from the merged specs (?)
- spec:
info:
version: 1.0.0-beta
title: Formulasearchengine REST API
description: >
This API aims to provide a preview of new features reagarding
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/TeX.pool.ltxml...
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/eTeX.pool.ltxml... 0.01 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/pdfTeX.pool.ltxml... 0.01 sec) 0.41 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/LaTeX.pool.ltxml... 0.41 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/article.cls.ltxml... 0.05 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/amsmath.sty.ltxml...
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/amsbsy.sty.ltxml... 0.00 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/amstext.sty.ltxml... 0.00 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/amsopn.sty.ltxml... 0.01 sec) 0.15 sec)
100.00% 1455707.640 1 - main()
100.00% 1455688.327 1 - MediaWiki::run
100.00% 1455687.954 1 - MediaWiki::main
99.99% 1455634.816 1 - MediaWiki::performRequest
99.99% 1455634.512 1 - MediaWiki::performAction
99.99% 1455634.399 1 - ViewAction::show
99.99% 1455634.189 1 - Article::view
99.99% 1455619.891 1 - PoolCounterWork::execute
99.99% 1455619.810 1 - PoolWorkArticleView::doWork
99.99% 1455619.643 3 - Parser::parse
<math alttext="\frac{1}{1+a_{0}}" class="ltx_Math" display="inline" id="p1.1.m1.1" xmlns="http://www.w3.org/1998/Math/MathML">
<semantics id="p1.1.m1.1a">
<mfrac id="p1.1.m1.1.1" xref="p1.1.m1.1.1.cmml">
<mn id="p1.1.m1.1.1.2" xref="p1.1.m1.1.1.2.cmml">1</mn>
<mrow id="p1.1.m1.1.1.3" xref="p1.1.m1.1.1.3.cmml">
<mn id="p1.1.m1.1.1.3.1" xref="p1.1.m1.1.1.3.1.cmml">1</mn>
<mo id="p1.1.m1.1.1.3.2" xref="p1.1.m1.1.1.3.2.cmml">+</mo>
<msub id="p1.1.m1.1.1.3.5" xref="p1.1.m1.1.1.3.5.cmml">
<mi id="p1.1.m1.1.1.3.3" xref="p1.1.m1.1.1.3.3.cmml">a</mi>
<mn id="p1.1.m1.1.1.3.4.1" xref="p1.1.m1.1.1.3.4.1.cmml">0</mn>