Archive for the ‘Ubuntu’ Category

How to keep a ssh session alive (keeping the ssh terminal connected)

So you are tired of your ssh connection timing out making you have to log in again and again? Keeping the ssh session alive is not hard, but be aware that the session times out due to security reasons.

To keep the ssh session alive for only one user:

Edit your ssh config file at: ~/.ssh/config

sudo gedit ~/.ssh/config

then add the line: ServerAliveInterval 300

right at the end of the document, save and close.

To keep the ssh session alive for all users:

sudo gedit /etc/ssh/ssh_config

then add the line:

ServerAliveInterval 300

right at the end of the document, save and close.

 

This will cause the connected computer to send a data packet every 5 min to make sure the connected ssh terminal stays active.

How to install PyRAF in Ubuntu

Before installing PyRAF in Ubuntu you need to check if you have the following programs installed:

Package Tested with
IRAF 2.14 on Ubuntu
STSDAS/TABLES 3.10
Python 2.5.4, 2.7.1
Tcl/TK 8.5.7
Pmw 1.3.2
urwid 0.9.9.1 (optional)
ipython 0.10.1 (optional)
NumPy 1.5.1
GNU readline 6.1

To install IRAF with STSDAS and TABLES I would highly recommend you follow these instructions. The rest of the stuff you can get using either the Ubuntu Software Center or the Synaptic Package Manager.

To test if you have all got it working try loading the programs:

python
>>> import readline
>>> import Tkinter
>>> Tkinter._test()
>>> import Pmw

If you do not get an ImportError it means that Tcl, Tk, Readline, Python and Pmw are installed on the system.

Download PyRAF (stsci_python). PyRAF comes as part of stsci_python.

Go to the installation directory where you have IRAF installed:

cd /iraf/iraf

Move the downloaded fie to /iraf/iraf. Change user with your username:

sudo cp /home/user/Downloads/stsci_python_2.11.tar.gz .
tar -zxf stsci_python_2.11.tar.gz
rm stsci_python_2.11.tar.gz
cd stsci_python_2.11

Install the stsci_python package:

sudo python setup.py install

You might find that you run into the following error:
pytools.irafglobals.IrafError: Attempt to set unknown lone parameter dp

This is due to a typo in iraf/unix/hlib/extpkg.cl. To fix it, you will need to change line 23 in that file (within your 2.15 IRAF installation) from:

dp = mktemp (“tmp$dpkg”)

to this:

dpkg = mktemp (“tmp$dpkg”)

Then PyRAF should start up as usual.

How to burn a blu ray disc in Ubuntu

The easiest way to burn a blu ray disc in Ubuntu is by installing the program K3b.

Go to Ubuntu Software Center under the Applications menu. Search for K3b and install the program. That’s it!

Setup a webcam security system with Ubuntu Linux

Having moved in to my new place I wanted to experiment with setting up my own webcam security system. Being a fan of Ubuntu Linux I discovered that this can easily be done using a program called motion. Simply explained, motion turns your webcam into a security camera that can do all sorts of things, such as detect and record motion.

How to install motion:

Plug in your webcam

Open up a terminal and write

sudo apt-get install motion

To run the program you just write

motion

If you get errors about not having the right permissions you could run it by typing sudo motion. I would however recommend instead to change the permissions of the motion files.

sudo chown -R username:username /etc/motion

How to configure motion:

To configure motion open the configuration file and change the well documented options. First do a backup though just to be safe.

cp /etc/motion/motion.conf motion.conf.backup
gedit /etc/motion/motion.conf
Return top

About me:

Observational exoplanet astronomer studying the atmospheres of exoplanets. Interested in public outreach and conveying my interest in astronomy to others.

Follow me on Twitter

ExoplanetAstronomer.com