formats

Broken files after FTP transfer with filezilla

Why do (SMF, PhpBB) attachments break after transferring with Filezilla? For your own safety, uploaded attachments have their names changed to a hash and their file extensions are removed.  Most FTP clients adhere to their list of ASCII extensions and upload everything else in binary mode. Some clients though, like FileZilla, default to transferring extensionless files in ASCII mode.

The fix
Find the transfer settings page and make sure that extensionless files are not set to be transferred in ASCII mode. In FileZilla, this is listed under Edit → Settings → Transfer → File Types → Treat files without extensions as ASCII files (uncheck this box!). Alternatively, you can just set your client to always transfer files in binary mode. If you have a text editor that natively supports both line endings, then it doesn’t matter how it comes to you.

Recovering corrupted files
Recovering the files is not possible at this point. The only option is to change the transfer mode and download them again if you still have access to the originals. “But can’t I just re-upload the files and let the line endings get converted back?” Unfortunately, no. Existing Line Feeds would have had a Carriage Return added in front of them, and existing CRLFs would have been left alone. Uploading it would convert both the new and the previous CRLFs to LF. The file is lost.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Remove Author names, created and modified date in Joomla!

A standard Joomla! installation has the fields “written by”, “created date and time” and “modified date and time” turned on. Although easy to change, it’s not so easy to find the place where to do that. To make things worde the Joomla developers change the location with every major release.

Joomla 2.5

Go to Content > Article Manager, and click on Options icon (top right near Help Icon), from here you can find a number of settings, including Created, Modified, etc. Select Hide or Show as necessary. These settings will apply across the board.

Joomla 1.5

This is a settings in the Articles Parameters function. Go to Content > Article Manager, and click on Parameters icon (top right near Help Icon), from here you can find a number of settings, including Created, Modified, etc. Please note that if you use Use Global, this will only apply for new content which is added (not for your current articles). Current articles would have to be updated individually.

Joomla 1.0

Simple go to Site > Global Confiuration (Content tab), and Turn off / on the checkboxes found in this page according to your requirements. Once you have customised these parameters to suit your needs you should save your configuration file, and these settings are then applied.

Also recommended switching off is the PDF icon, because there are several known problems with this, and usually Google also tries to index the pdf documents

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Joomla! 1.0.x and PHP 5.3.x

Here is the story: if you happen to run Joomla! 1.0, which you should not but what the heck, you’ll run into some weird issues if there is PHP 5.3.x running on your server. Everything will work fine except for one thing – there will be no content at al on your web site. And no matter what you do content will be invisible. Since Joomla! 1.0.x is no longer being maintained you should either upgrade to Joomla! 1.5.x/1.6.x or apply this little hack below:

Replace:

1
$arguments = func_get_args();
$arguments = func_get_args();

with

1
$arguments = func_get_args(); $numargs = func_num_args(); for($i=1; $i < $numargs; $i++){ $arguments[$i] = &$arguments[$i]; }
$arguments = func_get_args(); $numargs = func_num_args(); for($i=1; $i < $numargs; $i++){ $arguments[$i] = &$arguments[$i]; }

in includes/Cache/Lite/Function.php. This should be OK till… well, till you upgrade. It’s not like they are going to fix it in Joomla! 1.0.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

No password, but “locked” after hibernation in windows 7

However, what happens now is that after hibernation, the screen says “Locked”. I don’t have to enter a password, but I still have to click my user to enter. (And this laptop is only used by me; ie. only one user setting)

Right click the battery icon in the lower righthand corner of the screen and select Power options. Then select change plan settings for the plan that you currently have active. Then select change advanced power options. Towards the top select “change settings that are currently unavailable”, then under “require password on wakeup” change both “plugged in” and “battery” to “No”.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Enable hibernation in Windows 7

Hibernation is the most energy effective way to let you PC/Laptop to go to sleep. Unfortunately this is not enabled by default. This is the way to go:

1. Open Command Prompt with Administrator rights. To open Command Prompt, type

in Start menu and then hit

1
Ctrl + Shift + Enter
Ctrl + Shift + Enter

to open the Command Prompt with Admin rights.

2. Next, type the below command and hit enter:

1
powercfg /hibernate on
powercfg /hibernate on

3. Type

and hit enter to close the Command Prompt.

4. If you can’t see the Hibernate option in Start menu then do the following tasks:

A. Type

1
Power Options
Power Options

in Start menu and hit enter.

B. In the left pane, open the link labeled “Change when the computer sleeps” and then open the link “Change advanced power settings”.

 

C. Under the Advanced Sleep options, expand the Sleep tree and turn off Hybrid Sleep.

D. Now go back to Start menu to see the new Hibernate entry.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Work on your website before it is live

We have all been there; moving to a new webhost is the perfect time to do a great overhaul, upgrade or migration of your existing website. The problem is: you want to fool around with your new playground, but you don want to bother your vistitors (and search engines) with your mishaps.

What you can do is: point only your own computer to the new webspace by editing your “ḧost” file.

Your windows host file can be found here:

1
2
3
Windows XP\Vista = C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows 2K = C:\WINNT\SYSTEM32\DRIVERS\ETC
Win 98\ME = C:\WINDOWS
Windows XP\Vista = C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows 2K = C:\WINNT\SYSTEM32\DRIVERS\ETC
Win 98\ME = C:\WINDOWS

Your linux/mac host file can be found here:

1
/etc/hosts
/etc/hosts

Change the example ip by the ip address from your new host and of course change the domain name.

1
2
123.123.123.123 mydomain.com
123.123.123.123 www.mydomain.com
123.123.123.123 mydomain.com
123.123.123.123 www.mydomain.com

When you are happy with your new site, change your DNS records and delete those lines.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
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.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
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/
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
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.

Read more…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
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>"
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
© Locutus-Web Services
credit