Biboroku

Saturday, November 14, 2009

Installing Freemind on Debian Lenny

Filed under: Debian, Lenny, Linux — nomo17k @ 21:15

Download .deb from Freemind’s sourceforge web page, e.g., freemind_0.8.1-2_all.deb. Then

# apt-get install sun-java6-jre
# apt-get install libcommons-codec-java libcommons-lang-java libjcalendar-java
# apt-get install libjgoodies-forms-java librelaxng-datatype-java
# dpkg -i freemind_0.8.1-2_all.deb

Add the following line to ~/.bashrc:

export JAVA_HOME=/usr/lib/jvm/java-6-sun

(Without the environment variable set, I could not get freemind to run at all.) You can then launch it by typing freemind on the shell or choose the program in the menu under office.

Monday, April 20, 2009

Astro Software in Debian Lenny

Filed under: Debian, Lenny, Linux, Research — nomo17k @ 17:44

Here my goal is to build a computing environment where Python is the glue of all the astro-related tools (PyRAF, stsci_python, etc.).

IRAF

In order to use PyRAF, IRAF needs to be installed first.

Python

At the very least, I want the basic Python packages related to science/data analysis:

# apt-get install python ipython python-doc
# apt-get install python-numpy python-scipy python-matplotlib

PyRAF

Install several Python packages:

# apt-get install tk8.4-dev python-tk libf2c2-dev
# apt-get install python-dev python-pmw python-urwid

Test if the required Python modules exists by making sure that no ImportError occurs below:

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

If you have an installation of previous version, check the section Cleaning An Old Installation of the installation instruction at the STSci web site to make sure things are clean.

Prepare the source directory:

# mkdir /usr/local/src/python_packages/stsci_python
# cd /usr/local/src/python_packages/stsci_python

Download and extract the source:

# wget http://stsdas.stsci.edu/download/stsci_python_2.7/stsci_python_2.7.tar.gz
# gunzip -c stsci_python_2.7.tar.gz | tar xvf -
# cd stsci_python_2.7/

Normally, using python setup.py install will do the job, but it probably ends in compilation error, complaining the header file cfunc.h not found. In order to force the installation, modify setup.py in the current directory, so that at the very end of the file an additional include directory is defined:

distutils.core.setup(

    # This name is used in various file names to identify this item.
    name="stsci_python",

    # This version is expected to be compared to other version numbers.
    # It will also appear in some file names.
    version="2.7",

    # Apparently, description is not used anywhere.
    description="",

    packages = all_packages,
    package_dir = all_package_dir,
    ext_modules = all_ext_modules,
    scripts = all_scripts,
    data_files = all_data_files,
    include_dirs = ['/usr/lib/python2.5/site-packages/numpy/numarray/numpy']
)

Then we can follow the normal instruction:

# python setup.py install
# cd stscidocs
# python setup.py install

Before running PyRAF for the first time, clear the cache by removing directories under your “pyraf” directory, which is located in where you have your loginuser.cl for IRAF.

That’s it!

Friday, April 17, 2009

IRAF on Debian Lenny

Filed under: Debian, Lenny, Linux, Research — nomo17k @ 15:54

Here is my installation note for IRAF (ver 2.14.1) on Debian Lenny.

Basically, the installation procedure does not differ much from the one outlined in the official IRAF installation guide.

First, create “iraf” user account to the system if it does not exist already. Also, install the C shell (csh) as it appears to be the preferred shell for IRAF (people apparently don’t know when to move on).

$ sudo apt-get install csh ncompress
$ sudo adduser iraf

After user “iraf” has been added to the system, change its home directory and the default shell by modifying /etc/passwd to read:

iraf:x:1002:1002:IRAF Admin,,,:/iraf/iraf/local:/bin/csh

Note that the number 1002 may be different depending on how many users already have the accounts on the system. Only change the last two entries delimited by colon to /iraf/iraf/local and /bin/csh.

We assume IRAF will be installed under /usr/local/iraf, and a symlink /iraf points to that directory:

# mkdir /usr/local/iraf
# chown iraf /usr/local/iraf
# chgrp iraf /usr/local/iraf
# ln -s /usr/local/iraf /iraf

Login as user “iraf,” and create a bunch of directories:

# su iraf
% cd /usr/local/iraf
% mkdir extern imdirs iraf irafbin x11iraf
% mkdir irafbin/bin.linux
% mkdir irafbin/noao.bin.linux

Install x11iraf. You may use the pre-built binary distribution:

% cd /usr/local/iraf/x11iraf
% wget http://iraf.noao.edu/x11iraf/x11iraf-v2.0BETA-bin.redhat.tar.gz
% gunzip -c x11* | tar xvf -
% su
# ./install
# exit

and select defaults for all the user input upon installation. (Note that if xgterm quits on an error complaining about “ptys,” then you may need to turn on the kernel configurations CONFIG_LEGACY_PTYS and CONFIG_UNIX98_PTYS; yes, you may need to rebuild the kernel…)

Install the source:

% cd /usr/local/iraf/iraf
% wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/as.pcix.gen.gz
% gunzip -c as.pcix.gen.gz | tar xvf -

Install the binaries:

% cd ../irafbin/bin.linux
% wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/ib.lnux.x86.gz
% gunzip -c ib.lnux.x86.gz | tar xvf -

% cd ../noao.bin.linux
% wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/nb.lnux.x86.gz
% gunzip -c nb.lnux.x86.gz | tar xvf -
% exit

Run the install script:

# su iraf
% cd $iraf/unix/hlib
% source irafuser.csh
% su
# ./install

Follow the instruction for the most part, but the following are not necessary: IRAF networking and tapecap device.

# exit
% cd
% source .login
% rehash
% cl

This should start ecl.

For exposing external packages (which must already be installed if not already) within IRAF, the text file extern.pkg can be reused if these packages are already installed. Copy it from a previous installation to /usr/local/iraf/iraf/unix/hlib.

# External (non core-system) packages.  To install a new package, add the
# two statements to define the package root directory and package task,
# then add the package helpdb to the `helpdb' list.

reset	noao		= iraf$noao/
task	noao.pkg	= noao$noao.cl

reset	tables		= /iraf/extern/tables/
task	tables.pkg	= tables$tables.cl

reset	mscred		= /iraf/extern/mscred/
task	mscred.pkg	= mscred$mscred.cl

reset	stsdas		= /iraf/extern/stsdas/
task	stsdas.pkg	= stsdas$stsdas.cl
task	apropos		= stsdas$apropos.cl

reset	rvsao		= /iraf/extern/rvsao/rvsao-2.5.0/
task	rvsao.pkg	= rvsao$rvsao.cl

reset	xdimsum		= /iraf/extern/xdimsum/
task	xdimsum.pkg	= xdimsum$xdimsum.cl

reset	fuzzy		= /iraf/extern/fuzzy/
task	$fuzzy.pkg	= fuzzy$fuzzy.cl

set	crrefer		= "/home/astro_data/stsci_data/"

reset   helpdb          = "lib$helpdb.mip\
                          ,noao$lib/helpdb.mip\
                          ,tables$lib/helpdb.mip\
                          ,stsdas$lib/helpdb.mip\
                          ,mscred$lib/helpdb.mip\
                          ,rvsao$lib/helpdb.mip\
			  ,xdimsum$lib/helpdb.mip\
                          "

keep

You can simply comment out lines with “#” if some packages are not installed.

The packages stsdas and tables should be installed following the official instruction.

Sunday, March 22, 2009

Wine on Debian Lenny

Filed under: Debian, Lenny, Linux — nomo17k @ 17:40

To install Wine, do

# apt-get install wine

To launch a Windows Explorer-like file browser, do

$ winefile

in which you can manage installers and programs just like in Windows.

Installing IEs4Linux

Follow the instruction here.

Microsoft Natural Ergonomic Keyboard 4000 on Debian Lenny

Filed under: Debian, Lenny, Linux — nomo17k @ 17:34

Unfortunately not all the “special keys” can be enabled at this point; the zoom bar in the middle being notable example. For my own use it really doesn’t matter since I rarely make use of them.

An approach here is to use an APT pinning to get a later version of the xkb-data package from the testing repository. That includes the keyboard layout data for MS Ergonomic Keyboard 7000, which we can use.

First, add a testing repository to /etc/apt/sources.list:

deb http://ftp.us.debian.org/debian lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian lenny main contrib non-free

deb http://www.debian-multimedia.org/ lenny main

deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

# only for a few packages
deb http://ftp.us.debian.org/debian testing main contrib non-free

In /etc/apt/preferences, have the following lines:

Package: *
Pin: release v=5.0*
Pin-Priority: 700

Package: xkb-data
Pin: release a=testing
Pin-Priority: 650

Here v = 5.0* means the stable version (Lenny is 5.0). So only xkb-data will be fetched from testing, but the rest remains stable.

Then install the xkb-data package:

# apt-get update
# apt-get install xkb-data

Now under the K menu go to Control Center -> Regional & Accessibility -> Keyboard Layout -> Layout. Choose Microsoft Natural Wireless Ergonomic Keyboard 7000 as the Keyboard model. Restart X.

Most special keys should be working by now.

Linksys WET54G on Debian Lenny

Filed under: Debian, Lenny, Linux — nomo17k @ 15:33

Add the following interface to /etc/network/interfaces:

iface wet54g inet static
  address 192.168.1.10
  netmask 255.255.255.0

Connect the bridge WET54G to the computer. If an Ethernet card is configured as eth0, do

# ifup eth0=wet54g

The WET54G web interface can be accessed at 192.168.1.226. Keep the static IP address for later use. Specify wireless SSID and configure security setting if necessary. The network type should be infrastructure in normal setting. Restart the bridge.  (Also for me WPA2 PSK and TKIP for security setting…)

Once the bridge is receiving the wireless connection, having

auto eth0
iface eth0 inet dhcp

in /etc/network/interfaces will configure the network via DHCP on reboot.

Compiz Fusion in Dell XPS 630i (Debian Lenny)

Filed under: Debian, Lenny, Linux — nomo17k @ 15:24

Note: This is a cursory note when I set up Lenny on Dell XPS 630i (the video card is nVidia GeForce 8800 GT) when Lenny was still testing. For detail I used this and that.

Install the nVidia video driver from the nVidia web site (use their installer and follow their instruction). Then install some packages:

# apt-get install compiz compiz-core compiz-gnome compiz-gtk compiz-plugins
                  compizconfig-settings-manager libcompizconfig0
                  python-compizconfig libdecoration0
# apt-get install compiz-fusion-bcop compiz-fusion-plugins-extra
                  compiz-fusion-plugins-main
                  compiz-fusion-plugins-unsupported
                  compizconfig-backend-gconf compizconfig-backend-kconfig
                  compizconfig-settings-manager libcompizconfig0
# apt-get install compiz-kde fusion-icon

Also to let the script modify /etc/X11/xorg.conf, do:

# nvidia-xconfig --composite
# nvidia-xconfig --render-accel
# nvidia-xconfig --allow-glx-with-composite
# nvidia-xconfig --add-argb-glx-visuals

In /etc/X11/xorg.conf, make sure DefaultDepth is set to 24, if it isn’t already, then add the following lines below “EndSubSection” or above the first “SubSection”:

Option         "AddARGBGLXVisuals" "true"
Option         "DisableGLXRootClipping" "true"

Save the file and exit the text editor. Now restart the X-server by pressing Ctrl + Alt + Del or reboot.

Use fusion-icon to configure. You can use *.profile file to restore saved configuration.

To auto-start compiz fusion at KDE startup, open an editor, and create a file with the following contents:

#!/bin/sh
/usr/bin/fusion-icon

Save the file as ~/.kde/Autostart/compiz_start.sh.

Using Hostnames in Local Area Network on Debian Lenny

Filed under: Debian, Lenny, Linux — nomo17k @ 14:45

Background: I have a couple Debian Lenny boxes. They connect to the Internet via a wireless (or wired) router. The IPs are assigned dynamically via DHCP. It is fairly easy to set up a LAN with static IP addresses (e.g., 127.0.0.101, 127.0.0.102, etc.), but it is not so convenient to remember IP addresses for each computer in LAN. When I ssh into another box, I want to use a hostname rather than an IP address.

There is a very easy solution!

In /etc/dhcp3/dhclient.conf of each computer, specify

send host-name "johndoe";

(for a host named “johndoe”). This way a host can be identified via a hostname, not via an IP address.

EPSON Perfection 1260 on Debian Lenny

Filed under: Debian, Lenny, Linux — nomo17k @ 13:46

Kernel (version 2.6.x) must be configured such that it has /proc and usb device file system support. (Or more recent info state that you need the kernel modules usbhid, ehci_hcd, and ohci_hcd; see this guide for detail.)

Then install a bunch of software

# apt-get install dbus hal sane
# apt-get install sane-utils xsane libpng-dev usbutils

Verify the scanner is detected:

# sane-find-scanner

should indicate something similar to

found USB scanner (vendor=0x04b8 [EPSON], product=0x011d
[EPSON Scanner], chip=LM9832/3) at libusb:003:005

Add a user who needs access to the scanner to the group scanner:

# adduser username scanner
# exit
$ scanimage -L

Make sure that the last command shows something similar to

device `plustek:libusb:003:005' is a Epson Perfection 1260/Photo USB
flatbed scanner

This confirms that the scanner is usable.  After starting a new session,

$ xsane

should get you going. Note that hotplugging may not recognize the scanner at times (e.g., after rebooting). Try unplug and plug again the USB cable if that happens.

Timezone Setting for Windows / Debian Lenny Dual Boot

Filed under: Debian, Lenny, Linux — nomo17k @ 13:38

In order to coexist with a dumb system like Microsoft Windows, it may be necessary to set up Debian to use localtime instead of UTC to keep track of time.

In /etc/default/rcS, change a line to have UTC=no. Then reboot. If you wish, the system time can be then synchronized with the ntp.

Next Page »

Blog at WordPress.com.