Posts RSS Comments RSS 58 Posts and 39 Comments till now

Archive for the 'Quick Solutions' Category

Finding the current Joomla Version

This is just a quick aide memoir, for how to find the current Joomla version in use if you do not have direct access to the admin panel. The version information can be found in

libraries/joomla/version.php

Moving SMF to a new server

This post is an aide memoir more than anything else, but hopefully might come in handy to someone.

Settings.php

  • Database access details
  • Local file system path
  • URL (if changing)

Database

There are several instances within the settings table where the local file system path is stored within the database. Whether you pick find and replace (if restoring via a .sql file), the forum backend or PHPMyAdmin lots of things such as post icons and avatars will look screwy until you do. The theme path is also stored within the database in some instances. Make sure you get them all :)

Mounting an FTP account on Linux

Learning to use the command line is one of the hardest things about moving to Linux, however once you’re used to it, doing things becomes second nature and you actually miss being able to use the terminal in those cases where you have FTP access but no shell account. For some things using a GUI is laborious, upgrading web apps is a major case in point.

One way of getting around this is the curlftpfs package. The software allows you to mount your FTP account and access it as you would any other part of your Linux File System.

After installing the package, you may have to modprobe fuse and may have to add your user to the fuse group. The former was necessary on Suse 10.2 and the latter on Kubuntu Feisty. After that simply create the folder you wish to use as a mount point and issue the command.

curlftpfs -v ftp://user:pass@ftp.somewhere.net/ MountPoint/

Once everything is working you can do away with the -v which enables verbose output. This is great if you need to do work on a web app where there is no shell access.

Caution

It is easy to forget this is not shell access, commands like unzip, unrar etc will use the binary on your machine with the resulting backwards forwards data transfer. Use such commands at your peril if working on an unstable connection, with large files or if you don’t have a backup.

Whilst this can be used with the rails command (again not recommended), bear in mind that you’ll need to copy the contents of the vendor directory to the server manually, as this is normally symlinked when working on the shell.

References

http://gentoo-wiki.com/HOWTO_FTP_Mount

NextGen Gallery for WordpressMU - necessary modifications

Alex Rabe’s gallery plugin for Wordpress “NextGEN Gallery” is becoming almost as popular as the integration with Gallery2 and with good reason. I run the gallery 2 integration on this blog and it means keeping both systems as well as the integration up to date. IF for whatever reason you want / need all the functionality of gallery2 this is great, but otherwise NextGEN Gallery which is still in beta (i.e. pre version 1) is quickly shaping up as a good alternative.

The best thing about WPMU (for those that don’t know) is that themes and plugins written for Wordpress often require little modification to function - so without further ado…

1. Set the default file path for the plugin so that all images are stored per blog. This function is run on activation when the tables for the plugin are created.

ngginstall.php

function ngg_default_options()

Add

global $blog_id;

Edit options line as follows

$ngg_options['gallerypath'] = “wp-content/blogs.dir/” . $blog_id . “/files/”; // set default path to the gallery

2. Remove ability for user to update the above in the blog backend

settings.php

Remove “gallerypath” from the list of fields submitted to the form - or remove the input box entirely.

3. Modify the version check

nggallery.php

Simply set if (version_compare($wp_version, ‘wordpress-mu-1.2.4′, ‘>=’)) or remove the check entirely

Note

Other changes are required

  • If you want to take advantage of disk usage limits per blog and will depend on what method you are using to implement this (we’re using zspace upload quotas)
  • You’ll probably also want to hide the plugin’s server status / news display.
  • You may want to change / disable the “import image folder” function. Normally you won’t be allowing your users the upload access to need this function.
  • The default path is displayed in various pages (such as where a gallery is created) in the backend, you may want to remove this as it probably will not be relevant for your users.
  • You may need to edit / remove the permissions checking code depending on how your server is setup
  • Kevin Element left a comment below to say  “I noticed that when you log in as a user and use the “Uninstall plugin tables” under “setup” it deactivates the plugin for all users.” so that is another feature you’ll wish to look at modifying. Thanks Kevin :)

Why are you not simply releasing a version of the plugin that works with MU?

Because “works” is relative to how you intend your MU site to function and what other custom code you have installed. The above hacks are the necessary to get the plugin to work on a default MU install. Alex is planning MU support for version one of the plugin - but how best to do this is debatable especially with the addition of things like a role manager and tagging system.

The current discussion on NGGallery for WPMU is here

Changing the default sound card in Kubuntu

After adding a PCI soundcard to my machine for the purposes of having a gameport my Kubuntu 7.04 install wasn’t always choosing to use the on-board Intel chip for sound meaning I could near nothing. The solution seems to be the following

sudo asoundconf list

Names of available sound cards:
au8830
Intel

sudo asoundconf set-default-card Intel

sudo /etc/init.d/alsa-utils restart
* Shutting down ALSA… [ OK ]
* Setting up ALSA … [ OK ]

You’ll also need to restart any apps to get sound, there is no need to reboot to get Amarok working :)