Web fonts do not show if www missing

You may experience a situation when the locally served Web fonts used in your website do not show if the address is entered in the browser without the leading “www” part, for example, instead of “www.example.com” you type it in simply as “example.com”.

The simplest solution is to just redirect all request that are missing the “www” part to the correct address with an .htaccess file like this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^ http://www.example.com%{REQUEST_URI} [R=301,L]

Advertisements

Input line is too long

So you create a .bat file with a long list of arguments and it fails with a message:

“the input line is too long”

To avoid this, split your long single line into multitude of shorter lines separated by the caret character to mark the line break. Like this:

echo 1^
 2^
 3

 


Error – getcwd failed!

You run a command on command line and receive a mysterious error message:

sh: 0: getcwd() failed: No such file or directory

Possible explanation is that the directory you were working in has been deleted by some other process and indeed just does not exist anymore. Move, for example by typing “cd”, and continue working elsewhere.


Invalid command RewriteEngine

After (re-)installation of Apache2 the browser greets you with error 500 “Internal Server Error” and Apache2 error log file contains message “Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration”.

Well, you might want to enable mod_rewrite, which is disabled by default:

  • a2enmod rewrite
  • service apache2 restart

Missing php-mbstring

After (re-)installing PHP and attempting to run a script, you may see an error message saying “PHP Fatal error: Uncaught Error: Call to undefined function mb_strtoupper()”.

Well, you may be missing the php-mbstring extension to PHP. Simply install it by:

  • sudo apt-get install php-mbstring

Using HP LaserJet 2010 printer with Linux Mint

The problem: HP LaserJet 2010 printer gets recognized by Linux Mint but fails to print.

The solution:

  • Remove all automatically installed printers
  • sudo hp-setup -i

Let it download the HP plugin and accept defaults, then print test page (you must not be root or the print will fail).


Thunderbird does not start

This may happen after a crash.

Problem: You attempt to start your Thunderbird, but its GUI window does not show. You can see it running as a process in the background, but nothing else happens.

Cause: The problem may be caused by a surviving lock file in the user profile directory.

Solution: Navigate to .thunderbird in your user directory, select the appropriate profile directory and delete or remove file .parentlock therein.