Smokes your problems, coughs fresh air.

Category: Technology (Page 28 of 47)

Installing Samba from lenny-backports

With our new Windows 7 machines, we need at least samba 3.3.7. However, our server with Debian stable doesn’t have that in its repository. So, I was forced to install samba with lenny-backports.

I included this line in my /etc/apt/sources.list:

deb http://www.backports.org/debian lenny-backports main contrib non-free 

Because backports are disabled by default, I needed to pin all the packages required for samba:

Package: samba
Pin: release a=lenny-backports
Pin-Priority: 999
 
Package: smbclient
Pin: release a=lenny-backports
Pin-Priority: 999
 
Package: smbfs
Pin: release a=lenny-backports
Pin-Priority: 999
 
Package: samba-common
Pin: release a=lenny-backports
Pin-Priority: 999
 
Package: samba-common-bin
Pin: release a=lenny-backports
Pin-Priority: 999
 
Package: libwbclient0
Pin: release a=lenny-backports
Pin-Priority: 999
 
Package: libtalloc2
Pin: release a=lenny-backports
Pin-Priority: 999

I haven’t actually installed it, but I will soon. So I don’t know if it will work or not. Aptitude -s suggests it does.

Creating new MySQL database and user

I often need to make a MySQL database and a user that can do anything in it:

create database bla character set utf8 collate = utf8_general_ci;
use bla
grant all on bla.* to 'jack'@'localhost' identified by 'password';

To drop a user:

drop user ‘jack'@'localhost’;

OpenDNS servers

I’ve had to deal with crappy DNS servers quite a lot; servers that don’t resolve certain sites, servers that take endlessly, etc. Therefore, using OpenDNS can be a good solution. The IP addresses for OpenDNS are (including /etc/resolv.conf directives):

nameserver 208.67.222.222
nameserver 208.67.220.220

MediaWiki thumb.php and rewrite rules

May, last year, I created an empty draft for this post, because, around that time, I had gone through quite some effort before I got thumbnails for foreign file repos working just right. Now, I’m taking a dive into my MediaWiki working dirs in preparation of the creation of a separate development environment, so it’s a good moment to rehash the past experience (almost as good as when I’d have done it right away).

This is how I configured the foreign file repo to be able to use images uploaded to the English wiki from the Dutch wiki:

$wgHashedUploadDirectory = false;
 
$wgForeignFileRepos[] = array(
    'class' => 'ForeignDBRepo',
    'name' => 'en',
    'url' => "http://wiki.hardwood-investments.net/media",
    'hashLevels' => 0,
    //'thumbScriptUrl' => "http://wiki.hardwood-investments.net/thumb.php",
    'transformVia404' => true,//!$wgGenerateThumbnailOnParse,
    'dbType' => $wgDBtype,
    'dbServer' => $wgDBserver,
    'dbUser' => $wgDBuser,
    'dbPassword' => $wgDBpassword,
    'dbName' => 'hardwood',
    'tablePrefix' => 'mw_',
    'hasSharedCache' => false,
    'descBaseUrl' => 'http://wiki.hardwood-investments.net/Image:',
    'fetchDescription' => false
);

To make thumbnails be generated by thumb.php on request I added the following to my .htaccess at the other end (and visa versa, because the Dutch wiki actually contains most of the images):

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^media/thumb/([^/]+)/([0-9]+)px-.*$ /thumb.php?f=$1&width=$2 [L,QSA]
« Older posts Newer posts »

© 2024 BigSmoke

Theme by Anders NorenUp ↑