Reduce PDF file size in Linux

A GhostScript command can help in reducing your pdf size.

$gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=output.pdf input.pdf

You can also use the following parameters for -dPDFSETTINGS instead of /screen:

  • /screen – Lowest quality, lowest size
  • /ebook – Moderate quality
  • /printer – Good quality
  • /prepress – Best quality, highest size

I was able to reduce 1.5 MB size to  400KB. 🙂


Posted in Uncategorized | Leave a comment

I got it honest.

If the writing is honest it cannot be separated from the man who wrote it.

—  Tennessee Williams

It ain’t nothin’ but a small frame house on an acre lot
It ain’t that much different from any other house on the block
And it may not look like we’ve got all our share of the promise
But at least one thing’s for sure, I got it honest
Roll out of the sack every mornin’, head on down to the mill
Give ’em all I got for eight, ’cause that’s the deal
If you’ll check out my paycheck
Well, you’ll see that there ain’t that much on it
But every single penny I’m paid, I got it honest
I never had to hang my head in shame
For puttin’ a price tag on my name
Never turned my back on what I believe
Or let my heart be ruled by greed
‘Cause buddy if I didn’t earn it, I don’t want it
That way I can always say, I got it honest
Now you ain’t looking at some dude
That was born with a silver spoon in his mouth
And I might seem like some kind of low-life
To that high-falutin’ crowd
But I’m plain spoken, straight talkin’
And damn proud of what I have accomplished
And some folks appreciate that and some don’t
But, I got it honest
Now when I die, I may not leave my kids a fortune
But I hope they know’d my life stood for things that were important
And I’ll hand out the same sturdy old values
Of my daddy and my momma
It made me every ounce of what I am and I got it honest
I never had to hang my head in shame
For puttin’ a price tag on my name
Never turned my back on what I believe
Or let my heart be ruled by greed
‘Cause brother if I didn’t earn it, I don’t want it
That way I can always say, I got it honest
Friend, there ain’t no doubt about it, I got it honest
Writer(s):  Bruce Burch, Marcus Franklin Johnson, Aaron Tippin
Performed by: Aaron Tippin
Posted in Poetry, Uncategorized | Leave a comment

Welcome page is missing in Qt Creator

I am using Qt creator 3.0.1 with Qt 5.2.1 on ubuntu 14.04 32-bit. My
welcome page was empty, no examples, no documentation. I searched for its solution. But some links says it is a bug unsolved, some says solved. However, after 2 days of struggle of finding its solution, I was able to have beautiful warm welcome pages 🙂

To make it’s documentation working:

This link says” Most of the Welcome screen functionality is available using the File->Recent Projects, File->Sessions and File->Session Manager, you miss only access to Demos and Examples and a couple of links”  I tried clicking on Session Manager, its popup as link “what is a session?” , clicking on that link, I got my documentation. Don’t know how, but indeed. Here is the screenshot of pop window with a link:


To make a warm welcome page with all its functionalities like examples, tutorials, etc:

I searched a lot but found none. I followed link as

$sudo apt-get install qtbase5-examples qtbase5-doc-html
$sudo apt-get install qtdeclarative5-examples qtdeclarative5-doc-html

but it was still not working.

Fortunately, found a link where this solution was given. QtCreator3.0 needs QtQuick version 2 to show its welcome page.

$sudo apt-get install qtdeclarative5-qtquick2-plugin

Now, Welcome page is giving me a full warm welcome  🙂



Posted in Qt | Leave a comment

commands to check Qt version and select one from many

$qtchooser -list-versions            #This will give you list of Qt versions installed on your system

$export QT_SELECT=qt4        # to select qt4, simillarly can  try selecting differernt versions too.

Posted in Qt, Uncategorized | Leave a comment

libboost installation

Currently, I am working on  CAD software and I need boost library for it. I am installing FreeCAD which demands minimum version of 1.33. here is list of dependencies of FreeCAD My system is giving me

My system is giving me error about libboost that some packages of libboost are not installed though I installed it. Trying various solutions, now I am building it from source. I download libboost-1.6.0

Steps are same as

i did,

cd boost_1.60
./ --prefix=/usr/local/
./b2 install

To check version of libboost installed:

$dpkg -s libboost-dev | grep 'Version'
$cat /usr/include/boost/version.hpp | grep "BOOST_LIB_VERSION"
Posted in Uncategorized | Leave a comment

Fix broken package in Ubuntu

This problem is too common, sometimes we have some partial downloaded packages that stuck in our apt-get package manager and create troubles for us.

To do this try these commands and see if any works for your case:

1) You can delete the lock file with the following command: 
$sudo rm /var/lib/apt/lists/lock
You may also need to delete the lock file in the cache directory
$sudo rm /var/cache/apt/archives/lock

2) $sudo apt-get clean && sudo apt-get update
3) $sudo apt-get update --fix-missing
4) $sudo dpkg --configure -a
5) $sudo apt-get install -f

6) If above command does not work then open /var/lib/dpkg/status file and remove the blocks of packages that were creating trouble for you.

6th point was new for me thats why I wrote this post 😛

Posted in Uncategorized | Leave a comment

Removing all files located

Sometimes, we need to delete all the files searched by locate command. What we do ( i do this before :P) is to go to those files path and delete them manually, one by one, which was a tedious job.

So to do this using command, type:

$locate <search-string> | xargs rm -Rf

What xargs does is take a line from the input, and append it to another command, executing that other command for every line in the input. So by typing locate foobar | xargs rm -f, the output of the locate command will be patched onto the end of the rm -f command, and executed for each line produced by locate foobar.

You can verify the result by executing $locate <search-string>  command again. If you still see those files after terminal, Probably case is your database of locate command is not updated after removing files, so to do this you need to give command to update the database of locate. I had same case and my friend mandeep helped me with this command 🙂

$sudo udpatedb


Posted in Linux, Uncategorized | Tagged , | Leave a comment