Linux News|Linux Install sidebyside windows|Ubuntu|Linux Help|Installing Apache and php from source

Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Thursday, August 30, 2012

Converting CHM to PDF in Linux

CHM files, known as Microsoft Compressed HTML Help files, are a common format for eBooks and online documentation. They are basically a collection of HTML files stored in a compressed archive with the added benefit of an index.

Under Linux, you can view a CHM file with the xchm viewer. But sometimes that is not enough. Suppose you want to edit, republish, or convert the CHM file into another format such as the Plucker eBook format for viewing on your Palm. To do so, you first need to extract the original HTML files from the CHM archive.
This can be done with the CHMLIB (CHM library) and its included helper application extract_chmLib.
In Debian or Ubuntu:

$ sudo apt-get install libchm-bin
$ extract_chmLib book.chm outdir
where book.chm is the path to your CHM file and outdir is a new directory that will be created to contain the HTML extracted from the CHM file. In other Linuxes, you can install it from source. First download the libchm source archive from the above website. I could not get the extract_chmLib utility to compile under the latest version 0.38, so I used version 0.35 instead.

$ tar xzf chmlib-0.35.tgz
$ cd chmlib-0.35/
$ ./configure
$ make
$ make install
$ make
After doing the 'make examples', you will have an executable extract_chmLib in your current directory. Here is an example of running the command with no arguments and the output it produces:
$ ./extract_chmLib                    usage: ./extract_chmLib 
After running the utility to extract the HTML files from your CHM file, the extracted files will appear in . There would not be an 'index.html' file, unfortunately. So you will have to inspect the filenames and/or their contents to find the appropriate main page or Table of Contents.
Now the HTML is yours to enjoy!

   I have learnt this from lots of available sites and main reference I have given below.

References:http://madphilosopher.ca/2006/09/how-to-convert-chm-files-under-linux/

Wednesday, February 8, 2012

How to install .bin file in ubuntu linux using terminal

Most of the developments kit are archived in .bin format which are ready to install binary files you just have to make them executable and your OS will interpret them. For example Real player/Adobe reader/Java is available in .bin format.To install proper .bin files proceed as follows and we are assuming the file name as file.bin:
1. Copy the file to Desktop.

2. Open the terminal and reach to desktop as follows:
    [cd Desktop]

3. Make the file executable using chmod,for more details use [man chmod]
    [sudo chmod +x file.bin].

4. [./file.bin]
5. Follow the instructions displayed on terminal.


Tuesday, February 7, 2012

Graphics.h in Linux for C and C++|Graphics.h in ubuntu|graphics.h in Linux


Graphics.h in Linux for C and C++

Most of the students in Windows use graphics.h header file in there programs that are written in Borland TurboC. This is a reason that some don’t wanna migrate to Linux well there is a solution for that to. Just follow the steps that i did in Linux/ubuntu.

First install the gcc and g++ compiler by running sudo apt-get build-essential to install necessary compiler tools.

Then, install the following packages:
libsdl-image1.2
libsdl-image1.2-dev
guile-1.8
guile-1.8-dev
libsdl1.2debian-arts
libartsc0-dev
libaudiofile-dev
libesd0-dev
libdirectfb-dev
libdirectfb-extra
libfreetype6-dev
libxext-dev
x11proto-xext-dev
libfreetype6(upgrade)
libaa1
libaa1-dev
libslang2-dev
libasound2
libasound-dev

We can install them via Synaptic Package Manager(System->Administration->Synaptic Package Manager) one by one or you can type the following command in the terminal :
sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev libsdl1.2debian-arts libartsc0-dev libaudiofile-dev libesd0-dev libdirectfb-dev libdirectfb-extra libfreetype6-dev libxext-dev x11proto-xext-dev libfreetype6(upgrade) libaa1 libaa1-dev libslang2-dev libasound2 libasound-dev

After this download libgraph-1.0.1 to your Home Folder.
Right click on it and press “Extract here”
Now type in the terminal
./configure
sudo make
sudo make install

This completes the installation.
You can compile your program like this:
g++ test.cpp -o test.o -lgraph
And execute the program by ./test.o

If on compile it gives u an error that says “could not load shared libraries” or something like that just run the following command and it should fix it
sudo cp /usr/local/lib/libgraph.* /usr/lib

An example program(to print a rectangle) :
#include
#include

int main(void)
{
int gd=DETECT, gm=VGAMAX;
initgraph(&gd, &gm, 0);
//moveto(0, 0);
rectangle(50,50,500,200);
closegraph();
return 0;
}

If there are any problems please leave a comment.
You can also see videos posted by Reversehack,this is a very good and clean video you need not to read the above text if you have downloaded the video from here.

Resources: www.itsanimesh.com|http://www.youtube.com/user/ReverseHack

Friday, January 6, 2012

Installing C/C++ compiler in Ubuntu|c++ package download for ubuntu linux|Running C/C++ program in ubuntu/linux

In this article I will be showing the way to install C/C++ compiler in ubuntu ,I am using ubuntu 10.04.
By the way it is same for all ubuntu distribution as far as I am concern. There are two things you will learn here,First is to install compiler and second is saving downloaded files so that if you install ubuntu again you don't need to download again all debian files.
Installing C/C++ compiler in Ubuntu|c++ package download for ubuntu linux|Running C/C++ program in ubuntu/linux
In debian distribution such as ubuntu is there are some binary packages with .deb as extension which are dependent on some other packages which are also with .deb extension. The compiler we will be installing is gcc for c and g++ for c++,g++ supports both c and c++.
First make sure that you should have internet connection on your machine.

Open the terminal by going through Applications->Accessories->Terminal.

Step 1: Update your machine as follows:
[sudo apt-get update]

Skip this step if you have already updated.

Step 2: Clean the cache
[sudo apt-get clean]

Step 3: Install the build-essential package which contains gcc(Gcc compiler collection) ,make utility and other utilities for installing the software from source,if you don't know about installing software from source then don't worrry you will learn by experience.

[sudo apt-get install build-essential]

Step 4: After installing copy the downloaded files so that you don't have to go through these downloads again as follows:
Make a directory on desktop named as build-essential as follows:
If you are in home directory which is shown by '~' sign in your terminal as

[tarun@chawla:~$]
                          ^
                           This shows your current location in the / directory

If you are not in your home directory then do as follows:
[cd ~]
[mkdir Desktop/build-essential]
[cp  /var/cache/apt/archives/*.deb  Desktop/build-essential]
[sudo apt-get clean]

Now suppose you have installed ubuntu again on your computer and you need to install compiler again and you have stored build-essential directory that you have made above safe at some place then proceed as follows:

copy the build-essential directory on your Desktop and open the terminal ,reach to the home directory and do the following steps:

[sudo dpkg -i  Desktop/build-essential/*.deb]
In the above case I have stored and installed form Desktop and if you want to install and store at any other place then change the path accordingly.
Now you have installed compiler within seconds.
Running a c++ program


#include<iostream>
using namespace std;
int main()
{
cout<<"Hello world"<<endl;
}

Save it as first.cpp on your desktop.
Open the terminal and do as follows.
[g++ Desktop/first.cpp -o Desktop/first.o]
                                                         ^
                                                      first.o will be created if no error occurs
[cd Desktop]
[./first.o]

Running a C program


#include<stdio.h>
//using namespace std;
int main()
{
printf("Hello world\n");
}


Save it as second.c on your Desktop.

[g++ Desktop/second.c -o Desktop/second.o]
[cd Desktop]
[./second.o]

Here you can use gcc or g++ as g++ supports both.

enjoy the day bhai......
If you have any question then write down the comments,I will be pleased to help you.

Monday, December 19, 2011

Setting Environment variable for java in ubuntu/Linux

To set environment variable for java proceed as follows:
Firstly goto oracle website and download java development tool kit which is of .bin extension.
Here I am using jdk-6u23-i586.bin file which is downloaded by me .Copy it onto Desktop,open the terminal and do the folllowing:
tarun@chawla~$cd Desktop
tarun@chawla~/Desktop$sudo chmod +x jdk-6u23-i586.bin
tarun@chawla~/Desktop$./jdk-6u23-i586
A screen shot is given below

After that a directory with some files will be created on your Desktop let call this directory as jdk1.6_23.
Now you have to add the  jdk1.6_23/bin path to PATH enviroment variable as follows.
All executables files are stored in  a directory somewhere which act as a command for you,when you type the file name and press enter it executes.For ex you type mkdir command for making directory,actually mkdir is a executable file stored at some place in directory such as /usr/bin.
Environment Path variable are used to locate commands ,the path for these commands is stored in PATH variable. Now you have to add that jdk/bin path to PATH variable.I have put jdk files on my Desktop so absolute path here will be /home/tarun/Desktop/jdk1.6_23/bin,here tarun is my user name replace it with your username.
Now open the terminal and proceed as follows and this time you are in home directory by typing cd command:
tarun@chawla~$echo $PATH
tarun@chawla~$/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/tarun/apache/bin:/home/tarun/apache/man:/usr/local/lib/
tarun@chawla~$gedit .bashrc

.bashrc file will be opened which is a text file,and append following line to the file
PATH=$PATH:/home/tarun/Desktop/jdk1.6_23/bin/:
check your installation by opening terminal again after closing the previous one as follows:
tarun@chawla~$java -version

tarun@chawla~$java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Server VM (build 19.0-b09, mixed mode)
If this comes as output then enjoy programming buddy.

And now save the .bashrc file.One thing can be considered here that you can put jdk1.6_23 folder any where at some other place and modify the path accordingly.

Sunday, December 18, 2011

Playing Restricted formats in ubuntu such as MP3,DAT,MPEG etc

Initially when I installed ubuntu I was unable to play my favourite music because these formats such as mp3,mpeg are restricted if you want to play them you have to install some packages.

Sol 1 is to open the terminal and install vlc as follows as vlc supports all formats I have heared:

tarun@chawla:~$ sudo apt-get update
(skip this if you have already updated)

tarun@chawla:~$sudo apt-get install vlc

After terminal finishes vlc is intsalled,run those music files with vlc.

or installed ubuntu-restricted-extras package which packages most of the plugins and software required to run day to day licensed things.
To install it do as follows:
tarun@chawla:~$ sudo apt-get install ubuntu-restricted-extras
(after updating as above,if you have already updated skip updating).
Enjoy the day

Converting HTML files to PDF in ubuntu Linux

When you have downloaded any book in html then reading that book is cumbersome,
why don't you convert it into pdf.
Here it is:
htmldoc is a software available which supports both gui and terminal operation which converts HTML pages to PDF or PostScript formats as follows.
Reach the termial Applications->Accessories->Terminal.

before installing make sure that you are connected to Internet.
tarun@chawla:~$ sudo apt-get update
(skip this step if you had already  update)
tarun@chawla:~$sudo apt-get install htmldoc                                        
tarun@chawla:~$htmldoc

Initially you will feel some trouble but you will learn with two or three try just use it after all it has a Graphical User Interface(GUI).
Htmldoc

Connecting ubuntu to Internet through a 3G modem with sakis3g script

There are many Data cards or you can say Dongles available in market such as Micromax but ubuntu 10.04 does not recognise it ,this is due to reason that ubuntu thinks it as a memory device not as a modem.
You have to manually switch the dongle to modem. Sakis3g is a script currently available,just search it out on google you will surely get it or download from it here Sakis3g.

After downloading the script you have to make it executable by right clicking on it and in the permissions option make it executable,the option would be below in gnome desktop or do it from terminal as follws:

copy the sakis3g to Desktop and open the terminal through Applications->Accessories->Terminal.
user@ubuntu:~$ cd Desktop
user@ubuntu:~$sudo chmod +x sakis3g                                          //to make script executable
user@ubuntu:~$./sakis3g --config

Make sure that Desktop have a capital D and replace sakis3g by the script name you have downloaded.
Now script will run and click the connect with 3g option let it do the task required,
an if it fails don't leave your seat just try 4-5 times it will run surely if it is a 3g modem.
ubuntuway.blogspot.com