Skip to content

Instantly share code, notes, and snippets.

View Krenair's full-sized avatar

Alex Monk Krenair

  • London, United Kingdom
View GitHub Profile
@Krenair
Krenair / pyqttest.py
Created February 8, 2017 16:25
Qt segfault problem
from PyQt4 import QtCore, QtGui
class MainWindowWidget(QtGui.QMainWindow):
def __init__(self):
super(QtGui.QMainWindow, self).__init__()
self.scene = QtGui.QGraphicsScene(-125, -125, 250, 250, self)
self.setCentralWidget(QtGui.QGraphicsView(self.scene, self))
self.show()
self.item = GraphicsItem()
alex@alex-laptop:~/Development/Wikimedia/restbase (master)$ diff config.example.yaml config.yaml
4,5d3
< # - parsoid at http://localhost:8142
< # - wiki at http://localhost/w/api.php
27,29d24
< ui_name: RESTBase
< ui_url: https://www.mediawiki.org/wiki/RESTBase
< ui_title: RESTBase docs
31,32d25
< x-request-filters:
alex@alex-laptop:~/Development/srobo/badger-vagrant (master)$ vagrant --version
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find nokogiri (>= 1.6.3.1) amongst [archive-tar-minitar-0.5.2, bundler-1.7.4, celluloid-0.15.2, childprocess-0.5.2, childprocess-0.3.9, erubis-2.7.0, ffi-1.9.3, i18n-0.6.11, i18n-0.6.9, json-1.7.7, listen-2.4.0, log4r-1.1.10, net-http-persistent-2.9, net-scp-1.2.1, net-scp-1.0.4, net-ssh-2.9.1, net-ssh-2.2.2, rb-inotify-0.9.5, thor-0.19.1, timers-1.1.0, vagrant-1.6.5, vagrant-1.0.7] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:777:in `block in activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `each'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:750:in `activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:1232:in `gem'
from /usr/local/bin/vagrant:22:in `<main>'
@Krenair
Krenair / gist:59fcb97ec73d80e5041f
Created October 5, 2014 21:28
IDEA exception breaking ADB
Exception in thread "Monitor" java.lang.AssertionError
at com.android.ddmlib.HandleHello.handleChunk(HandleHello.java:80)
at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:336)
at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)
@Krenair
Krenair / gist:2c3d640751268318e9e2
Created August 30, 2014 17:43
Gender preferences on the English Wikipedia
MariaDB [enwiki_p]> select count(*), up_value from user_properties where up_property = 'gender' group by up_value;
+----------+----------+
| count(*) | up_value |
+----------+----------+
| 96295 | female |
| 493758 | male |
+----------+----------+
2 rows in set (5.76 sec)
@Krenair
Krenair / gist:f61b3cb06d29dcb4bf86
Created June 1, 2014 00:18
ruwiki report for putnik
alex@alex-desktop:/var/www/MediaWiki/Git/core (review/alex_monk/searchbox-tabindex)$ ssh tools-login.wmflabs.org -t sql ruwiki
If you are having access problems, please see: https://wikitech.wikimedia.org/wiki/Access#Accessing_public_and_private_instances
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 6946750
Server version: 5.5.34-MariaDB-1~precise-log mariadb.org binary distribution
@Krenair
Krenair / gist:0843b728e00d7f1740ce
Created May 11, 2014 14:57
2to3 on socketIO-client
alex@alex-desktop:~/Git/socketIO-client (python3)$ 2to3 socketIO_client/*
root: Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
RefactoringTool: Skipping implicit fixer: buffer
root: Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
@Krenair
Krenair / gist:24c1364ddf0c5f6798a0
Created May 11, 2014 04:01
Port socketIO-client to python3
diff --git a/socketIO_client/__init__.py b/socketIO_client/__init__.py
index 3bdecf1..f7de3d3 100644
--- a/socketIO_client/__init__.py
+++ b/socketIO_client/__init__.py
@@ -3,7 +3,10 @@ import json
import requests
import time
from collections import namedtuple
-from urlparse import urlparse
+try:
vagrant@(none):~$ sudo ldapadd -Y EXTERNAL -H ldapi:/// -f member.ldif -D cn=Manager,o=sr -W
Enter LDAP Password:
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=module,cn=config"
ldap_add: Insufficient access (50)