2010-06-18

Using ssh to execute remote commands

I wanted to make a "make run" command to download and run my embedded application on target using ssh. Download with scp is no problem, but then I wanted to execute the program with a command like this.

ssh root@target_ip /tmp/myprogram & 

I experienced that the session would hang. It needed a to terminal the connection. I found that it seems to be the output from the program which makes it hang, so I tried piping the output to /dev/null. Something like this:

ssh root@target_ip /tmp/myprogram 2>/dev/null >/dev/null &

And this did the trick. Make now exits fine.

2010-06-14

Using Firefox address bar for translations

Using the Firefox address bar for translating your word can easily made with the help of Google translate. Se below how to set-up this for Danish to English translation.

Handling path with white-spaces in a makefile

Handling path with white-spaces in a makefile is a bit awkward. Here is an example of how to get the path to the makefile it self, independent of the path containing white-spaces or not.


#######################################
# Find the project root directory
#######################################
PWD                       := $(shell pwd)
nullstring :=               # creating a null string
space := $(nullstring) # end of the line

MAKEFILE_DIR := $(subst $(space),\ ,$(PWD))

2010-06-10

test -s

The test -s command behaves a bit different on Cygwin and Linux. In Linux it can be OK to use test -s to test for a directory, because it size if different from 0. But in Cygwin the test fails because directories in Cygwin have the size 0.

2010-06-04

Understanding the Linux load average

I was examine /proc/loadavg today, but how to interpret it? I found this fine post describing the content:
http://juliano.info/en/Blog:Memory_Leak/Understanding_the_Linux_load_average

2010-06-02

SSH login without password

Fine describe on how to make SSH login without password is found in this post.