How to reduce the size of pdf files and merge them under Ubuntu

tawfiq86 | August 16, 2010 | 8:05 pm

How many times were you in a position in which you needed to merge, or reduce the size of some .pdf files ? If you are using a Linux distribution, then you can rely on some simple command-line instructions to allow you to do so easily.

First, in order to start editing the pdf files, you have to install two packages, namely Ghostscript and PDFTK. Now, in order to merge the two files enter the following in the terminal:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=firstANDsecond.pdf -dBATCH first.pdf second.pdf

Notice the “AND” between the first and second files.

Now, in order to reduce the size of the pdf files, you will have to type the following in the terminal:

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

I hope this post is helpful.

How to convert pdf files to other image formats and vice versa under Linux

tawfiq86 | | 7:59 pm

Have you ever been in need of converting a jpg file to a pdf file or the other way around? Well, I have recently.

Under Linux, all you have to do is to open up a terminal and type:

convert oldfile.jpg newfile.pdf

Is this not beautiful ? :)

Mathematica 7 high cpu usage on linux kernels 2.6.28+

aboSamoor | July 22, 2009 | 11:52 am

According to the email from then wolfram support, there is a patched shared libraries for the new linux kernels. Apparently, Mathematica having problems running on 2.6.28+. I followed the email of the technical support and it worked for me ;) and the cpu usage dropped from 80%+ on average to less than 5% !!!

The solution as mention in ubuntu forums [1]

  1. Download the file here:

    http://download.wolfram.com/?key=61JJHE

  2. Place the shared library in
    /usr/local/Wolfram/Mathematica/7.0/SystemFiles/Libraries/Linux
  3. Download these files:

    http://download.wolfram.com/?key=MK4ZR8
    http://download.wolfram.com/?key=YHDAH4

  4. Place them in
    /usr/local/Wolfram/Mathematica/7.0/SystemFiles/Libraries/Linux-x86-64

Good Luck :)

Skype on Ubuntu, “Call Failed: Problem with Audio Playback”

Mustafa | April 15, 2009 | 11:51 am

If you are getting this error “Call Failed: Problem with Audio Playback” every time you try to make a call with Skype, first check that your microphone is working properly, you can do that by going to the Sound Recorded in your menu, on Gnome, it is Application=>Sound and Video=> Sound Recorder.

If it is working fine and you are still getting the same error just remove pulseaudio,


sudo apt-get remove pulseaudio

I hope this solves the problem, it worked with me on three different machines with different hardware.

ENJOY!

Format Partition or Flash Memory on Ubuntu

Mustafa | March 2, 2009 | 11:13 am

When you want to format a certain partition, first you need to know the label of the partition (for more information about this go here)

To that enter this command in your terminal,
df
under “Filesystem” you will find the label you want, and under “Mounted on” you will find the mounting point.
Now to format it you have to unmount it first :

sudo umount "Mount Point"

Then you can format it, there are different commands for formatting depending on which filesystem (FAT, Ext2,Ext3, Ext4, … etc) , for example lets say i want to format my flash memory stick which is under the filesystem label /dev/sdb1 , it is mounted on /media/disk, and I want to format it ext2 i will do this

sudo umount /media/disk
sudo mkfs.ext2 /dev/sdb1

ENJOY!

USB Speakers Ubuntu

Mustafa | December 22, 2008 | 1:25 am

You probably noticed that USB speakers don’t work as soon as you plug them on Ubuntu, all what you have to do is to change the sound output device, on Ubuntu (Gnome Desktop) you can do that by going to the System=>Preferences=>Sound , then on “Music and Movies” choose the device which says USB. Click Test to test them.

ENJOY!

Running Matlab without graphical interface

aboSamoor | October 24, 2008 | 11:39 am

As most of Linux Geeks terminal is the best place to play your code and ideas, today I tried to run Matlab without the GUI. It was working like charm :) You have to run

matlab -nodesktop

matlab in terminal

matlab in terminal

If you don’t have Matlab and you want to install it on Linux you can find the tutorial here

Make your alarm in Ubuntu

aboSamoor | May 16, 2008 | 12:14 pm

As most of the linux users machines are working more than 24 hours a day :P . It will be a good idea make your PC an alarm instead of buying another device ;) , i searched for a solution and i preferred the one packaged already with Ubuntu; Using sleep program will solve the problem, try to look at this :

sleep 5m && totem bla.mp3

this statement contains two commands written on one line using && operator, The first “sleep 5m” will halt the execution of the later command for 5 minutes, after the interval finished totem will execute playing the song you want. to make that for 8 hours, you just type:

sleep 8h && mplayer foo.mp3

for more information try :

man sleep

you can change the mplayer, totem with any program you want :) .

–Good Luck

How to update packages on Fedora?

Mustafa | March 27, 2008 | 1:30 pm

First of all you have to login as root, so open a terminal and excute the following command,
su -
Then you will have set up the proxy server if you have one, just open the /etc/bashrc configuration file with your favorite editor,
gedit /etc/bashrc
Add the following line to the end of the file,
export http_proxy=http://proxy_address:port
For sure you have to substitute your proxy IP and port instead of proxy_address and port respectively.
Now you have close the terminal window and open it again, you have to login as root one more time,
su -
To get the list of updates available,
yum check-updates
To update a certain package,
yum update package_name
To update all packages,
yum update

ENJOY!
Mustafa Mustafa

Configuring Proxy for Package Manager Fedora.

Mustafa | | 9:56 am

On the menu bar,

System=>Preferences=>Internet and Network=>Network Proxy

Enjoy!