Facebook Twitter Gplus RSS
 
 
formats

Tip: Codecs and more in Ubuntu

You are missing codecs, fonts and other nifty stuff in Ubuntu?

Open up a console and do:
Code:

1
sudo wget http://www.medibuntu.org/sources.list.d/XXXX.list -O /etc/apt/sources.list.d/medibuntu.list
sudo wget http://www.medibuntu.org/sources.list.d/XXXX.list -O /etc/apt/sources.list.d/medibuntu.list

Replace the four X’s with the name of your distribution. For example 11.10 is called “Oneiric Ocelot” and in this case it would be “http://www.medibuntu.org/sources.list.d/oneiric.list”.

Next do:
Code:

1
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

And at last this (this make take a while):
Code:

1
sudo apt-get -y install w32codecs xine-ui mplayer gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad-multiverse gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad libxine1-ffmpeg faad sox lame ffmpeg mjpegtools vorbis-tools libxvidcore4 gstreamer0.10-pitfdll libdvdcss2 timidity timidity-interfaces-extra freepats flashplugin-nonfree totem-gstreamer rar gtk-gnutella frozen-bubble ttf-mscorefonts-installer gsfonts-x11 xfonts-intl-european default-jre numlockx
sudo apt-get -y install w32codecs xine-ui mplayer gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad-multiverse gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad libxine1-ffmpeg faad sox lame ffmpeg mjpegtools vorbis-tools libxvidcore4 gstreamer0.10-pitfdll libdvdcss2 timidity timidity-interfaces-extra freepats flashplugin-nonfree totem-gstreamer rar gtk-gnutella frozen-bubble ttf-mscorefonts-installer gsfonts-x11 xfonts-intl-european default-jre numlockx

have fun!

This will work for Ubuntu, Xubuntu, Kubuntu and Lubuntu.

 
formats

Auto start programs in Lubuntu/LXDE

If you want applications auto started after loggin in in Lubuntu open up:

Code:
1
sudo leafpad /etc/xdg/lxsession/Lubuntu/autostart
sudo leafpad /etc/xdg/lxsession/Lubuntu/autostart

and (for example) to start automatically your browser add this line at the end of the file:

Code:
1
chromium-browser %U
chromium-browser %U

Note: the @ is not needed.

Or you could do: First you can link a program’s .desktop file to ~/.config/autostart/. Installed programs put their .desktop file in /usr/share/applications. For example:

Code:
1
ln -s /usr/share/applications/lxterminal.desktop ~/.config/autostart/
ln -s /usr/share/applications/lxterminal.desktop ~/.config/autostart/
 
formats

Setting up Apache, PHP and MySQL for Ubuntu

The purpose of this little howto is to set up a LAMP box with (K,X)ubuntu desktop already installed focused on Joomla!
(Linux + Apache + MySQL + PHP/Perl together commonly known as LAMP Server)
This is wat
* Apache 2 – Linux Web server
* MySQL 5 – MySQL Database Server
* PHP5 – PHP Scripting Language
* phpMyAdmin – Web-based database admin software.

(more…)

 
formats

Create php error message via .htaccess

Debugging a new developed component or just getting blank pages? (a blank page is normally a hidden (fatal) php error)

Append this code to your .htaccess and it will make the error visible
Code:

1
2
3
4
5
6
7
php_flag display_errors on
php_flag display_startup_errors on
php_value error_reporting 2047
php_flag log_errors off
php_flag short_open_tag off
php_value error_prepend_string "<table><tr><td><img src=\"http://locutusweb.asw15.org/icon_error.gif\" align=\"left\"><font color='#FF0000'><b>A script error showed up, please send a copy of this to an admin:</b><code>"
php_value error_append_string "</code></font></td></tr></table><br>"
php_flag display_errors on
php_flag display_startup_errors on
php_value error_reporting 2047
php_flag log_errors off
php_flag short_open_tag off
php_value error_prepend_string "<table><tr><td><img src=\"http://locutusweb.asw15.org/icon_error.gif\" align=\"left\"><font color='#FF0000'><b>A script error showed up, please send a copy of this to an admin:</b><code>"
php_value error_append_string "</code></font></td></tr></table><br>"
 
formats

Tip: Change default page to open

This is not really a Joomla tip, but could be handy anyway.

Say you want visitors to go page “filename.html” instead of “index.html” after entering your domain…
Add this to your .htaccess:
Code:

1
DirectoryIndex filename.html index.cgi index.pl default.htm
DirectoryIndex filename.html index.cgi index.pl default.htm

In this example first filename.html will be opened, then index.cgi, index.pl and at last default.htm.

 
formats

Howto convert joomla 1.0.x templates to 1.5.x

For making your “old” Joomla 1.0.x working in native mode in Joomla 1.5.x, please follow the next steps:

Replace the head of your document with the code below. Replace all of the top code in your index.php code down to the tag with the following:
Code:

1
2
3
4
5
6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
</head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
</head>

Replace all php codes relating to modules.
This is an example of an old code
Code:

1
<?php mosLoadModules ( 'header', -3 ); ?>
<?php mosLoadModules ( 'header', -3 ); ?>

Replace with this

Code:

1
<jdoc:include type="modules" name="header" style="xhtml" />
<jdoc:include type="modules" name="header" style="xhtml" />

Replace the mainbody code from
Code:

1
<?php mosMainBody(); ?>
<?php mosMainBody(); ?>

to
Code:

1
<jdoc:include type="component" style="xhtml" />
<jdoc:include type="component" style="xhtml" />

Rename the template_css.css file in your /css folder to template.css

A more extensive tutorial is over here.

 
formats

Custom Joomla 404; file not found page

In the original Joomla 1.5.x 404 page not found file, I missed a search option. So I added the search form to the original. It is possible to redirect your 404 to a article in joomla, but the downside is: you have a searchable 404.

Create a file called error.php in your default template, like so: website_root/templates/own_template/error.php and paste the next code in to it.

Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
 
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<title><?php echo $this->error->code ?> - <?php echo $this->title; ?></title>
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/error.css" type="text/css" />
</head>
<body>
<div align="center">
<div id="outline">
<div id="errorboxoutline">
<div id="errorboxheader"><?php echo $this->error->code ?> - <?php echo $this->error->message ?></div>
<div id="errorboxbody">
<p><strong>You may not be able to visit this page because of:</strong></p>
<ol>
<li>An out-of-date bookmark/favourite</li>
<li>A search engine that has an out-of-date listing for this site</li>
<li>A mis-typed address</li>
<li>You have no access to this page</li>
<li>The requested resource was not found</li>
<li>An error has occurred while processing your request.</li>
</ol>
<p><strong>Please try a (new) search on our website:</strong></p>
<p>
<form action="index.php" method="post">
<div class="search">
<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Search" class="inputbox" size="30" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" type="text"> <input value="Search" class="button" onclick="this.form.searchword.focus();" type="submit">
</div>
<input name="task" value="search" type="hidden">
<input name="option" value="com_search" type="hidden">
</form>
</p>
<p><strong>Or just try <a href="<?php echo $this->baseurl; ?>/index.php" title="Go to the home page">the home page.</strong></a></p>
<p>If difficulties persist, please contact the system administrator of this site.</p>
<div id="techinfo">
<p><?php echo $this->error->message; ?></p>
<p>
<?php if($this->debug) :
echo $this->renderBacktrace();
endif; ?>
</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
?>
<?php
/**
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<title><?php echo $this->error->code ?> - <?php echo $this->title; ?></title>
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/error.css" type="text/css" />
</head>
<body>
<div align="center">
<div id="outline">
<div id="errorboxoutline">
<div id="errorboxheader"><?php echo $this->error->code ?> - <?php echo $this->error->message ?></div>
<div id="errorboxbody">
<p><strong>You may not be able to visit this page because of:</strong></p>
<ol>
<li>An out-of-date bookmark/favourite</li>
<li>A search engine that has an out-of-date listing for this site</li>
<li>A mis-typed address</li>
<li>You have no access to this page</li>
<li>The requested resource was not found</li>
<li>An error has occurred while processing your request.</li>
</ol>
<p><strong>Please try a (new) search on our website:</strong></p>
<p>
<form action="index.php" method="post">
<div class="search">
<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Search" class="inputbox" size="30" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" type="text"> <input value="Search" class="button" onclick="this.form.searchword.focus();" type="submit">
</div>
<input name="task" value="search" type="hidden">
<input name="option" value="com_search" type="hidden">
</form>
</p>
<p><strong>Or just try <a href="<?php echo $this->baseurl; ?>/index.php" title="Go to the home page">the home page.</strong></a></p>
<p>If difficulties persist, please contact the system administrator of this site.</p>
<div id="techinfo">
<p><?php echo $this->error->message; ?></p>
<p>
<?php if($this->debug) :
echo $this->renderBacktrace();
endif; ?>
</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
?>
 
formats

Tip: Securing images, cache and media folder

Preventing listing directory contents and executing scripts from directories such as images, media, cache, you can place an .htaccess file in them. The .htaccess file in each of those directories should contain the following code:

Updated to version 1.1

Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##########
# This is a .htaccess file for the Joomla images, media and cache directories
# For updates please visit http://locutusweb.asw15.org
# VERSION 1.1
#
# DISCLAIMER: We are not responsible for data loss and/or damage to your website what so ever
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
##########
 
########## Begin - Don't list directory contents
IndexIgnore *
Options All -Indexes
########## End - Don't list directory contents
 
########## Begin - Secure directory by disabling script execution
AddHandler cgi-script .php .php2 .php3 .php4 .php5 .php6 .php7 .php8 .pl .py .jsp .asp .htm .html .shtml .sh .cgi
Options -ExecCGI
########## End - Secure directory by disabling script execution
 
########## Begin - Deny direct access to .htaccess
# Uncomment following lines if don't have them in your webroots .htaccess
#<Files .htaccess>
#order allow,deny
#deny from all
#</Files>
########## End - Deny direct access to .htaccess
##########
# This is a .htaccess file for the Joomla images, media and cache directories
# For updates please visit http://locutusweb.asw15.org
# VERSION 1.1
#
# DISCLAIMER: We are not responsible for data loss and/or damage to your website what so ever
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
##########

########## Begin - Don't list directory contents
IndexIgnore *
Options All -Indexes
########## End - Don't list directory contents

########## Begin - Secure directory by disabling script execution
AddHandler cgi-script .php .php2 .php3 .php4 .php5 .php6 .php7 .php8 .pl .py .jsp .asp .htm .html .shtml .sh .cgi
Options -ExecCGI
########## End - Secure directory by disabling script execution

########## Begin - Deny direct access to .htaccess
# Uncomment following lines if don't have them in your webroots .htaccess
#<Files .htaccess>
#order allow,deny
#deny from all
#</Files>
########## End - Deny direct access to .htaccess
 
formats

Tip: Hardening your Joomla site by .htaccess Version 2.4 and 2.6

I added some extra security stuff to my .htaccess to harden my Joomla install. Blocked some common bad bots, made some files invisible and some rules used by exploits. The list is quite long and could slow down your site, but I have never seen that. Please note, this is not a substitute for not upgrading core or 3rd party extensions. (more…)

 
formats

WAMP

Do want to build your own small webserver on (any) windows? I recommend Apache Friends: http://www.apachefriends.org/en/index.html For the record: WAMP: Windows (operating system), Apache (webserver), Mysql (database) and PHP (Scripting language)It’s perfect for creating a local server for testing purposes, ofcourse you can set your server world wide open, but please be aware that webserver security is a speciality!!! You are warned!

A small tip to get those nifty URL’s: Make sure you have the following in your httpd.conf. Replace “C:/www” with the directory under your
DocumentRoot where you placed .htaccess file. Once you’ve copied the lines below into Apache configuration file restart web server and URL rewriting should work.

1
2
3
4
5
6
7
8
9
10
11
12
13
<Directory>
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "C:/www">
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory><Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
<Directory>
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "C:/www">
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory><Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
 
 
© Locutus-Web Services
credit