Skip to content

Instantly share code, notes, and snippets.

View freephile's full-sized avatar

Greg Rundlett freephile

View GitHub Profile
@freephile
freephile / yamldiff.php
Created February 22, 2024 05:01
Compare (diff) two yaml files
<?php
/**
* This script is a CLI tool for quickly comparing an online yaml file with a local file
*
* @param string $url - the URL value for the location of an online YAML file
* @param string $file - the full path of a local YAML file e.g. MezaCoreExtensions.yml
*
* You could easily just do the same thing with diff, wdiff, sdiff
* Or, using a GUI with Kompare, Meld, DiffMerge, diffuse, KDiff3
*/
@freephile
freephile / backtrace2
Created May 17, 2019 10:15
NameTableAccessException
Original exception: [8c0aa0393008f3da237e462d] /wiki/it/Pagina_principale?requestDebug=true MediaWiki\Storage\NameTableAccessException from line 42 of /opt/htdocs/wiki/mediawiki/includes/Storage/NameTableAccessException.php: Failed to access name from content_models using id = 1
Backtrace:
#0 /opt/htdocs/wiki/mediawiki/includes/Storage/NameTableStore.php(308): MediaWiki\Storage\NameTableAccessException::newFromDetails(string, string, integer)
#1 /opt/htdocs/wiki/mediawiki/includes/Revision/RevisionStore.php(1625): MediaWiki\Storage\NameTableStore->getName(integer)
#2 /opt/htdocs/wiki/mediawiki/includes/Revision/RevisionStore.php(1671): MediaWiki\Revision\RevisionStore->loadSlotRecords(string, integer)
#3 [internal function]: MediaWiki\Revision\RevisionStore->MediaWiki\Revision\{closure}()
#4 /opt/htdocs/wiki/mediawiki/includes/Revision/RevisionSlots.php(165): call_user_func(Closure)
#5 /opt/htdocs/wiki/mediawiki/includes/Revision/RevisionSlots.php(107): MediaWiki\Revision\RevisionSlots->getSlots()
#6 /opt/htd
@freephile
freephile / backtrace1
Created May 17, 2019 10:12
NameTableAccessException
MediaWiki internal error.
Original exception: [ac7a70055b293fb9ad91406f] /wiki/it/Pagina_principale?requestDebug=true MediaWiki\Storage\NameTableAccessException from line 42 of /opt/htdocs/wiki/mediawiki/includes/Storage/NameTableAccessException.php: Failed to access name from slot_roles using id = 1
Backtrace:
#0 /opt/htdocs/wiki/mediawiki/includes/Storage/NameTableStore.php(308): MediaWiki\Storage\NameTableAccessException::newFromDetails(string, string, integer)
#1 /opt/htdocs/wiki/mediawiki/includes/Revision/RevisionStore.php(1624): MediaWiki\Storage\NameTableStore->getName(integer)
#2 /opt/htdocs/wiki/mediawiki/includes/Revision/RevisionStore.php(1671): MediaWiki\Revision\RevisionStore->loadSlotRecords(string, integer)
#3 [internal function]: MediaWiki\Revision\RevisionStore->MediaWiki\Revision\{closure}()
#4 /opt/htdocs/wiki/mediawiki/includes/Revision/RevisionSlots.php(165): call_user_func(Closure)
#5 /opt/htdocs/wiki/mediawiki/includes/Revision/RevisionSlots.php(107): MediaWiki\Revision\RevisionSlots-
@freephile
freephile / CentralAuthSettings.php
Last active October 17, 2017 02:18
CentralAuth config
<?php
# CentralAuth
wfLoadExtension( 'CentralAuth' );
if ( $espEnv == 'stage' ) {
$espConfSuffixes = array( 'wiki' );
$espCentralAuthAutoLoginWikis = array(
'devlol.esportspedia.com' => 'lol_wiki',
'devcod.esportspedia.com' => 'cod_wiki',
@freephile
freephile / %etc%cron.d%spl
Created October 2, 2017 20:24
slicer.org scripts
# Unlike any other crontab you don't have to run the 'crontab'
# command to install the new version when you edit this file
# and other files in /etc/cron.d
#
# These files also have username fields,
# which user crontabs do not - making this more flexible as a solution to put
# all your crons in one place.
#
# System cron is in /etc/crontab and you generally don't want to edit that file
@freephile
freephile / fix.perms.sh
Created September 16, 2017 04:04
Fix any permission problems in the upload filesystem
cat ./src/scripts/fix.perms.sh.j2
#!/bin/bash
# This script will fix all permissions in the uploads directory
# Since thumbs are included, this will allow missing thumbs to be created
# by RunJobs.php
uploads= {{ m_uploads }} # e.g. /opt/data-meza/uploads-gluster/
time sudo chown -R apache:apache "$uploads"
time sudo find "$uploads" -type d -exec sudo chmod u=rwx,g+rwxs,o=rx {} \;
@freephile
freephile / .gitignore
Last active January 3, 2021 14:59 — forked from zpetr/.gitignore
a good .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.ear
*.exe
*.o
*.so
@freephile
freephile / composer.json
Created December 2, 2016 13:02
MediaWiki REL1_26 composer.json v composer.lock
{
"name": "mediawiki/core",
"description": "Free software wiki application developed by the Wikimedia Foundation and others",
"keywords": ["mediawiki", "wiki"],
"homepage": "https://www.mediawiki.org/",
"authors": [
{
"name": "MediaWiki Community",
"homepage": "https://www.mediawiki.org/wiki/Special:Version/Credits"
}
@freephile
freephile / install_wiki.yml
Created September 1, 2016 21:04
include plays in ansible playbook
---
# You can't include plays in plays
# This will FAIL a syntax check / will not execute
- hosts: mw_hosts
name: Install sources, extensions and skins
tasks:
- name: Do Nothing At All
debug: msg="I'm a task"
- include: install_mediawiki.yml
- include: install_extensions.yml
@freephile
freephile / myStackScript.sh
Created April 3, 2015 19:25
LAMP+ stack script for Linode
#!/bin/bash
set -e
source <ssinclude StackScriptID="1">
##################
# IMPORTANT
# Some functions in the script rely on other functions being used first
# (i.e. munin expects mysql to be installed)
##################