Skip to content

Instantly share code, notes, and snippets.

View legoktm's full-sized avatar

Kunal Mehta legoktm

View GitHub Profile
$ cat ~/.config/beets/config.yaml
# Automatically migrated from legacy .beetsconfig.
directory: ~/Music
plugins: lyrics embedart fetchart ftInTitle mbcollection web
import:
move: true
acoustid:
@legoktm
legoktm / thingy.py
Last active August 29, 2015 14:03
thingy
# -*- coding: utf-8 -*-
# SUL audit thingy
# GPL v2 / MIT License
import calendar
import datetime
from collections import defaultdict, OrderedDict
import os
import time
import MySQLdb
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# CentralAuth broken accounts detector script
# Released under GPL v2 / MIT License
#
# By Legoktm, with contributions from Roan Kattouw, wctaiwan and Earwig
#
# Detects "broken" accounts. See
# <https://bugzilla.wikimedia.org/show_bug.cgi?id=61876>
#
diff --git a/manifests/role/extdist.pp b/manifests/role/extdist.pp
new file mode 100644
index 0000000..30956f4
--- /dev/null
+++ b/manifests/role/extdist.pp
@@ -0,0 +1,27 @@
+# = Class: role::extdist
+#
+# This class sets up the Extension Distributor tarball generator
+#
import os
family = os.environ.get('FAMILY', 'wikipedia')
mylang = os.environ.get('LANGUAGE', 'en')
if os.environ.get('TRAVIS_REPO_SLUG', None) == 'wikimedia/pywikibot-core':
usernames[family][mylang] = 'Pywikibot-test'
usernames['wikipedia']['en'] = 'Pywikibot-test'
password_file = os.path.expanduser('~/.pywikibot/passwordfile')
#!/usr/bin/env python3
import os
import subprocess
def shell_exec(args):
print(' '.join(args))
return subprocess.check_output(args).decode()
@legoktm
legoktm / gist:3108699
Created July 14, 2012 01:27
Bug on team-tracker
km@km-mpb:~/team-tracker$ node index 604 604
km@km-mpb:~/team-tracker$ node index 604 605
604,2012,Sacramento Regional,Engineering Inspiration Award
604,2012,Silicon Valley Regional,FIRST Dean's List Finalist Award
604,2012,Silicon Valley Regional,Regional Chairman's Award
604,2012,Silicon Valley Regional,Woodie Flowers Finalist Award
604,2011,Sacramento Regional,Regional Chairman's Award
604,2011,Sacramento Regional,Woodie Flowers Finalist Award
604,2011,Silicon Valley Regional,Regional Finalists
604,2010,Sacramento Regional,Coopertition Award
@legoktm
legoktm / extract.py
Created September 16, 2012 04:13
extract.py
#!/usr/bin/env python
"""
(C) 2012, Legoktm under the MIT License
"""
import os
import subprocess
root = os.getcwd()
def run():
@legoktm
legoktm / upload_multiple.py
Last active October 12, 2015 14:28
A quick wrapper around upload.py to allow for mass-uploading.
#!/usr/bin/env python
"""
# (C) Rob W.W. Hooft, Andre Engels 2003-2004
# (C) Pywikipedia bot team, 2003-2011
Copyright (C) 2012 Legoktm
Portions of this script are copied from upload.py, which is also released
under the MIT License, which appears below.
Permission is hereby granted, free of charge, to any person obtaining
@legoktm
legoktm / typoscanner.py
Created November 28, 2012 04:59
A script which scans xml dumps for typos
#!/usr/bin/env python
from __future__ import print_function
"""
Copyright (C) 2012 Legoktm with help from SigmaWP and odie5533
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the