Friday, July 31, 2009

how to install tinyos in debian/boss/ubuntu.

vim /etc/apt/sources.list
deb http://ftp.se.debian.org/debian lenny main contrib non-free
deb http://tinyos.stanford.edu/tinyos/dists/ubuntu feisty main

#apt-get update
#apt-get install tinyos-2.0.2


which installs following packages.
avr-binutils-tinyos avr-gcc-tinyos avr-libc-tinyos avr-optional-tinyos
avr-tinyos avr-tinyos-base avrdude-tinyos deputy-tinyos graphviz gsfonts-x11
java-common libgraphviz4 libnss-mdns msp430-binutils-tinyos
msp430-gcc-tinyos msp430-libc-tinyos msp430-optional-tinyos msp430-tinyos
msp430-tinyos-base nesc odbcinst1debian1 python-serial sun-java5-bin
sun-java5-demo sun-java5-jdk sun-java5-jre tinyos-2.0.2 tinyos-base
tinyos-required-all tinyos-required-avr tinyos-required-msp430 tinyos-tools
ttf-liberation unixodbc
after installation setup require to be done
add in .bashrc or /etc/profile
#Sourcing the tinyos environment variable setup script
source /opt/tinyos-2.0.2/tinyos.sh


Installing a TinyOS enviromnent has five basic steps; Windows requires an extra step, installing Cygwin, which is a UNIX-like environment. The steps are:

1. Installing a Java 1.5 (Java 5) JDK. Java is the most common way of interacting with mote base stations or gateways that are plugged into a PC or laptop.
2. Windows only. Install Cygwin. This gives you a shell and many UNIX tools which the TinyOS environment uses, such as perl and shell scripts.
3. Installing native compilers. As you're compiling code for low-power microcontrollers, you need compilers that can generate the proper assembly code. If you using mica-family motes, you need the AVR toolchain; if you're using telos-family motes, you need the MSP430 toolchain.
4. Installing the nesC compiler. TinyOS is written in nesC, a dialect of C with support for the TinyOS concurrency model and component-based programming. The nesC compiler is platform-independent: it passes its output to the native compilers, so that it can take advantage of all of the effort put into their optimizations.
5. Installing the TinyOS source tree. If you want to compile and install TinyOS programs, you need the code.
6. Installing the Graphviz visualization tool. The TinyOS environment includes nesdoc, a tool that automatically generates HTML documentation from source code. Part of this process involves drawing diagrams that show the relationships between different TinyOS components. Graphviz is an open source tool that nesdoc uses to draw the diagrams.


reference
http://docs.tinyos.net/index.php/Installing_TinyOS_2.0.2#Two-step_install_on_your_host_OS_with_Debian_packages

Sunday, July 19, 2009

How to use Your Mobile Phone as Remote for your Linux Media Player

One of the Accessories that comes shipped with my Dell M1330 laptop is a media Remote control which allows the laptop media player to be controlled remotely. Unfortunately Dell in their wisdom left this cool accessory out of the default configuration of the M1330 that ships with Ubuntu pre-installed. Thankfully there is an even better tool available which is much more useful than the XPS media remote, Its is called Remuco

Remuco is a duplex remote control system for Linux media players and mobile devices equipped with Bluetooth or WiFi.

With Remuco, you can remotely control your favorite media player. You can switch to the next, previous, or any other media within the current playlist, browse your media library and activate other playlists, rate your media, adjust volume, and more. On the mobile device (the remote control), it displays information about the current media, including cover art.

source

**Ok the name is by no means cool or an a good indicator of what it can do, some of its features include**
Features

Remuco allows you to control:

* Playback

*Seek forward or backward in current playing item

*Set the playlist to repeat or shuffle

*Control volume

*Rate,

*Tag Media being played

on your PC from your mobile phone

It also Displays:

*Current playing songs including album art

*Volume level

*Progress level of current playing song and its current rating

Media browser features includes:

*Browse Currently active playlist and apply actions to them

*Browse the play queue and apply actions to them

*Browse the players media library and apply actions to them

*search for items in the player’s media library and apply actions to items in the search result

*browse the local filesystem and apply actions to files

*** Not all feature is available on all media player example Rhythmbox seems to be better support compared or other media player***
Installation

Installation of Remuco is in two part, A player adapter is installed on your PC and the client on your mobile device

How to install the player adapter:

(K)Ubuntu

First you need to add the 3rd party repository to your sources.list this can be done from synaptic

System -> Administration -> Synaptic Manager -> Settings -> Repositories.

Here you can enable the repositories for Ubuntu Software and Third Party Software.

For Third Party Software select Add -> enter the repository’s address.

Ubuntu 9.04

deb http://ppa.launchpad.net/remuco-team/ppa/ubuntu jaunty main

Ubuntu 8.10

deb http://ppa.launchpad.net/remuco-team/ppa/ubuntu intrepid main

Ubuntu 8.04

deb http://ppa.launchpad.net/remuco-team/ppa/ubuntu hardy main

Now you need install the repository Key

Open your terminal and enter:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51A6F565

Now you will need to reload your sources by clicking the reload button on synaptic once done search for the team remuco, and you will see a list of remuco adapters for different Media players for linux

e.g I am on kde and i use amarok so i just installed the remuco-amarok package

Other Linux Distros can check here for installation Instructions

you now need to add remuco to the list of startup application

Amarok

The Amarok adapter requires Amarok 2.

The Amarok adapter can be started with:

remuco-amarok

Audacious

The Audacious adapter can be started with:

remuco-audacious

Banshee

The Banshee adapter requires Banshee ≥ 1.4.

The Banshee adapter can be started with:

remuco-banshee

MPD

The MPD adapter requires MPD ≥ 0.13.

The MPD adapter can be started with:

remuco-mpd

Rhythmbox

Start Rhythmbox and activate the plugin Remuco in the menu Edit → Plugins.

Totem

The Totem adapter requires Totem ≥ 2.22.

Start Totem and activate the plugin Remuco in the menu Edit → Plugins.

TVtime

The TVtime adapter requires TVtime ≥ 1.0.

The TVtime adapter can be started with:

remuco-tvtime

NOTE: With the exception of Rhythmbox and Totem, Remuco adapter for other Media players can be started automatically by adding remuco-media-player name to your startup session e.g for amarok add remuco-amarok to (gnome) System/Preference/Sessions (or startup application). (KDE) System-settings/ Advance Autostart
Client side installation

Installation on your mobile can be done by downloading remuco package here (the latest version on remuco in blog time is 0.9.0) extract the .tar.gz and goto /client/app/ and send the .jar file to your mobile device and install it from there

(Note: The client requires a mobile device with JavaME support (MIDP ≥ 2.0, CLDC ≥ 1.1). If you use Bluetooth to connect to a player adapter, additionally JSR-82 (Java Bluetooth) must be supported.)

Once installed on the device in my case i open terminal and run the following command remuco-amarok then i start amarok and start the client on my Nokia E71

Connected remuco to my laptop, it did its thing and yola i was able to control my amarok player from my phone.

Remember to first go to More and key-binding to set your own control key preference

Happy listening and I hope this helps someone .. (sorry if this is badly written haven’t had time to blog in a while been very busy :-( so am a bit rusty i guess)


reference
http://bigbrovar.wordpress.com/2009/07/13/how-to-use-your-mobile-phone-as-remote-for-your-linux-media-player/
http://remuco.sourceforge.net/index.php/Getting_Started#Installation

Thursday, July 16, 2009

How to Extract pages from PDF files

There are a number of ways to extract a range of pages from a PDF file: there are PDF related toolkits for doing it, or you can use Ghostscript directly.

For example, to extract pages 22-36 from a 100-page PDF file using pdftk:

$ pdftk A=100p-inputfile.pdf cat A22-36 output outfile_p22-p36.pdf

Or use a combination of xpdf-utils (or poppler-tools) with psutils and the ps2pdf command (which ships as part of Ghostscript):

$ pdftops 100p-inputfile.pdf - | psselect -p22-36 | \
ps2pdf14 - outfile_p22-p36.pdf

Or, just use Ghostscript (which, unlike pdftk, is installed nearly everywhere; and you've been using it in the last command anyway):

$ gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=22 -dLastPage=36 \
-sOutputFile=outfile_p22-p36.pdf 100p-inputfile.pdf

Regarding speed and efficiency of the processing and more important the quality of the output file, the 2nd method above is for sure the worst of the 3. The conversion of the original PDF to PostScript and back to PDF (also known as "refrying" the PDF) is very unlikely to completely preserve advanced PDF features (such as transparency information, font hinting, overprinting information, color profiles, trapping instructions, etc.).

The 3rd method uses Ghostscript only (which the 2nd one uses anyway, because ps2pdf14 is nothing more than a wrapper script around a more or less complicated Ghostscript commandline. The 3rd method also preserves all the important PDF objects on your pages as they are, without any "roundtrip" conversions....

The only drawback of the 3rd method is that it's a longer, more complicated command line to type. But you can overcome that drawback if you save it as a bash function. Just put these lines in your ~/.bashrc file:

function pdfpextr()
{
# this function uses 3 arguments:
# $1 is the first page of the range to extract
# $2 is the last page of the range to extract
# $3 is the input file
# output file will be named "inputfile_pXX-pYY.pdf"
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=${1} \
-dLastPage=${2} \
-sOutputFile=${3%.pdf}_p${1}-p${2}.pdf \
${3}
}

Now you only need to type (after starting a new copy bash or sourcing .bashrc) the following:

$ pdfpextr 22 36 inputfile.pdf

which will result in the file inputfile_p22-p36.pdf in the same directory as the input file.

Wednesday, July 8, 2009

How to install Firefox 3.5 in BOSS/Linux operating system

First download firefox from http://www.mozilla.com/en-US/firefox/firefox.html
extract it.(considering that it extracted at /opt folder)
Next, make a shortcut to the firefox executable - right click on the desktop, click on Create Launcher, and at the Command field enter the command below:
/opt/firefox/firefox -P
The -P switch will start Firefox 3.5 using the profile manager, so from here all you need to do is to create a new profile for your Firefox 3.5:
if default profile is used then create new profile ex. BOSS and then path to dir.
Additionally, you can specify the --no-remote switch (firefox --no-remote -P) so you can run both your currently 3.0.11 and 3.5 instances at the same time. The --no-remote switch doesn't connect Firefox to a currently running instance.