Installing Adobe Reader in Ubuntu / Linux Mint

Although Ubuntu / Linux Mint comes with GNOME Document Viewer that can open any .pdf files; however, I am a creature of habit and using Adobe Reader is one of my many weaknesses.  So off I went to http://get.adobe.com/reader/ and downloaded the file.  Soon thereafter, I realized that the downloaded file was a .bin file as opposed to a .zip or maybe a .deb file. Bummer!  Well, now I have to figure out what to do with this .bin file!

First of all, in Linux, the /opt folder is used for any add-on applications; thus, we know that Adobe will need to be installed in /opt folder.  Next, we need copy the installation file to /opt folder.

$ sudo su
# cd 
# cd / home/jessicarabbit/download
download# cp AdbeRdr9.4-1_i486linux_enu.bin /opt
download# cd /oAdbeRdr9.4-1_i486linux_enu /opt


The following commands will install Adobe Reader in .opt folder.

opt# ./AdbeRdr9.4-1_i486linux_enu.bin
Extracting files, please wait. (This may take awhile depending on the configuration of your machine.)
This installation requires 145M of free disk space.
Enter installation directory for Adobe Reader 9.4 [/opt]
/opt
Installing platform independent files...Done
Installing platform dependent files...Done
Setting up libraries...Done
Setting up desktop and menu icons...Done
Setting up the browser plugin...Done

That's it; you're done installing Adobe Reader!

Apache Address already in use: Unable to bind port 80, please choose another one.

1) Find out what are the open ports and established TCP connections:
$ netstat -vatn
2) Make sure port 80/443 is not used by any other service:
# netstat -tulpn| grep :80
3) If port 80 is bind to httpd, kill all process:
# killall -9 httpd

Reference: source.

XAMPP: Couldn't start MySQL!

The file permission in Linux still gets me every now and then; specifically, after I had to reinstall XAMPP to my freshly OS Linux Mint Isadora. After trying to figure out where MySQL server is and what port it is running from, and etc... I've evidently complicated the problem more than necessary.  This is what I've done to get my server running again. Let's cut to the chase.

# chmod -R 777 /opt/lampp

# chmod 755 /opt/lampp/etc/my.cnf
# chmod 755 /opt/lampp/etc/httpd.conf
# chmod 755 /opt/lampp/etc/php.ini
# chmod 755 /opt/lampp/etc/proftpd.conf
# chmod 755 /opt/lampp/phpmyadmin/config.inc.php
# /opt/lampp/lampp restart

This took care of my problem!

Convert .chm to .pdf file in Linux/Unbuntu

1) From the Synaptic Package Manager, select and apply the following packages:

* libchm
* libchm-bin
* libchm-dev
* python-chm
* chm2pdf
* html-doc
* htmldoc-common

2) To use the newly installed application, from the terminal:

$ htmldoc

When the HTMLDOC application opens from the "Input" tab, specify the type of document then click "add file" to add the file that needs to be converted.  From the "output" tab, specify the followings:

* Output To: where the output is going to be placed in a file or a directory
* Output Path: the path of the file going to be, i.e. home/Desktop/folder or home/Desktop/filename.filetype.
* Output Format: select file type, i.e. html, .ps, or .pdf.

Then click "Generate."

Adding new fonts in Gimp

Adding new fonts in Gimp is super simple. Here's how to do it.
1) Search and download new fonts to your desktop.
2) Unzip your font packages right onto your desktop.  You can either unzip the files by right clicking the folder then select unzip from the drop down menu or you can unzip the file from the terminal.  If you chose to unzip the file from the terminal, follow these commands:
$ sudo su
# cd
# cd /home/your-login-name/Desktop
# unzip filename.zip
# exit

3) Open these unzip font packages to see the font files. There are about 26 type font extensions but the most popular ones are Windows Font File (.fnt,) Generic Font File (.fon,) OpenType Font (.otf,) and TrueType Font (.ttf.) You want to look for file(s) with these extensions. For example, there are two files in my unzip font folder, fontlicense.txt and robot.ttf.  I will copy "robot.ttf" from my desktop to my Gimp's fonts folder and delete the unwanted files/folder.
4) Copy the font files to the Gimp's fonts folder. Your Gimp's fonts folder can be found in /home/your-login-name/.gimp2.x/fonts.
$ sudo su
# cd /home/my-login-name/Desktop
# cp robot.ttf /home/my-login-name/.gimp2.x/fonts
# exit

5) Restart Gimp.

It's that easy!

Network Tweaks for Firefox

Frustrated at low network speed? Welcome to the club.  I've tried all available extensions (that I knew of) to speed up the network and they do work to a point. But if you're like me, the search for improving network speed will continue on indefinitely.

Background
When you request pages in Firefox, depending on what you have requested first, Firefox will request and wait for the respective response one at a time. Like you, I typically open several tabs within Firefox and make multiple requests at once; thus slow the network down. HTTP pipelining is a technique which multiple HTTP requests are written out to a single socket without waiting for the corresponding responses and is only supported in HTTP1.1. Enabling HTTP1.1 forces the network to fit multiple HTTP requests in the same transmission control protocol ("TCP") packets thus fewer TCP packets are sent over the network which reducing load time and speeding up the network.  Unfortunately, not all servers support pipelining and some servers may even behave incorrectly if they receive pipelined requests.   



All of the above statements is also true for proxy server.

Solution 1 - Tweak network settings 

1) On the address bar, type about:config.  You'll see a warning, "This might void your warranty! Blah...blah..." Just click on "I'll be careful, I promise!" to proceed.

2) The window will display all of your current configuration settings.  On the filter bar, search for the following preferences and set them as recommended below.


     (a) network.http.keep-alive must be set to "true."
     (b) network.http.version must be set to "1.1".
     (c) network.http.proxy.version must be set to 1.1".
     (d) network.http.pipelining must be set to "true" to use pipelining in HTTP 1.1 connections.
     (e) network.http.proxy.pipelining must be set to "true."
     (f) network.http.pipelining.maxrequests. This preference determines the maximum number of requests to pipeline at once.  The default value is 4 but you can change the number of requests depending on your preference (I set mine to 20.)  Note higher values will cause a delay before the first request completes but will make the last request completes sooner.   Higher values will also cause more of a delay if a connection fails. 

3) Last but not least, right click anywhere on the screen and select New / Integer.  Name it "nglayout.initialpaint.delay" and set its value to "0."  This preference reduces the browser wait time to zero before it acts on the information it receives.

Solution 2 - Firefox extensions

 
 (1) Fastestfox - Browse Faster allows you to tweak many network and rendering settings such as pipelining, cache, DNS cache, and initial paint delay. You can access these settings via Tools / Fastest Fox.
 (2) Cleeki - Firefox Accelerators, a superior alternative to IE8 Accelerators.
 (3) Tweak Network.  A tool that allows you to tweak your network settings.
 (4) Vacuum Places. In Firefox 3, bookmarks and browsing history are stored in places.sqlite file, located in Firefox profile folder. Defragment your places.squite database will help speeding up Firefox.
 (5) Update Notifier notifies user when updates are available for your extensions and themes.  This is a "must have" extension since, as you'll see below, up-to-date extensions will help managing your network speed.

Known Firefox extensions that either have memory leak or slow down network speed:

 
 (6) DownThemAll may cause network slows down to a halt. 
 (7) Filterset.G.Updater AND FlashGot cause memory leak when use these extensions together. The solution is to update to version 0.3.0.2 or higher.
 (8) Firebug uses excessive CPU, Firefox may hang when a pop-up window is accessed.  The solution is to either uninstall Firebug, disable it, or use Firebug Lite, if possible.
 (9) FireFTP may cause excessive CPU usage with older version of Firefox.  The solution is to keep Firefox updated.
(10) FlashGot causes memory leak.  The solution is to update or uninstall ForecastFox|10n or not to use it at all.
(11) ForecastFox also causes memory leak.
(12) FoxyTunes may cause memory leak.
(13) Google Browser Sync causes excessive CPU usage. The solution is to uninstall the extension.
(14) IE Tab.  This is a great extension for web developers who need to see how their work rendered in IE but also known to cause memory leak. So, make sure that you have the latest version of Firefox which has code written to detect memory leak. Also, use IE Lite instead of IE Tab, this would reduce memory usage as well. Unfortunately, IE8 Lite has not yet been developed. Personally, I use www.browsershots.org to see how my website rendered in multiple browsers.
(15) iMacros causes excessive CPU usage.  The solution is to make sure you have the latest version of this extension.
(16) ImgLikeOpera with "refresh images in tab on select" causes excessive CPU usage.  The solution is to turn "refresh images in tab on select" to "off."
(17) Mouseless Browsing causes excessive CPU usage.  The solution is to uninstall this extension.
(18) Session Saver also causes memory leak.
(19) SwitchProxy Tool causes new Firefox windows to freeze for a few seconds.  The solution is to disable or keep this extension up-to-date.
(20) Tabbrowser Extensions (TBE) causes general slowdown. The solution is to disable or uninstall the extension.
(21) ThinkVantage Password Manager Extension causes new Firefox window to delay a few seconds when opened.  The solution is to disable or uninstall this extension.
(22) User Agent Switcher reinstallation or update may cause Firefox to hang.  The solution is to uninstall older version (prior to 0.6.4) in Safe Mode before installing a new version.
(23) Web Developer causes excessive CPU usage (quite obvious.)  The solution is to disable this extension and enable it when necessary.
(24) Wiz RSS News Reader update causes Firefox to hang.  The solution is to uninstall the older version (prior to 2.0.0) in Safe Mode then install the updated version.
(25) Woot Watcher causes Firefox to hang or slow Firefox down.  The solution is to uninstall this extension.
(26) Yahoo! Toolbar causes excessive CPU usage.  The solution is to uninstall via Tools / Add-ons / Extensions. 

References
http://www.bloganything.net/164/tweaks-to-speed-up-firefox
http://kb.mozillazine.org/Problematic_extensions
http://en.wikipedia.org/wiki/HTTP_pipelining

Install Ubuntu Tweak on Lucid Lynx

I ran across a posting about Ubuntu Tweak a few months ago. I tried it out and now I couldn't live without!  So, what is Ubuntu Tweak? Well according to the developer, "Ubuntu Tweak is an application designed to configure Ubuntu easier for everyone. It provides many useful desktop and system options that the default desktop environment doesn't provide."

Interested yet? Here are some of the features that Ubuntu Tweak allows user to do:

  • Not having to install Sysinfo yet you can view the basic system information, i.e. distribution, kernel, CPU, memory, etc. 
  • You can set preferential applications to start up at boot.
  • You can access and install many popular applications in one click (okay two clicks!)
  •  Clean unwanted packages or system cache to free up RAM (this one is my favorite.)
  •  GNOME panel settings.
  •  System security settings.
  •  And more!
How to Install Unbuntu Tweak in Ubuntu 10.04?
It's insanely simple, just follow the three commands below.

$ sudo add-apt-repository ppa:tualatrix/ppa
$ sudo apt-get update
$ sudo apt-get install ubuntu-tweak


Once installed, Ubuntu Tweak can be accessed via Application / System Tools / Ubuntu Tweak.

Sources:
http://ubuntu-tweak.com
http://www.ubuntugeek.com/how-to-install-ubuntu-tweak-in-ubuntu-10-04lucid-lynx.html

Start XAMPP at boot

I really hate it when executing http://localhost/xampp to receive an error message like, "local server is not responding." Knowingly that XAMPP will stop when I shut my machine down (a normal Linux and Linux like systems behavior,) I patiently type, # /opt/lampp/lampp start to get the server going again.  Everything is peachy until the next time I try to access my server, then the aggravation returns.  Well, to stop all of this nonsense, there is a way to start XAMPP at boot. Meaning, when you turn on your machine, your server will start automatically for you as well.  Here is how.

Edit the rc.local file with your favorite text editor. Since I am using gedit therefore gedit is specified in my command.  Replace gedit with whatever your favorite text editor is.

$ sudo gedit /etc/init.d/rc.local


When the file open, at line 1, you'll see something like:

#! /bin/sh


Right below this line, add the following:

/opt/lampp/lampp start


Save and exit. Next time when you turn on your computer, your server will also start for you.

Free Software for Windows

For those of us who are still using Windows (I really feel bad for ya!), here is a great source of free software for you.  Some of these software were first developed for Linux/Unix and later were adapted for Windows.  I wish I had known this when I was using Windows six months ago. Hope you find these helpful.

Joomla: There was an error uploading this file to the server.

The most likely reason for this error is your upload file size is smaller than the size of the file being uploaded.  To correct this problem, simply edit your php.ini.

Specifically to XAMPP server that runs on local host, your php.ini is resided in /opt/lampp/etc. Using your favorite text editor, open your php.ini and edit the "upload_max_filesize" appropriately.  For example my upload_max_filesize is 2M and the file I am trying to upload is 3.5M, I would adjust the upload_max_filesize to 5M from 2M.

Restart your server.

This should address the problem.

Insert a module in an article in Joomla 1.5x and create a menu link to it

Did you know that you can insert any module in an article in Joomla 1.5x? It is relatively simple; here are the steps of how to do this.

1) Enable the Content - Load Module plugin.
2) Create an article for the module. Name the article the same name as the module. For example, if you want to insert a Mortgage Calculator module in an article, then your respective article for this module would be named "Mortgage Calculator."
3) Type {loadposition userxx} in the body of the article, where userxx is your custom user position. Make sure that your user position is unique and has not been used by your template.  For example in my template, user99 has not been used. So in my article, I will use {loadposition user99}.
4) Open your module under Module Manager, enter the same userxx in the Position box. In my case, I entered user99.
5) Create a menu link to your new article/module.

That's all there is to it! Continue reading if you don't know how to create a menu link to your new article/module.

6) Select the menu where you want your article/module to appear.
7) Click on "New," then select "Article," then select "Single Article Layout."
8) Under the Parameters (Basic,) select the article that you have inserted the module in.  In my case, I selected the "Mortgage Calculator" article.
8) Save the new menu link.

That's it! Now you know how to insert a module in an article and create a menu link to it!

Installing Joomla! CMS on XAMPP Server

Well, I started writing this "how-to" then I found this reference page, which was far better than what I could come up with. Here is the link to the Installing Joomla! CMS on XAMPP server for you and me!

Installing Sun's Java on Ubuntu 10.04

Sun's Java has mysteriously disappeared when I reinstalled Ubuntu 10.04 a few days ago. I found this article instructs how to install Sun's Java. It's a great article so I put it here as a reference -- but make sure that you follow this first before installing Java, "As a side note, remember to remove OpenJDK if you do not need it, or be prepared to encounter hard to diagnose problems sometime."  Installing Java will take up about 166MB of your memory; thus if you have memory to spare, go for it!

Tips for Linux Newbies

These handy little tips will save you lots of headache and time. :-) There will be more tips added to this article; so stay tuned. 

1) Pay attention to the name of the file/folder with special characters such as uppercase, lowercase, underscore, and dash. In Unix, file/folder is identified EXACTLY as it is named. For example, Fri_day.php is totally different than Fri-day.php.

2) In Linux, you and “root” are two different entities. This is unique to Linux, so if you were a former Windows user like me, thinking that you have all administrative rights... well, wrong.  In order to perform administrative tasks, you must login as “root” or switch user, “su” at the terminal.  This is designed to protect the system files from being corrupted by hackers or newbies like you and me. So, take a deep breath and get accustomed to this.  You'll see the benefits later as you move toward a more sophisticated Unix user.

3) At the terminal, pay attention to the prompt as you open the window. It starts with something like: username@computername:~$.   The “$” indicates that you are “you,” (quite obvious, huh?)  So when you use a command like “sudo,” you are going to have administrative privileges like “root” temporarily.  But when you use a command like “sudo su,” you are going to switch from being “you” to “root.” You will be prompted for root password to gain root privileges.  Note, the prompt will change from “$” to “#.”  So whenever you see a command line that starts with #, you know that command requires you to be “root” in order to execute that command. Otherwise, you will have to use “sudo” over and over again.

4) Pay attention to file/folder permission; this  is a big deal in Linux. You may already own the folder – but not necessarily its sub-folders.  By default, except for the /home folder, which is yours; the rest, owned by root.  So if you know that you are going to need access to certain files/folders, make sure not only you but others have the read, write, and execute privileges. This can be done at the terminal by using the command, $ sudo chown -R username folder/file name. Of course if you are logged in as root, the command would simply be, # chown -R username folder/file name.  Always double check by right clicking on the folder/file, for permission privileges (Properties, Permissions, Owner/Group/Others to view.)  These permissions can be revoked later once the operations are done.

Installing XAMPP server in Ubuntu 10.04


XAMPP  is an open source cross browser web server. The package comes with an Apache Httpd Server, a server interpreter for scripts written in PhP and Perl, MySql database, phpMyAdmin, and OpenSSL.

The XAMPP server v.1.7.3 for Linux is packaged with Apache 2.2.14, MySQL 5.1.41, PHP 5.3.1 & PEAR + SQLite 2.8.17/3.6.16 + multibyte (mbstring) support, Perl 5.10.1, ProFTPD 1.3.2c, phpMyAdmin 3.2.4, OpenSSL 0.9.8l, GD 2.0.1, Freetype2 2.1.7, libjpeg 6b, libpng 1.2.12, gdbm 1.8.0, zlib 1.2.3, expat 1.2, Sablotron 1.0, libxml 2.7.6, Ming 0.4.2, Webalizer 2.21-02, pdf class 009e, ncurses 5.3, mod_perl 2.0.4, FreeTDS 0.63, gettext 0.17, IMAP C-Client 2007e, OpenLDAP (client) 2.3.11, mcrypt 2.5.7, mhash 0.8.18, eAccelerator 0.9.5.3, cURL 7.19.6, libxslt 1.1.26, libapreq 2.12, FPDF 1.6, XAMPP Control Panel 0.8, bzip 1.0.5, PBXT 1.0.09-rc, PBMS 0.5.08-alpha, and ICU4C Library 4.2.1 .

The following steps will help you to install, test, start and stop the XAMPP server in your local machine.  Finally, I also include a command to remove the XAMPP server (just in case should you change your mind.)

Step (1) Login to root, the go to /opt directory.
~$ sudo su
Password: enter root password
# cd /opt/

Step (2) Get the source code.
Go to http://www.apachefriends.org/en/xampp-linux.html. Scroll down and locate the latest XAMPP version for Linux. Highlight the link, right click, then select "Copy link location" from the pop up menu. At the terminal, ~/ opt# wget (paste the link that you just copied here.) At the terminal, the command line should look like this:
/opt# wget http://www.apachefriends.org/download.php?xampp-linux-1.7.3a.tar.gz

Step (3) Extract the source code. This will create a lampp directory, where your XAMPP server will live.
# tar -xvzf xampp-linux-1.7.3a.tar.gz

Step (4) Start your newly installed XAMPP server.
# /opt/lampp/lampp start
Starting XAMPP for Linux 1.7.3a...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for Linux started.

Step (5) Test  your newly installed XAMPP server. On your favorite web browser, type, http://localhost/xampp.  You should see the XAMPP Welcome page if installation was successful.

Default Security Settings
The XAMPP default installation does not establish security for the followings:
1. The MySQL administrator (root) has no password.
2. The MySQL daemon is accessible via network.
3. ProFTPD uses the password "lampp" for user "nobody."
4. PhpMyAdmin is accessible via network.
5. Examples are accessible via network.
6. MySQL and Apache running under the same user (nobody.)

Step (6) Establish Your Security Settings.  At the terminal,
# /opt/lampp/lampp security
XAMPP: Quick security check...
XAMPP: Your XAMPP pages are NOT secured by a password.
XAMPP: Do you want to set a password? [yes.]  Hit [enter] to set password, the
system will prompt you through a series of aforementioned items to establish your security preferences.

Step (7) Stop your XAMPP server.
# /opt/lampp/lampp stop
Stopping XAMPP for Linux 1.7.3a...
XAMPP: Stopping Apache with SSL...
XAMPP: Stopping MySQL...
XAMPP: Stopping ProFTPD...
XAMPP stopped. 

Removal of XAMPP (should you change your mind.)  At the terminal,
~$ sudo su
# rm -rf /opt/lampp

Other Noteworthy
1) Common parameters
2) Secure Sockets Layer (SSL)
     a) You can start Apache with SSL by using the following command (as root):
     # /opt/lampp/lampp startssl
     b) You can access your Apache server by using, https://localhost, on your favorite browser.

3) Keeping everything under one roof.  The installation of XAMPP creates a LAMPP directory in your computer. By default, the files/folders are installed as follows:





Sources

Clear System Cache

I have a tinny tiny laptop with only 960 MB of RAM. After installing PhpSysinfo I noted that my system was running at 98% of total available memory! As it turned out 356 MB were sitting in the system cache.   With a little digging, I found out how to clear the system cache safely (for me) so do it at your own risk. You've been warned!

First, run the sync command to ensure all cache is clear. You can do this by executing as root or simply use sudo command, (I did it as root.) 

# sync

Then,  run the following command:

# echo 3 > /proc/sys/vm/drop_caches

That's it.  After refreshing my little PhpSysinfo, I noted system cache dropped to 172 MB from 356 MB; and I am running at 58% of RAM.  What a beauty!

Sources
http://ubuntuforums.org/showthread.php?t=589975
http://aplawrence.com/Linux/buffer_cache.html 

Could not reliably determine the server's fully qualified domain name...

If you see this message after restarting your Apache server, "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName."

Don't panic. All you have to do is to edit the httpd.php file and add your server name to it.

~$ sudo gedit /etc/apache2/httpd.conf

(Note "gedit" is the text editor I am using; so if you are using other text editor, simply replace "gedit" with the name of your favorite text editor.)

By default, when the httpd.conf opens, it will be blank. Simply add "ServerName Localhost."  Save and close the file. The next step is to restart your server.

~$ sudo /etc/init.d/apache2 restart

Voila, the error message disappeared.

Finally, test your server to ensure everything is okay.

~$ apache2ctl configtest
Syntax OK