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/

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 

Linux: How to split large files into several parts

HJSplit

HJSplit for Linux is a freeware file splitter for Linux with full graphical user-interface.
Download ‘HJSplit’ from Freebytesoftware

Unix Split command

$ split -l 1000 my_file.txt     # Split the file named my_file.txt into several files with 1000 lines 
$ split -b n my_file.txt	# Split a file into pieces n bytes in size. 

Useful commands and Usually using software’s installations in Fedora 15

Extract rpm files in Fedora


You can easily install rpm file with rpm -ivh

$ rpm -ivh file-package.name.rpm

Install Google chrome browser


$ sudo yum localinstall https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_i386.rpm

Command for creating a ssh key


$ ssh-keygen -t rsa -C “your_email@youremail.com”

Install Adobe flash player


$ su –
## Adobe Repository 32-bit x86 ##
$ rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
$ rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

## Adobe Repository 64-bit x86_64 ##
$ rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
$ rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

Update repositories

$ yum check-update

Install Needed Packages and Adobe Flash Player 11

$ yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl

Install Chromium browser


$ su –
## Change directory to /etc/yum.repos.d/ ##
$ cd /etc/yum.repos.d/

## Get Chromium repo file ##
$ wget http://repos.fedorapeople.org/repos/spot/chromium/fedora-chromium-stable.repo
$ yum install chromium

Install VLC media player


$ su –
$ rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
$ yum install vlc
$ yum install mozilla-vlc (optional)

Install Gimp


$ sudo yum install gimp

Install Office packages


$ sudo yum groupinstall “Office/Productivity”