Wednesday 18 July 2012

Installing lamp

Installing lamp in ubuntu is pretty simple.

$> sudo apt-get install tasksel

where tasksel provides a user friendly interface allowing easier installation of lamp.
Run tasksel as a super user

$>sudo tasksel

A gui interface opens up,use the up/down arrow key to select the lamp server.press space to set it for installation and continue.

during installation provide the mysql password.

Once installation is complete,how to check lamp is working ?

Go to /home/var/www this is the directory from which you have to work as it is the default directory of lamp.Make a text document for a simple php script.

<?php
phpinfo();
?>

save it as index.php

Go to your browser and type localhost/index.php.


This then prints all the information of your server,in your browser ... Its a hello world program in php !!

If it does not do so your apache server may not be running.

To start it.
$ sudo /etc/init.d/apache2 start
To restart
$ sudo /etc/init.d/apache2 restart
To stop
$ sudo /etc/init.d/apache2 stop

You can also install phpmyadmin which provides a swanky gui to manage databases,

$>sudo apt-get install phpmyadmin

to access localhost/phpmyadmin needs to be entered in the browser,the user being "root" and password is what you have set.


Sunday 15 July 2012

steps to make zimage, uimage

Here we attempt to create zimage and uimage associated with linux kernel required
to port linux on arm9

First download the kernel in our case,linux-2.6.24-rc8, from kernel.org.
Then extract the file.
Then type the following in terminal:
First make a directory

$ mkdir cs-e9302
$ cd cs-e9302
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/v2.6.24/linux-2.6.24-rc8.tar.bz2
$ wget http://dev.ivanov.eu/projects/cs-e9302/linux-2.6.24-rc8_ep93xx_mmc.patch.gz
$ tar -xjf linux-2.6.24-rc8.tar.bz2
$ cd linux-2.6.24-rc8
$ zcat ../linux-2.6.24-rc8_ep93xx_mmc.patch.gz | patch -p1
$ cp cs-e9302_kernel_config .config


$ cd linux-2.6.24-rc8
$ nano Makefile

in the makefile change:
ARCH? =arm
CROSS_COMPILE=arm-linux-gnueabi-


Then save the changes in the Makefile.
After that

$ cd linux-2.6.24-rc8
$ make oldconfig
$ make menuconfig

In the menuconfig file
Make sure your system type is "EP93xx-based" and "Support Cirrus Logic EDB9302" platform:
And for more functions check "Root file system on NFS" and SMB file system support".

after making these changes just write the make command:
$ make
we will get the kernel in the arch/arm/boot directory.




Now for creating the uImage:
We will need to install mkimage in the PC.
$ sudo apt-get install uboot-mkimage

After this to get the uImage:
$ mkimage -A arm -O linux -T kernel -C none -a 30008000 -e 30008000 -n \linux-2.6.24-rc8

This would create the uImage in the same directory as the zImage.(in  linux-2.6.24-rc8/arch/arm/boot)




Making a Facebook App

For making a facebook application you need access to server where your code operates,you can however carry on with app development by using your system as the server,localhost.

Facebook accepts only https or secure http so make sure your server can support the same.

To begin with,login to your facebook account and in a different tab open this ,this being a portal for facebook developers.You can later start working by using their tutorial

For now click the create new app tab at the top right corner.An ajax alert like window opens,
Provide an app name,and you have to then provide a unique name in name space which is then used to identify your app.Also in case you do not have hosting facilities,you can sign up for the free hosting at heroku.

Pass the subsequent security check to prove your not a bot.

Then if you encounter "You've been blocked from creating apps because we haven't been able to verify your account" , this means you have to verify yourself by going here the verification requires a government issued id with name, date of birth and photo .Once verified you will be good to start your apps.

Upon success you will be given app id and secret key.

Now in a text editor compose your app code,Then go to app on facebook tab,in the canvas url provide your code file name which you have created in the default localhost folder,The secure canvas requires you to just replace http with https.
Save the changes.

Then visit https://apps.facebook.com/your-app-namespace. viola its your app!!

To develop the app in localhost check out this

Arduino tutorial

we intend to dump small codes onto arduino in linux,

We will use roboduino which is similar to arduino

Start by Downloading the IDE for Arduino boards, namely Arduino 1.0.1 from
http://arduino.cc/en/Main/Software

Open the IDE

Connect the Arduino Board using the USB cable provided with the
board


Go to Tools Serial Port to make sure that the Board has been recog-
nised. Select the appropriate port from the list. Also select the right
board from Tools Board. Roboduino uses Arduino Duemilanove. The
board given to us was Arduino Duemilanove with ATMega328 proces-
sor (If you are using any other board with different processor then all you have to do is choose the appropriate one from the list).

Go to File Examples 1.Basics Blink . This will open the blink pro-
gram from the list of sample programs provided with the IDE

Compile the program either by going to Sketch Verify/Compile or by
pressing Ctrl+R . Correct any errors that may appear. Since this is a
preloaded example program, it should compile without errors.

Go to File Upload to upload the program to the board or press
Ctrl+U.


Arduino led blink code

int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
// turn the LED on (HIGH is the voltage level)
delay(1000);
// wait for a second
digitalWrite(led, LOW);
// turn the LED off by making the voltage LOW
delay(1000);
// wait for a second
}

Code transfered to arduino board.