Kunaljain's Weblog

January 19, 2009

403 Forbidden IP Address – resin admin page error

Filed under: Resin — Kunal Jain @ 11:23
Tags: , ,

check the resin.conf file for /resin-admin and change

<web-app id="/resin-admin" root-directory="${resin.home}/php/admin">
        <!--
           - Administration application /resin-admin
          -->
        <prologue>
          <resin:set var="resin_admin_external" value="false"/>
          <resin:set var="resin_admin_insecure" value="true"/>
        </prologue>
      </web-app>

to

<web-app id="/resin-admin" root-directory="${resin.home}/php/admin">
        <!--
           - Administration application /resin-admin
          -->
        <prologue>
          <resin:set var="resin_admin_external" value="true"/>  <!-- Change this line Means change the false value to true -->
          <resin:set var="resin_admin_insecure" value="true"/>
        </prologue>
      </web-app>

Refresh your page is browser and you will be able to access the resin-admin page example:- http://localhost.com/resin-admin

January 9, 2009

ERROR: 1062 Duplicate entry ‘localhost-‘ for key ‘PRIMARY’

Filed under: MySql — Kunal Jain @ 11:47
Tags: ,

If MySQL give this error then check your hostname

shell> hostname

It might be localhost. Change your hostname. To know how to change hostname click here

January 7, 2009

Converting .tif images to .jpg

To convert .tif images to .jpg i use imageMagic which i downloaded from http://www.imagemagick.org/script/download.php
To convert .tif images to .jpg you need to install certain library files which will be used during the conversion process

For jpg i downloaded libjpeg-6b.tar.gz. you can download it from http://www.imagemagick.org/download/delegates/

To install it follow the following steps

shell> cd /usr/local
shell> tar -zxvf libjpeg-6b.tar.gz
shell> ln -s libjpeg-6b libjpeg
shell> cd libjpeg
shell> ./configure; make; make install;

This will install the required jpg library files into your system

Then i downloaded tiff-3.8.2.tar.gz from the same repository mentioned above
To install it follow the following steps

shell> cd /usr/local
shell> tar -zxvf tiff-3.8.2.tar.gz
shell> ln -s tiff-3.8.2.tar.gz tiff
shell> cd tiff
shell> ./configure; make; make install;

Then finally i Install imageMagic with the following steps

shell> cd /usr/local
shell> tar -zxvf ImageMagic.tar.gz
shell> ln -s ImageMagick-6.4.8-3 imageMagic
shell> cd imageMagic
shell> ./configure; make; make install;

Now you are ready to convert .tif files to .jpg simply type the following command

shell> convert fileName.tif newFileName.jpg

you can use convert help to find other parameters to pass with the convert command regarding quality and path to write files and others……

January 5, 2009

Passing username and password in wget command

Filed under: Linux Tips & Tricks — Kunal Jain @ 08:53
Tags:

To pass username and password in wget command so that it will not ask for the authentication use the following syntax

wget --user=userName --password=Password http://www.example.com/index.html

November 29, 2008

bash :- service command not found

Filed under: Linux Tips & Tricks — Kunal Jain @ 11:15

Install sysvconfig on you system. This will fix the problem

apt-get install sysvconfig

November 19, 2008

Enabling wireless in ubuntu live CD

Filed under: Linux Tips & Tricks — Kunal Jain @ 04:21
Tags:

To enable wirelss in ubuntu live CD, Open your terminal

Application >> Accessories >> Terminal

Login as root. To login as root type

sudo su -

and press enter. you will be login as root and it your terminal type

/sbin/ifup -a

then right click on your network icon which is located on the to right hand side and select your wireless connection name and enter your network key and press Ok.

your wireless connection is configured now.

November 5, 2008

keyword “break” in perl

Filed under: Perl — Kunal Jain @ 10:15
Tags:

If you want to use break in your loop in perl then use keyword “last” instead of break.

September 30, 2008

Recompiling VirtualBox

Filed under: Linux Tips & Tricks — Kunal Jain @ 04:56

I upgraded my kernel to use 6GB of RAM but then my virtualbox stop working and start giving me errors then i recompile the virtualbox with the new kernel by first installing kernel-PAE-devel package by giving the following command

# yum install kernel-PAE-devel

and then i recompile virtualbox with new kernel by using the following command

/etc/init.d/vboxdrv setup

This command will recompile virtualbox with new kernel and after this my virtualbox start working perfectly fine.

September 23, 2008

Using Large Amount of RAM

Filed under: Linux Tips & Tricks — Kunal Jain @ 05:39

I upgraded my linux staging server to 6GB RAM but my Centos 5.2 32 bit doesn’t know how to use large amount of RAM as its a restriction with 32bit OS that they cant use RAM more than 4GB. So i recompile my kernel to use 6GB of RAM by using following command.

# yum install kernel-PAE

where PAE stands for Physical Address Extension.

yum install kernel-PAE adds the instructions to pass to the kernel on boot in grub.conf file which is located in

/boot/grub/grub.conf i.e
title CentOS (2.6.18-92.1.10.el5PAE)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-92.1.10.el5PAE ro root=/dev/VolGroup00/LogVol00 rhgb quiet mem=6144M
        initrd /initrd-2.6.18-92.1.10.el5PAE.img

In the kernel line it add the mem parameter which tells kernel to use 6GB of RAM.

September 18, 2008

Changing Date and Time in Linux

Filed under: Linux Tips & Tricks — Kunal Jain @ 03:39
Tags: ,

Using hwclock we can change Date and Time in Linux

hwclock --set --date="Sep 18 10:30:45 IST 2008"
hwclock --hctosys
« Previous PageNext Page »

Create a free website or blog at WordPress.com.