Skip to content

Instantly share code, notes, and snippets.

Avatar

Marius Hoch mariushoch

  • Germany
View GitHub Profile
@mariushoch
mariushoch / benchmarkLuaEntitySerialization.php
Created Nov 15, 2019
Wikibase client "maintenance" script for benchmarking Lua serialiazation of entities
View benchmarkLuaEntitySerialization.php
<?php
namespace Wikibase;
use Deserializers\DispatchingDeserializer;
use Language;
use Maintenance;
use Wikibase\Client\WikibaseClient;
use Wikibase\Client\DataAccess\Scribunto\EntityAccessor;
use Wikibase\Client\Usage\HashUsageAccumulator;
@mariushoch
mariushoch / exgrep
Last active Dec 6, 2018
Searches MediaWiki exception.log(.gz) files for a specific exception string and prints the exception including stack trace.
View exgrep
#!/usr/bin/bash
if [[ "$1" == "" ]] || [[ "$2" == "" ]] || [[ "$1" == "--help" ]]; then
echo "Usage: $0 [-f] exception-log-file needle"
echo
echo "Searches exception.log(.gz) files for a specific exception string and prints the exception including stack trace."
echo "Use -f to follow newly added lines (like tail -f). Needle is case-sensitive."
exit
fi
@mariushoch
mariushoch / README.md
Last active Apr 25, 2020
PropertySuggester update tools
View README.md

Step by step

  • Run ./scheduleUpdateSuggester 20180312 on tool forge (replace 20180312 with the date of the latest JSON dump)
  • Wait
  • Check the logs at updateSuggester.err for problems during the creation
  • Run sha1sum analyzed-out (or whatever hashing algorithm you prefer)
  • gzip analyzed-out
  • Rsync analyzed-out.gz to your local machine, commit to the wbs_propertypairs repo.
  • Load it down to terbium (or some other maintenance host) with https_proxy=http://webproxy.eqiad.wmnet:8080 wget 'https://github.com/wmde/wbs_propertypairs/raw/master/20180312/wbs_propertypairs.csv.gz' (again, replace 20180312 with the date of the JSON dump you produced).
  • Unpack it: gzip -d
  • Compare the checksum to the one obtained on tool forge
@mariushoch
mariushoch / gist:2067b450a79653cdb24f
Created May 4, 2015
EntityDataSerializationService-profile-production
View gist:2067b450a79653cdb24f
Creating the object and make it do EntityDataSerializationService::initFormats by calling EntityDataSerializationService::getSupportedMimeTypes:
hoo@mw1017:~$ sudo -u www-data mwscript eval.php --wiki wikidatawiki
> function getSerializationService() { $wikibaseRepo = Wikibase\Repo\WikibaseRepo::getDefaultInstance(); $entityRevisionLookup = $wikibaseRepo->getEntityRevisionLookup(); $titleLookup = $wikibaseRepo->getEntityTitleLookup(); $entityIdParser = $wikibaseRepo->getEntityIdParser(); $serializationOptions = new Wikibase\Lib\Serializers\SerializationOptions(); $serializerFactory = new Wikibase\Lib\Serializers\SerializerFactory( $serializationOptions, $wikibaseRepo->getPropertyDataTypeLookup(), $wikibaseRepo->getEntityFactory() ); $serializationService = new Wikibase\Repo\LinkedData\EntityDataSerializationService( $wikibaseRepo->getSettings()->getSetting( 'conceptBaseUri' ), 'someString/', $wikibaseRepo->getStore()->getEntityLookup(), $titleLookup, $serializerFactory, $wikibaseRepo->getPropertyDataTypeL
@mariushoch
mariushoch / gist:72bb5edeca5ccd5c2eca
Last active Feb 21, 2016
MediaWiki: Add --profile-tests to phpunit.php
View gist:72bb5edeca5ccd5c2eca
From 5a02248b9e8671ac80a657c2c53229c688f033dd Mon Sep 17 00:00:00 2001
From: Marius Hoch <hoo@online.de>
Date: Sun, 21 Feb 2016 21:38:41 +0100
Subject: [PATCH] Add --profile-tests to phpunit.php
Change-Id: I4c9fcd6b90151b5b3b3dff65bfc0ce8589b7da7b
---
tests/phpunit/phpunit.php | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
View Current (rev 5224) Irssi FS#305 patch
Index: network-openssl.c
===================================================================
--- network-openssl.c (revision 5224)
+++ network-openssl.c (working copy)
@@ -50,6 +50,19 @@
int port;
} GIOSSLChannel;
+void irssi_redraw(void);
+
@mariushoch
mariushoch / vectorActions.js
Created Mar 23, 2013
Removes the actions drop down in the MediaWiki Vector skin in favour of a monobook-like menu
View vectorActions.js
/**
* Marius Hoch; 2013-03-24
* Removes the actions drop down in the MediaWiki Vector skin in favour of a monobook-like menu
*/
$( document ).ready( function() {
$( '#p-cactions' )
.hide()
.find( 'li' )
.each(
function( i, elem ) {
You can’t perform that action at this time.