Solution for the ".bashrc vs ssh command" problem

Posted by daniel on 25 June, 2012
Category Linux

Some Linux users (including myself) have been unsuccessfully trying to execute a command via SSH, for example:

ssh user@host mycommand


The problem seems to be that "mycommand" is in a directory that is not in the PATH. However, when they connect normally, they can see the directory in the PATH environment variable.

It seems that most of these users (again, including myself) update the PATH variable in the .bashrc file and, apparently, the .bashrc file is not executed when connected "non-interactively" via ssh.

After looking for a good while, many people suggested to check if the .bashrc was called by .profile or .bash_profile or something like that. Well... that did not solve my problem.

What, in fact, happened was that .bashrc was being called (or "sourced") by SSH, but the guys from the distro decided to add the following lines in it:

# If not running interactively, don't do anything
[ -z "$PS1" ] && return


Basically, the test above only allows the execution of the rest of .bashrc if it is an interactive shell, thus it does not work for my needs. Why is it there? I have no idea... anyway... I just commented the test and it worked perfectly.
 

Comments (3)



Coffee for Turing

Posted by daniel on 23 June, 2012
Category Coffee

Today, the honors go to Alan Turing, the "Father of Computer Science", who would be celebrating 100 years since his birth. Among other achievements, for example as a successful cryptologist during the Second World War, he was the person who created the concept of computers and programs.

20120623-coffee-turing.png


The coffee cup was a gift from ACM for my first year as member. And that coffee was in his honor.

Thank you, Mr. Turing, for creating what is now a science and the profession of many (including myself).
 

Comments (0)



Now, Xoom™ing with Ice Cream Sandwich

Posted by daniel on 22 June, 2012
Category General

I have recently starting using a Motorola Xoom™ with Android 4.0 (Ice Cream Sandwich).

My cellphone has Froyo (Android 2.2) installed and, comparing to that version of Android, the ICS came a long way and it's a lot better. First thing I noticed was that we can now organize the home screen putting Icons into "folders", just by moving an icon over another one. While I used all the five home screens in my cellphone and feel I needed more, with this feature, I don't use more than 2 home screens in the Xoom.

What I didn't like much was the camera. I have tried to take pictures of my daughter and I barely can get one that is not blurred. (Granted, my daughter simply can't be still for a picture... too much energy!) On a good side, I really like the landscape option for the camera. It worked nicely... Now I just need to get an opportunity to find a nice landscape to photograph.

In terms of performance, I don't know if it's because of the limited number of applications I am using, but I really find the tablet to be quite fast and battery has lasted a bit more than one day (with moderate use, which I find it to be acceptable.

Also, I liked the fact it has 32GB of internal storage (which is a lot compared to other products) and still accepts micro-SD card.

My favorite apps for it, so far, are:
- ConnectBot: a SSH client for Android
- Hacker's Keyboard: A substitute for the original keyboard that gives you a PC keyboard on screen (with numbers over the first row of letters, for example).
- Apex Launcher: "Launcher" is the android equivalent to Windows Managers in Linux. This one is quite light and provides some nice customization options, including number of home screens and animations.
 

Comments (1826)



Coffee helps preventing Alzheimer’s

Posted by daniel on 16 June, 2012
Category Coffee

I had already heard that Coffee would be good for memory, but things seem to be even better.

A recent study from University of South Florida and University of Miami with older adults (over 65) who drank coffee regularly during their lives (about 3 cups a day) had less chances of developing Alzheimer's.
 

Comments (2070)