Monthly Archives: January 2014

Shell,(bash) tiny thing but might be important, [: missing `]’

Source from: http://stackoverflow.com/questions/15993062/bash-scripting-missing

I am getting an error ./test.sh: line 13: [: missing `]’ in the file test.sh I tried using brackets and other options such as -a or by checking the size of the file p1 but the error is always there and the else statement is always executed irrespective of the input given.I even tried by removing the ; in line 13 but it didn’t help. test.sh

    #!/bin/bash
    echo "Enter app name"
    read y
    $y &
    top -b -n 1 > topLog.log
    #-w checks for the whole word not and sub string from that word
    grep -w "$y" topLog.log > p1
    #-s option checks if the file p1 is present or not
    if [ -s "p1"];  #line 13
    then 
        echo "Successful "
    else
        echo "Unsuccessful"
    fi
    rm p1

I am new to bash scripting.So if there is any silly mistake please excuse me.

Change

if [ -s "p1"];  #line 13

into

if [ -s "p1" ];  #line 13

note the space.

local time sync through LAN using ptpd on ubuntu.

Source from: http://www.theperfectarts.com/2009/11/how-to-change-timezone-on-linux-server/#.UtZ-ABXI9ok

You can change the time zone for your server by using following command.

root@admin[~]#date

Wed Nov 11 19:30:29 EST 2009

For example we are changing time zone  from EST to GMT.

root@admin[~]#ln -sf /usr/share/zoneinfo/GMT /etc/localtime

root@admin[~]#date

Using the above command make sure systems you want to sync have the same timezone before using ptpd.

 

Source from: http://dev.couchrausch.de/degenhard/setting-up-ptpd-in-a-local-lan/

This is a short tutorial on setting up the Precsision Time Protocol (PTP) in a local LAN to synchronize time between the conneted hosts.

PTP is in comparison to NTP designed for matching the timebase of local host regardless the actual real worlds time.
It measures the delay a messaege has to get from peer A to peer B and calulates the resulting offsets so A and B have the exact same timebase.
A video explaining very friendly how it works can be found here PTP Introduction.

We suppose that you are running two debian (or similar) hosts in a local LAN with subnet address 192.168.1.0.

First step is to disable the probably running NTP daemon.
sudo /etc/init.d/ntp stop
Then prevent it from starting again at boot time.
sudo update-rc.d -f ntp remove
Now get the ptpd package via apt-get:
sudo apt-get install ptpd

First you can test by starting ptpd on the commandline to see if all is working.
Choose the master and type:
ptpd -c -b eth0 -h -D

On the slaves use same command with the -g switch:
ptpd -c -g -b bond0 -h -D

It takes some seconds to start, but then you should see the slave starting to print stats.

To activate the daemon, so it starts at boot time edit the /etc/defaults/ptpd file.
Change
START_DAEMON=no to yes
and add the commandline switches to
PTPD_OPTS=”-b bond0 -h” for the master and
PTPD_OPTS=”-g -b bond0 -h” for the slaves.

that should be all you have to do.

 

 

Robots in CES2014

Consumer Electric Show is not only for TVs and smartphone but for robots!

Check this out.

Source from: http://robohub.org/7-consumer-robots-to-look-out-for-from-ces-2014/

This year’s CES in Las Vegas showcased some of the latest technologies from both established and up-and-coming robotics companies.  Drones, telepresence robots, automated cleaning devices and entertaining toys filled the exhibit booths at the Robotics TechZone as visitors crowded around the demonstration areas for up close views.  Yet for most founders the excitement of releasing a new robotics technology is often tempered with the reality of high hurdles to mass customer adoption and tepid (but growing) interest from venture capitalists to provide funding. Consumer robotics companies are still battling customers’ hesitance to adopt “robotic” technology.  On top of that, convincing customers of the technology’s true lifetime value, finding the technological sweetspot of facilitating tasks without drastically altering user routines, and marketing to the right customer segment introduce even more barriers along the road to mass customer adoption.

Even so, the market for consumer robotics is growing.  The International Federation of Robotics estimated the 2012 market size at $1.2B with expectations to grow to $6.5B by 2016. In a panel discussion on the future of consumer robotics, Matt Fisher, founder of KumoTek Robotics said that in order to be successful robotics companies have to shift away from being gadgets and show customers a return on investment.  Paolo Pirjanian, CTO of iRobot, said that companies must focus on the core value they present to the customer.

Buzz and publicity often don’t translate into high sales numbers (Anchorman 2 anyone?) and from a company’s line of products perhaps only one or two will find mass appeal with customers. After speaking with founders and exhibitors at CES, here are the seven consumer robotic products that have the highest potential for mass customer adoption based on the strength of their value proposition to their intended market segment.  Some of these robots are still in pilot tests while others have paying customers.

via cdn3.sbnation.com