Skip to content

Instantly share code, notes, and snippets.

View macbre's full-sized avatar
🏠
Working from home

Maciej Brencz macbre

🏠
Working from home
View GitHub Profile
@macbre
macbre / README.md
Last active July 12, 2016 08:53
SMW migration

SMW migrator

  • Get the list of wikis with SMW enabled ($wgEnableSemanticMediaWikiExt = true) and that are not yet migrated to the new storage / DB schema (smwgDefaultStore not set in WikiFactory)
  • Run migrator.sh followed by switchStorage.sh for each of these wikis (provide city ID as an argument). The first one performs the schema migration (no changes are visible to the users at that moment), the latter one will switch WF variable to let SMW use new and more performant DB schema,
  • You're done :)

Cleanup

Once the migration is completed and the new storage is running fine the old schema can be removed by running the following:

Remove not used containers

$ docker rm $( docker ps --all -f status=exited -q )
@macbre
macbre / _service.md
Created August 5, 2016 17:13 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
# php7-fpm - The PHP FastCGI Process Manager
# Original script by Ondřej Surý. Adapted to php7-fpm by @bjornjohansen
description "The PHP FastCGI Process Manager"
author "Ondřej Surý <[email protected]>"
start on runlevel [2345]
stop on runlevel [016]
# Precise upstart does not support reload signal, and thus rejects the
@macbre
macbre / specs.md
Created September 22, 2016 16:17
Q6600
$ sudo dmidecode -t 4 
# dmidecode 2.12
SMBIOS 2.4 present.

Handle 0x0004, DMI type 4, 35 bytes
Processor Information
	Socket Designation: Socket 775
	Type: Central Processor
	Family: Pentium 4
@macbre
macbre / crowdin-fandom.php
Last active October 28, 2016 14:46
SUS-1121
#!/usr/bin/env php
<?php
$msgFile = '/extensions/wikia/Oasis/Oasis.i18n.php';
function write_i18n_file($file, Array $messages) {
global $IP;
$extension = str_replace($IP, '', $file);
$extension = str_replace('.i18n.php', '', $extension);
@macbre
macbre / age.sh
Created December 8, 2016 13:23
git path age
#!/bin/bash
EXTENSIONS="extensions/wikia/AchievementsII
extensions/wikia/Answers
extensions/wikia/ArticleComments
extensions/wikia/Blogs
extensions/wikia/Chat2
extensions/wikia/CreateNewWiki
extensions/wikia/Forum
extensions/wikia/HAWelcome
extensions/wikia/ImageReview
@macbre
macbre / docker_clean.sh
Created December 18, 2016 13:41
Docker utils
IMAGES=`docker ps -a | grep -E 'Exited|Created' | awk '{print $1}'`
df -h | head -n2
for IMAGE in $IMAGES
do
docker rm $IMAGE
done
df -h | head -n2
@macbre
macbre / .gitignore
Last active November 5, 2018 11:47
Farerskie Kadry - GeoJSON
node_modules/
*.swp
src/searchdha.cpp | 3 +++
src/sphinx.cpp | 4 ++--
src/sphinxstd.cpp | 2 ++
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/searchdha.cpp b/src/searchdha.cpp
index 27bc01e..2af933d 100644
--- a/src/searchdha.cpp
+++ b/src/searchdha.cpp
@@ -21,6 +21,9 @@