How to compress a pdf file

It's been a while since I post a tip but this is a superb! If you've got a large pdf file, let's say 8MB and want to compress it down to 600kb then just type:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=flyer-small.pdf flyer-large.pdf

How to enable JRE plugin in OpenSuSE 13.1

Even if you install the rpm or sources from Sun the JRE plugin is not enabled by default under Firefox that shipped with latest OpenSuSE 13.1.
To sort out this just follow the simple steps outlined below.


grub-probe can't find drive for /dev/xvda1

If you are getting following while doing "apt-get upgrade" try our solution below.

warning: grub-probe can't find drive for /dev/xvda1.
grub-probe: error: cannot find a GRUB drive for /dev/xvda1. Check your device.map.


Playing with printer

Printing in Linux sometimes is a pain especially when you are a newbie. Simple things like killing a job might not work via the GUI. This is where the terminal comes handy.


Install and configure NRPE

There are several sources on Internet explain how to install and configure NRPE but non of them include an out of the box working solution. Various chmod etc things are missing thus giving you for free plenty of hours troubleshooting a simple HOWTO :)


Patch 2.6.40 kernel on Fedora for VMware

If you've got issues with 2.6.40 kernel under Fedora and VMware workstation or server try to apply the patch below.


Install GeoIP on servers running Directadmin

This tutorial is specific to Directadmin servers. Having said that, with minimal changes will work on most of the web servers. I'll try to provide generic installation instructions as much as possible.


Install and configure Ioncube to Xampp

Xampp or Lampp in our case is a bundled software for Web Development with PHP/Apache/MySQL etc. You can download latest version from apachefriends.org. Just download and extract the file under /opt.
Then visit http://www.ioncube.com/loaders.php and download the latest loaders for your distribution. Be carefull to download the proper file otherwise it wont work. For example 32bit binaries wont work on a 64bit OS.


Mod rewrite does not work even if it is enabled

I've recently setup Apache/MySQL/PHP on my Debian Squeeze to test a few things and got confused with mod_rewrite. Even the module was properly enabled into PHP my application didn't work. I was always getting a 404 error. Apache logs showing nothing relevant.


Normalization

The process of separating your data into tables and creating primary keys is called normalization. Its main goal is to make sure each piece of information appears in the database only once. Duplicating data is very inefficient, because it makes databases larger than they need to be and therefore slows down access. But, more importantly, the presence of duplicates creates a strong risk that you’ll update only one row of duplicated data, creating inconsistencies in a database and potentially causing serious errors.


How to compress files using bzip2

Bzip2 typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression. It is a must algorithm for file compression under Linux. It will save you a lot of space. In our example below we successfully compress a 404MB directory down to 229MB in a minute.


Become an Author for free