Skip to content

Instantly share code, notes, and snippets.

View mariushoch's full-sized avatar

Marius Hoch mariushoch

View GitHub Profile
@mariushoch
mariushoch / vectorActions.js
Created March 23, 2013 23:28
Removes the actions drop down in the MediaWiki Vector skin in favour of a monobook-like menu
/**
* 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 ) {
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 / gist:72bb5edeca5ccd5c2eca
Last active February 21, 2016 20:40
MediaWiki: Add --profile-tests to phpunit.php
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(+)
@mariushoch
mariushoch / gist:2067b450a79653cdb24f
Created May 4, 2015 23:47
EntityDataSerializationService-profile-production
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 / README.md
Last active January 21, 2021 19:54
PropertySuggester update tools

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 / exgrep
Last active December 6, 2018 14:53
Searches MediaWiki exception.log(.gz) files for a specific exception string and prints the exception including stack trace.
#!/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 / benchmarkLuaEntitySerialization.php
Created November 15, 2019 13:20
Wikibase client "maintenance" script for benchmarking Lua serialiazation of entities
<?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 / 0001-Compile-with-support-for-bytcr-wm5102.patch
Created March 6, 2021 23:22
Add bytcr-wm5102 to Fedora 33 kernel 5.10
From 976ca0414020562c2efdc56e6605d136a2ba6eb5 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Sat, 6 Mar 2021 19:39:50 +0100
Subject: [PATCH] Compile with support for bytcr-wm5102
---
0001-WM5102.patch | 1105 +++++++++++++++++++++++++++++++++++++++
Patchlist | 1 +
filter-x86_64.sh | 4 +-
filter-x86_64.sh.fedora | 4 +-
@mariushoch
mariushoch / 0001-Compile-with-support-for-bytcr-wm5102-jack-detect.patch
Created March 22, 2021 15:48
Compile Fedora 33 kernel 5.11 with bytcr-wm5102 (including jack detect support) for Lenovo's Yoga Tablet 2
From b2df58f937bf6d9ea3891361e5edc037672b20f9 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Sat, 6 Mar 2021 19:39:50 +0100
Subject: [PATCH] Compile with support for bytcr-wm5102+jack-detect
---
0001-YogaTablet2.patch | 2467 +++++++++++++++++++++++++++++++++++++++
filter-x86_64.sh.fedora | 4 +-
kernel-local | 18 +
kernel.spec | 4 +-
@mariushoch
mariushoch / check-lexeme-json-dumps
Last active February 12, 2022 21:02
Check the Wikidata Lexeme JSON dumps each Thursday
#!/bin/bash
set -e
cd "$HOME/wikibase-validate-dump"
export https_proxy=http://webproxy:8080
git fetch
if [[ ! "$(git log HEAD..origin/master)" == "" ]]; then
echo "New commits, please rebase:"