Installing latex on hostmonster

In continuation with my previous post (Some times yahoo is better), I followed the steps on how to install latex/tetex on my web host from here (You can also get the Installation steps from QuickInstall file in source code or access the same file from tug.org).

But the problem is that on web hosts like hostmonster you won’t have root access so you will need to modify some of the things and do a local install in your home directory.

For that you can specify –prefix accordingly while doing ./configure. So you need to do:

./configure --prefix=/home/username/local/teTeX
replace username with your account name

This step ended without any errors But while I was doing make world, the process exited with following error:

/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libXt.a when searching for -lXt
/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libX11.so when searching for -lX11

I found this thread, where they were discussing similar error and from what I got it was due to machine platform. So I checked my host system information with

uname -a

from there I got x86_64 x86_64 x86_64 GNU/Linux which meant its a 64 bit architecture.

So after some tweaking to what I found here(CBLFS: TeTeX) to make it work for local install, you can do following to compile the package:

CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" USE_ARCH=64 \
./configure --prefix=/home/username/local/teTeX/ \
–enable-shared \
–without-texinfo \
–with-x=no \
–with-system-ncurses \
–with-system-zlib &&
[ -f texk/libtool ] && sed -i “/sys_lib_search_path_spec=/s:/lib:&64:g” texk/libtool;

And then you can do

make world
make all install

You can then add generated executable to your system path by:

PATH=/home/username/local/teTeX/bin/x86_64-unknown-linux-gnu:$PATH;
export PATH

You can also configure your installation using:

texconfig

And its DONE :) Find all steps followed by me here
So if you want to install on 32 bit config the method at Microcontroller programming Blog should work fine.
Also read: The Tetex HowTo

You can download required packages using wget on shell account at hostmonster from ctan.org

Related Post: Latex Beamer

Play with html using javascript

Javascipt can be very fruitful and flexible when it comes to modifying webapges dynamically (though client side). Javascript can be helpful in creating response to browser events like mouseup, mouseover etc, veryfying of form values prior to submitting them, changing style and value of html elements dynamically.
Examples i disscuss here are being user by me in developing Paint Chat !! So here I go..
You can write javascript functions and code in section as:

<script type="text/javascript">function test(){alert("test javascript");}</script>

Action on events:

Example of events can be mouseclick, keystroke, submitting form etc.
With onload()

 <body onload="init()">

Now init() function will be called when this html page is being loaded.
For links, javascript function can be evoked when clicking, mouseover over links like

 <a href="javascript:replay()" mce_href="javascript:replay()">Refresh ! </a>

Now function replay() will be called when Refresh! is clicked. For input text box

<input type="text" size="30" id="search" onchange="suggest()">; 

Now whenever content of textbox changes the function suggest() will be called. It can be useful when feature like google suggest has to be implemented or so.

On submitting forms:

<form method="post" action="some.php" onsubmit="return checkForm()">

So whenever this form is being submitted checkForm() function will be called and can be helpful in verifying values of form elements.

onMouseOver and onMouseOut:

<a href="http://www.aburad.com/blog" mce_href="http://www.aburad.com/blog" onmouseover="fade()"><img src="image.gif" mce_src="image.gif"> </a>

Now when mouse is over image fade() function will be called and can be used for animate and styling purposes.

Registering of events

A simple way can be:
Conside the html code : <div id="sample"> ..... some... html..text.. </div>
Now using javascript you can register event for this div by:

 var div_sample = document.getElementById('sample');div_sample.onmousedown=sampleMouseDown ; 

Now whenever mouseover ocours over this div html element sampleMouseDown() function will be called. Events can also be registered using addEventListener() . Find more information baout it here:Advanced event registration models

Modify Style and values for html elements

Within some javascript function, you can first get the element object by getElementByID() getElementsByName() for example conside the javascript code:

document.getElementById("colorcode").innerHTML = "#000000";
document.getElementById("bgtest").style.backgroundColor= "green";

The first line find the html element with id colorcode and then set its value to “#000000″ using innerHTML. In second line, it sets the background of html element with id “bgtest” to green.

Some other tweaks which were useful :

var intervalID = setInterval(drawCurve, 100);

So the drawCurve() function will be called repeatedly after 100ms. You can cancel this process( removing repeatedly calling) by clearInterval(intervalID);

var testImg = new Image();
testImg.src="form.php?name=form_value" mce_src="form.php?name=form_value";

Now here in form.php you can fetch value of variable name using $_GET and can perform appropriate action.

Some links:

Related Posts:

How to install ANYTHING in Ubuntu!

Excellent guide..!!
This guide will help you understand with screenshots, instructional videos and to-the-point language.

Read More >>

Related Post : Cleaning up a Ubuntu GNU/Linux system

How to hide files in JPEG’s

Create the rar file:
rar a secret.rar <your secret file>
cat img.jpg secret.rar > newimg.jpgNow this newimage looks identical to img.jpg, but it has secret.rar contained in it :)
Pull the file back out with this command: unrar x newimg.jpg

In windows :How to hide files in JPEG’s

Related Post :

If you want to develop firefox extension..

It will be helpful to have :

For creating toolbar extensions: Toolbar tutorial
Roachfield : how to create firefox extensions

Related Posts :
Firefox tips
Speed Up Firefox
Creating firefox extension

Making LaTeX Beamer Presentations

I came across this nicely compiled page on :
how to make Latex Beamer Presentations

If you want to create overhead presentations (รก la Powerpoint) with LaTeX, you can do so by using Beamer class, which creates surprisingly professional and sophisticated documents that you can then display using any pdf viewer (e.g., such as Adobe Acrobat). The advantage of using LaTeX over a program like Powerpoint is that it doesn’t require expensive software for either creating or displaying your presentation; it thus makes the presentation truly “portable”.

Read More >>
Related Links :

Using Telnet to send mail (By SMTP)

You : telnet 25
Server : Trying ???.???.???.???…
Connected to
Escape character is ‘^]’.
220 ESMTP Sendmail ?version-number?;
You : Helo
Server : 250 mail.domain.ext
You : mail from
Server : 250 ok
You : rcpt to:
Server : 250 ok

To start composing the message issue the command data
You: data
You : Subject:-type subject here-
then press enter twice
You may now proceed to type the body of your message
To tell the mail server that you have completed the message enter a single “.” on a line on it’s own.
Server : 250 ok ???????? Message accepted for delivery
You can close the connection by issuing the QUIT command.
You : QUIT

Java JRE/JDK installation

To verify that the installation was successful, execute

java -version

The output should look something like this if everything is well

java version "1.5.0_05"Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)

If the version does not match what you just installed then you might have JRE/JDK installed previously

Multiple JRE/JDK installed

If you have multiple JRE or JDK installed (e.g. 1.5.0 and 1.4.2) and want/need to switch between them, you can use update-alternatives to do so.

Example: Choosing which java executable to use:

update-alternatives –config java

Example: Choosing which javac executable to use:

update-alternatives –config javac

And so on in that fashion for the remaining executables related to Java. You can look in /etc/alternatives to see what one can configure with update-alternatives.
Links : Download

Linux Network Basic

Display all the interfaces you have on your server:
ifconfig

Display all interfaces as well as inactive interfaces you may have:
ifconfig -a

Assign the eth0 interface the IP-address 192.168.1.100 with netmask 255.255.255.0:
ifconfig eth0 192.168.1.100 netmask 255.255.255.0

Assign the default gateway for eth0 to 192.168.1.1 (for example your router):
route add default gw 192.168.1.1 eth0

Verify that you can reach your router (192.168.1.1):
ping 192.168.1.1

Display the routing information with the command route to see if routing entry is correct:
route -n

Check the status of the interfaces quickly:
netstat -i

Show all active connections:
netstat

Show all active TCP connections:
netstat -t

DNS lookups (3 different ways) and displays the answers that are returned from the name server (To troubleshoot DNS problems):
dig ubuntulinux.org
nslookup ubuntulinux.org
host ubuntulinux.org

Determine the network route from your computer to some other computer:
traceroute www.ubuntulinux.org

View your ARP (used by a networked machine to resolve the hardware location/address of another machine on the same local network) Cache:
arp

Remove any entry from the ARP cache for the specified host (for example 192.168.1.103):
arp -d 192.168.1.103

Check traffic in network :
tcpdump -n arp

Send out unsolicited ARP messages so as to update remote arp caches (for example 192.168.1.103):
arping 192.168.1.103

Shutdown a specific interface (for example eth0):
ifconfig eth0 down

Activate a specific interfrace (for example eth0):
ifconfig eth0 up

Stop all network devices manually on your system (Debian specific):
/etc/init.d/networking stop

Start all network devices manually on your system (Debian specific):
/etc/init.d/networking start

Restart all network devices manually on your system (Debian specific):
/etc/init.d/networking restart

Networking configuration is stored in the following file:
/etc/network/interfaces

Resource:
Ubuntu Linux Blog by Ralph
http://www.linuxhelp.net/guides/networkbasics/

Repair a Corrupt MBR and boot into Linux

There are times when you inadvertently overwrite your Master Boot Record. The end result being that you are unable to boot into Linux. This is especially true when you are dual booting between windows and Linux OSes.

This is what you do to restore the GRUB boot loader when faced with the above problem. First you need aLinux distribution CD. If you are using Fedora (RedHat) then the first CD is sufficient. But you may also use any of the live CDs like Knoppix, Ubuntu Live CD and so on.
Read More >>

Next Page →