Install swftools in Ubuntu / Linux

When I Installed swftools version 0.9.0 I got an error saying

make[1]: Entering directory `/home/ubuntu/swftools-0.9.0/swfs'
/bin/bash ../mkinstalldirs /usr/local/share/swftools
/bin/bash ../mkinstalldirs /usr/local/share/swftools/swfs
/usr/bin/install -c -m 644 ./simple_viewer.swf /usr/local/share/swftools/swfs/simple_viewer.swf
/usr/bin/install: cannot stat `./simple_viewer.swf': No such file or directory
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/ubuntu/swftools-0.9.0/swfs'
make: *** [install] Error 2

So I tried the version 0.9.1 and its done for me,

The Steps I followed is given below

Get necessary libraries and extract

  $ wget http://swftools.org/swftools-0.9.1.tar.gz
  $ tar -zvxf swftools-0.9.1.tar.gz
  $ wget http://www.ijg.org/files/jpegsrc.v7.tar.gz
  $ tar -zvxf jpegsrc.v7.tar.gz
  $ wget http://download.savannah.gnu.org/releases-noredirect/freetype/freetype-2.3.12.tar.gz
  $ tar -zvxf freetype-2.3.12.tar.gz

Now order of installation. First we install jpeg:

  $ cd jpegsrc.v7
  $ sudo ./configure
  $ sudo make
  $ sudo make install

Freetype is a little trickier. For installation you have to reset cache, set flags, run ranlib (not sure why but it wouldn’t work for me without this, if you know I’d love the explanation)

  $ cd freetype-2.3.12
  $ rm -f config.cache 
  $ sudo ranlib /usr/local/lib/libjpeg.a
  $ sudo ldconfig /usr/local/lib
  $ sudo LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
  $ sudo make
  $ sudo make install

If you want to be able to convert pdf files into text you have to install xpdf. Fortunately aptitude does provide us with the right libraries this time.

$ sudo apt-get install xpdf-reader

And now for the final step

  $ cd swftools-0.9.1
  $ sudo LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
  $ sudo make
  $ sudo make install

References:
https://designbye.wordpress.com/2010/02/23/installing-swftools-and-pdf2swf-on-ubuntu-linux/

Advertisements

Linux- Finding the size of a directory, finding the disk free space

$ du // This gives you a list of directories that exist in the current directory along with their sizes.
$ du app/ // This gives you a list of directories that exist in the specified directory app/ along with their sizes. 

$ du -h //  Better output, '-h' stands for human readable format. So the sizes of the files / directories are this time suffixed with a 'k' if its kilobytes and 'M' if its Megabytes and 'G' if its Gigabytes.

$ du -ah // Lists file size also and in human readable format. 

$ du -c // This gives only total size of the directories and the grand total.

$ du -ch | grep total  // This gives the total size 

$ df 
$ df   // This shows the free space in kilobytes 
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                40316280   5077616  34829228  13% /
udev                   1474708         0   1474708   0% /dev
tmpfs                  1482684      9024   1473660   1% /dev/shm
tmpfs                  1482684       712   1481972   1% /run
/dev/sda6             40316280   5077616  34829228  13% /
tmpfs                  1482684         0   1482684   0% /sys/fs/cgroup
tmpfs                  1482684         0   1482684   0% /media
/dev/sda8             46003208   9172500  34493840  22% /home
/dev/sda6             40316280   5077616  34829228  13% /tmp
/dev/sda6             40316280   5077616  34829228  13% /var/tmp
/dev/sda8             46003208   9172500  34493840  22% /home

$ df -h // With human readable format 

$ df -h | grep /dev/sda8 
/dev/sda8              44G  8.8G   33G  22% /home
/dev/sda8              44G  8.8G   33G  22% /home
$ df -h | grep /dev/sda8 | cut -c 41-43 // This command gives the usage percentage of /dev/sda8 
22%
22%

Reference: http://www.codecoffee.com/tipsforlinux/articles/22.html