Skip to content

Instantly share code, notes, and snippets.

View nettrom's full-sized avatar

Morten Wang nettrom

View GitHub Profile
@nettrom
nettrom / gist:deee34b0dd4f4cfcb1e0f4ebe0e73e66
Created March 14, 2018 22:30
Recent Draft publishing rate
Examining the number of pages created in the Draft namespace between 2017-09-15 and 2018-02-15 that currently (2018-03-14) exists
as pages in the article (Main) namespace.
1: Get a dataset of creations in the Draft namespace between those dates from the `log` database:
SELECT page_id
FROM mediawiki_page_create_2
WHERE `database`='enwiki'
AND rev_timestamp >= '2017-09-15 00:00:00'
AND rev_timestamp < '2018-02-15 00:00:00'
AND page_namespace = 118
@nettrom
nettrom / gist:b654e80f0432e0ec3f3075e7504e23dd
Last active September 11, 2017 16:45
WM Cloud SSH configuration
Host *.eqiad.wmflabs
ProxyCommand ssh -a -W %h:%p -v nettrom@primary.bastion.wmflabs.org
Host *.wmflabs
User nettrom
IdentityFile %d/.ssh/wmcloud
ServerAliveInterval 60
Host * !gerrit.wikimedia.org
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
@nettrom
nettrom / graphbuilder.by
Created June 13, 2017 22:05
Handling lag in the MediaWiki API
## Excerpt from the class, showing the method that calls the Wikidata API,
## approach is the same for other MediaWiki APIs with maxlag parameter available
def make_api_request(self, items, http_session):
'''
Make an HTTP request to the Wikidata API for info on the given list
of items using the given HTTP session.
:param items: the QIDs of the items we'll be getting data about
:type items: list