Uninstalling Extention:TemplateStyles from MediaWiki

So I removed Extention:TemplateStyles from my Mediawiki site and got errors when running rebuildall.php

I adapted solution from of someone uninstalling Scribunto

See: https://www.mediawiki.org/wiki/Topic:Ugrglewpi0toswdw

 

Error:

MWUnknownContentModelException from line 201 of /var/www/happytrees.org/htdocs/dieshots-wiki/older/includes/content/ContentHandlerFactory.php: The content model 'sanitized-css' is not registered on this wiki.
See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions handle this content model.
#0 /var/www/happytrees.org/htdocs/dieshots-wiki/older/includes/content/ContentHandlerFactory.php(266): MediaWiki\Content\ContentHandlerFactory->validateContentHandler()
#1 /var/www/happytrees.org/htdocs/dieshots-wiki/older/includes/content/ContentHandlerFactory.php(189): MediaWiki\Content\ContentHandlerFactory->createContentHandlerFromHook()
#2 /var/www/happytrees.org/htdocs/dieshots-wiki/older/includes/content/ContentHandlerFactory.php(97): MediaWiki\Content\ContentHandlerFactory->createForModelID()
#3 /var/www/happytrees.org/htdocs/dieshots-wiki/older/includes/Revision/RevisionStore.php(1040): MediaWiki\Content\ContentHandlerFactory->getContentHandler()
#4 /var/www/happytrees.org/htdocs/dieshots-wiki/older/includes/Revision/RevisionStore.php(1280): MediaWiki\Revision\RevisionStore->loadSlotContent()
#5 [internal function]: MediaWiki\Revision\RevisionStore->MediaWiki\Revision\{closure}()
#6 /var/www/happytrees.org/htdocs/dieshots-wiki/older/includes/Revision/SlotRecord.php(307): call_user_func()
#7 /var/www/happytrees.org/htdocs/dieshots-wiki/older/includes/Revision/RevisionRecord.php(175): MediaWiki\Revision\SlotRecord->getContent()
#8 /var/www/happytrees.org/htdocs/dieshots-wiki/older/maintenance/rebuildtextindex.php(117): MediaWiki\Revision\RevisionRecord->getContent()
#9 /var/www/happytrees.org/htdocs/dieshots-wiki/older/main

.....

Solution:

  • login to mysql
  • Find 'model_id' for 'sanitized-css' (#5 in this example)

mysql> SELECT * FROM dieshots_mediawikicontent_models WHERE model_name = 'sanitized-css';

+----------+------------------------------+
| model_id | model_name                   |
+----------+------------------------------+
|        5 | 0x73616E6974697A65642D637373 |
+----------+------------------------------+
1 row in set (0.00 sec)

  • delete entries

mysql> DELETE FROM dieshots_mediawikicontent_models WHERE model_name = 'sanitized-css';
Query OK, 1 row affected (0.00 sec)

  • reassign content model IDs (use 'model_id' from the first command, #5 in this example)

mysql> UPDATE dieshots_mediawikicontent SET content_model = 1 WHERE content_model = 5; 
Query OK, 86 rows affected (0.02 sec)
Rows matched: 86  Changed: 86  Warnings: 0

  • reassign page_content_model entries

mysql> UPDATE dieshots_mediawikipage SET page_content_model = 'wikitext' WHERE page_content_model = 'sanitized-css';
Query OK, 7 rows affected (0.02 sec)
Rows matched: 7  Changed: 7  Warnings: 0
 

Download all files uploaded by a specific user to MediaWiki site (CLI)

I needed to download all of a users files from WikiMedia Commons, so I thought i'd post how i did it.

 

 

THEUSERNAME='Birdman86'
MYSITE='https://commons.wikimedia.org/wiki/Special:ListFiles?limit=500&user=$THEUSERNAME'
wget --quiet -O - $MYSITE | grep "(<a href=\"https"| sed 's#.*(<a href=\"https://##'| sed 's#".*##'| xargs wget

Audiobooks sound quality vs codec

So I did a little experimenting after some people complained about my audiobooks quality. Its not an extensive list of tests

These test are done with voice only audio file, female, mp3, 44.1kHz, 128kbps

Tests:

Codec Bitrate Quality
mp3 32k - 22.05kHz Ok, but not crisp, people were complaining
mp3 48k - 22.05kHz Fine, but not crisp
mp3 64k - 22.05kHz Great, I can't hear a difference from original
aac/m4b/m4a 32k - 22.05kHz worse than mp3 at 32k, but still ok
aac/m4b/m4a 48k - 22.05kHz Fine, but not crisp
aac/m4b/m4a 64k - 22.05kHz Great, I can't hear a difference from original
ogg 32k - 24kHz Great, might be slightly less quanity than original, but barely
opus 32k - 24kHz Great, I can't hear a difference from original

I'd like to use opus for encoding, but I'm worried about compatibility. I try to make my audiobooks universally usable. I think ogg is supported all modern hardware/software, and most hardware/software of the last 10 years, probably not much compatibily before then.

The most common audiobooks I see are mp3/64k/44.1kHz and m4b/64k/44.1kHz. 44.1kHz is unnessesaraly high. Voices are 9kHz MAX, so the sample rate needs to be no higher than 18kHz. 22.05kHz is a standard for MP3s, and 24k is a standard for opus.

Conclusion:

I think I will use mp3/64k/22.05kHz for audiobooks I share and opus/32k/24kHz for my personal files

Installing ATI Radeon HD 6870 on a 2560x1080 monitor on Ubuntu 10.04 (focal)

 

Hardware info

lshw -c video

 

  *-display                 
       description: VGA compatible controller
       product: Barts XT [Radeon HD 6870]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:02:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=radeon latency=0
       resources: irq:37 memory:d0000000-dfffffff memory:fbbc0000-fbbdffff ioport:b000(size=256) memory:c0000-dffff

 

lspci -k | grep -EA2 'VGA|3D'

02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Barts XT [Radeon HD 6870]
    Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Barts XT [Radeon HD 6870]
    Kernel driver in use: radeon

 

linux-hardware: AMD Radeon HD 6870

 

=Removing old drivers (for nvidia card)=

sudo apt-get remove --purge '^nvidia-.*'

sudo apt-get install --reinstall xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core

sudo dpkg-reconfigure xserver-xorg

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

 

=Video Drivers=

  • Use "radeon" driver
  • "amdgpu" incompatable (only newer cards)
  • "amdgpu-pro" incompatable (only newer cards)
  • "frglx", obsolete, unmaintained since Ubuntu 12 or 13 or so

 

=Cables=

  • DVI(Single Link) doesnt support greater than 1920x1080(FHD)
  • DVI(Dual Link) might work, i didn't have one
  • HDMI didn't support greater than 1920x1080(FHD), I guess the graphics card uses an older version of HDMI
  • DisplayPort: I had to use a mini-Display Port(miniDP) to Display Port(DP) cable to get the full resolution

 

Check for Errors

 

dmesg | egrep 'drm|radeon'

 

References

 

http://help.ubuntu.com/community/RadeonDriver

Instrumental Despacito covers using unusal instruments

Many Despacito covers using unusal instruments

iPod Shuffle gen 1, noise/static when using while pluged in

So I figured the out the hard way, so I thought I'd post what I found.

The reason for the noise is because Apple thought they would be clever and combine the head phone jack with the ability to use it as a USB connector.

 

Here is the pinout of the headphone jack.

So if you try to play while charging, the USB will countinuiosly try to connect, adding noise to the right and left channels of the head phone jack.

 

So that's my theory, and killed the project I tried, making it an ambiant/nature sound generator. It may only apply for Generation 1 Shuffle.

So, I hate Apple

 

How to add Codemirror to CKEditor in GetSimple CMS

I had problems getting Codemirror to work properly in GetSimple.  So this is a bit of a work around to Codemirror to work with CKEditor while using GetSimple CMS.  This may not work with all versions of each, so here are the ones I've used

 

  • GetSimple CMS version 3.3.15
  • CKEditor version 4.5.9
  • Codemirror version 1.17.8

Basicly the problem was GetSimple includes some libraries of Codemirror that conflict with the "CKEditor plugin Codemirror"

 

So here are the steps

  • Using a clean install of GetSimple CMS version 3.3.15
  • move "admin/template/js/codemirror" to "admin/template/js/codemirror.old"
  • create the following empty files as placeholders, (it avoids some warnings)
    • admin/template/js/codemirror/lib/codemirror-compressed.js
    • admin/template/js/codemirror/theme/default.css
  • Download CKEditor-CodeMirror-Plugin.zip
  • Unzip it in "admin/template/js/ckeditor/plugins/"
  • Edit "admin/template/js/ckeditor/config.js"
    • Find line that includes "var extraPlugins = new Array();"
    • add the following line after "var extraPlugins = new Array();"
    • "extraPlugins.push('codemirror');"
  • Make sure you do a full reload of the page (Ctrl-Shift-R) or delete cached files for the site