Notes: Teoroo meetings

Follow up questions:

  • Backup
  • Accounts on Beskow

Computer inventory

W nodes (2011)

  • W1 – Interactive
  • W2 – personal – Cherry
  • W3 – personal – Getachew
  • W4 – personal – Jolla
  • W5 – personal – Ali
  • W6 – Interactive – ???
  • W7 – personal – Dou
  • W8 – personal – Peter (russian)
  • Allium (2011) – interactive

Desktops

  • brassica (2011) – Peter
  • scapa – Jolla- offline
  • heatpipe – Guest
  • poster  – offline
  • len (2014)  – windows PC – Pavlin
  • white (2010) – CentoOS 7 – Pavlin
  • stud1 – Ubuntu 16.04
  • winback – windows PC – Kersti backup – offline
  • dimpleto be disposed soon – storage room

Department’s LAN

  • ubuntu14.04 = 130.238.197.86
  • Dou – Ubuntu
  • Anders Eriksson – Windows 7
  • Anik – Windows 7
  • Getachew – Windows 7

Other

  • ppc (2008) – personal – Pavlin
  • lochlomond (2006) – Shuanglin
  • soda (2009) – personal – Matti

System

  • www (2014) –  new HP
  • firewall (2007) – IBM old computer
  • studentlogin (2007) – IBM old computer +4 nodes for student labs
  • mackmyra (2009) – DNS, DHCP, extra storage
  • aberlour (2012) – FileServer, backup
  • Qnap
  • Qnap869

 

How to install your own Python modules or specific Python version

First time only

No root access is required at any point!

If this is the first time you read this guide, you will need to install the program pyenv. This is done by typing the following commands:

1. Download pyenv

$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv

2. Make pyenv configuration file (to source when you need to use it)

$ mkdir ~/env
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' > ~/env/pyenv
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/env/pyenv
$ echo 'eval "$(pyenv init -)"' >> ~/env/pyenv

Installing your own Python version

This section will show you how to install your own version of python. First you will have to decide which version of python you want to install. The de facto standard version of python today is 2.7.6 so this guide will show you how to install that version.

1. Get pyenv to install the python version of your liking.

$ pyenv install 3.4.0

2. Make the version you just installed to the standard version for every time you run python.

$ pyenv global 3.4.0

Now you should be all set. If you change your mind about which version of Python to use, just redo this section and choose a different version. You can also have multiple versions installed at the same time and just switch between them usuing ‘pyenv global’ as shown above, if you have a script that requires Python 3.x or any other version.

Installing modules

First, open a new terminal and run “$source ~/env/pyenv”. To be able to install your own python modules, you will first have to follow the sections ‘First time only’ and ‘Installing your own Python version’ above.

To install modules in your python, use pip

$ pip install [module name]

Example:

$ pip install numpy

Installing modules via setup.py

Unpack the package if necessary (example for nanocut)

$ tar -xvzf nanocut-12.12.tar.gz
$ cd nanocut-12.12

Then follow the installation instructions (example for nanocut)

$ python setup.py install

Run this after installing executables

$ pyenv rehash

Using the pyenv setup

In a new terminal source the pyenv setup

$ source ~/env/pyenv

Enjoy your own python version installation!

Useful commands to know

Within the pyenv (i.e. after you have sourced the configuration)

# List the available python environments that could be installed
$ pyenv versions --list

# Change to another version that you have installed
$ pyenv global 2.6.7

# Uninstall previously installed version
$ pyenv uninstall 3.3.3

$ pip freeze
$ pip list --outdated
$ pip install --upgrade SomePackage

 

Links:

http://www.uppmax.uu.se/how-to-install-your-own-python-modules-or-specific-python-version
https://aradi.bitbucket.org/nanocut/installation.htmlhttps://pypi.python.org/pypi/pip

Korint installation (Linux & Windows)

How to install

To install the “Client” that will allow you to print to Korint, follow the instructions on this page: http://www.korint.uu.se/korintClients/ . Refer to Linux/Mac/Windows links on the top right of the page.

Linux:

After installation make sure that CUPS is not sharing the printer (it will share it by default).

Windows:

Follow the instructions for the Windows IPP. This will work easier and will cause less troubles. Make sure you follow the instructions carefully – there are some patches that needs to be applied before installation. Also, read if there are some specific instructions for Windows7 or Windows8 (these change constantly)

Register your access card

Read this page “Get started

To buy List

(Conference) better pointer /the last we bought seems to confuse people/ KENSINGTON S600I WIRELESS PRESENTATION REMOTE: http://www.dustin.se/product/5010103995/kensington-s600i-wireless-presentation-remote/

 

SL 6.0 installation instructions

These instructions don’t cover obvious choices or ones that are too difficult to explain in a text this short. Ask if you have questions, but please try as much as you can yourself!

  1. Make sure you have the latest SL6.x install DVD.
  2. Boot with the DVD.
  3. Choose install Scientific Linux, don’t upgrade anything.
  4. Skip test of media.
  5. Installation language: Choose yourself (Swedish is broken on SL6.1, so do not chose this).
  6. Keyboard: Swedish.
  7. Choose “basic storage devices”
  8. Enable the DHCP on the network:
  9. Click “configure network”
  10. click device (probably eth0)
  11. click “edit”
  12. check the “connect automatically” box
  13. click apply
  14. click close
  15. verify that the network is up: click “back”, then “next”. The computer name should now be found.
  16. Timezone: Europe/Stockholm. System clock set to UTC: No!
  17. Select root password.
  18. Preferably perform manual partitioning (check custom lay out). Ask for help if you don’t know how to do this. Mount your own disk on /home_local. There you can later create a directory containing your files.
  19. Use the default options for the bootloader.
  20. Package selection: Choose most things freely, installation of software is easy once the system is installed as well (in gnome) but if you choose minimal desktop very many sysadmin tools do not get installed.
  21. Installation is done.
  22. Reboot when prompted.
  23. User configuration: Don’t add any user!!! Choose network login and choose “NIS” as source of users (no need to fill in any additional information).
  24. Set time appropriately. Configure network time protocol: Check “synchronize date and time over the network”. Delete all the default network time servers and add a single server: mackmyra.cluster.mkem.uu.se.
  25. Disable kdump.
  26. Log on as “root”
  27. edit /etc/nsswitch.conf. Change the line starting with shadow: from “files nis” to only “files”, i.e. remove nis on the shadow line. Also change the line starting with hosts from “files nis dns” to “dns nis files”. This fixes a networkmanager bug.
  28. Log on as root. Choose system administration menu and services sub menu and enable the ypbind service. Start the ypbind service. The system might need a reboot here again.
  29. As root run system-config-firewall, disable it and click apply.
  30. Edit /etc/sysconfig/selinux to set it to “disabled”. You need to reboot after this change.
  31. You should make sure at this point that logwatch is installed: yum install logwatch (as root). Make sure to fix your mail as well sendmail masquerading
  32. Turn on the local mirror of SL, so updates are quicker:

rpm -Uvh /home/public/SL6X/yum-conf-sl6x-1-711.noarch.rpm
rpm is the redhat package manager and the -Uvh flags mean upgrade, verbose, hash). The rpm-file rpm changes the locations of repositiories to point to the local mirror on mackmyra. They also change so we get automatic updates between minor releases (6.1, 6.2 …)

  • You can also enable more repositories such as epel with

yum install yum-conf-epel

  • Security updates are done automatically every night, but now after the first install simply do “yum update” as root. Answer yes when it asks if it is ok to do the download.
  • Reboot when the upgrade is complete, to get the new versions of everything (in particular the new kernel).
  • If you have your own local filesystem with files on it remember to export it in /etc/exports (and later start the nfs service to really export it!), for instance:

/home_local/daniels 192.168.0.0/24(rw,sync)

  • Following the instructions on this following link to set email masquerading correctly:

sendmail masquerading

good commands

Regenerate ssh hostkeys (SL60):
ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ”
ssh-keygen -b 1024 -f /etc/ssh/ssh_host_rsa_key -N ”
ssh-keygen -t dsa -b 1024 -f /etc/ssh/ssh_host_dsa_key -N ”

sendmail masquerading

sendmail masquerading setup on SL44 and SL50 and SL51 and SL52 and SL6X:

This configuration allows you to send mail from the command line. It also makes sure that mail sent to root on the local machine ends up on your email account.

  • Check if sendmail is installed: rpm -qa|grep sendmail
  • IFF sendmail is not installed: yum install sendmail sendmail-cf
  • Go to the directory /etc/mail and edit (as root) the file sendmail.mc

Remove the dnl (which means delete to newline, and works as comment marker in m4) on the line with the SMART_HOST and change it to look like this:
define(`SMART_HOST’,`smtp.uu.se’)

  • Remove the dnl and change the lines:
MASQUERADE_AS(`kemi.uu.se')dnl
FEATURE(masquerade_envelope)dnl
  • Add the following lines just below the previous line:
FEATURE(genericstable, `hash -o /etc/mail/genericstable')
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')
  • Save the file.
  • Create a file /etc/mail/genericsdomain by issuing:
hostname -f >/etc/mail/genericsdomain
  • Create a file /etc/mail/genericstable and put a line like the following line into it (use a tab as separation between the fields!) replace with your email address:

root daniels@mkem.uu.se

  • On SL50 and SL51 and SL52 and SL6X, also add an extra line to /etc/mail/genericstable, replace with your email address:

logwatch daniels@mkem.uu.se

  • Type make (still in /etc/mail)
  • If you get an error message when make is typed, concerning sendmail-cf install sendmail-cf by issuing

yum install sendmail-cf
and finally type make again.

  • Edit the file /etc/aliases and change the line at the bottom to point to yourself:

# Person who should get root’s mail
root: daniels@mkem.uu.se

  • You may need to disable the postfix mailer before starting sendmail. Check system-config-services. Disable postfix, stop postfix. Then start sendmail.
  • Finally run “newaliases”, and restart the sendmail server by /etc/init.d/sendmail restart

If you have problems with this, you can also check the logfile /var/log/maillog

Prevent CUPS to pause on error

Your problem could be tackled in different ways, depending on the version of CUPS you’re running.

More recent versions of CUPS come with a builtin functionality that could help here. It’s called “ErrorPolicy”. It’s default setting is selected in cupsd.conf, and determines how cupsd should handle print queues which do not behave as expected. You have 3 choices to tag to each queue individually:

ErrorPolicy abort-job
ErrorPolicy retry-job
ErrorPolicy retry-this-job
ErrorPolicy stop-printer

abort-job
— Abort this job and proceed with next job in same queue
retry-job
— Retry this job after waiting for N seconds (where N is determined by cupsd.conf’s “JobRetryInterval” directive).
retry-this-job
— Retry current job immediately and indefinitely.
stop-printer
— Stop current print queue and keep the job for future printing. This is still the default, unless you define otherwise as per above mentioned alternatives It also was default + only possible behaviour for all queues in previous versions of CUPS (the one you do want to get rid of as per your question).

Additionally, you can set individual ErrorPolicies to each separate print queue. This setting would be noted in the printers.conf file. (Set it from a commandline with lpadmin -p printername -o printer-error-policy=retry-this-job).

For older versions of CUPS I’d recommend to have a look at beh, the CUPS BackEnd Handler. beh is a wrapper which can be applied to any CUPS backend.

Assuming your print queue currently has defined a backend of socket://192.168.1.111:9100(external link), and it behaves in the way you don’t like (being disabled by cupsd from time to time due to network connection problems). With beh you’d re-define your backend like this:

beh:/0/20/120/socket://192.168.1.111:9100

This would retry a job 20 times in two minute intervals, and disable the queue only when still not succeeding. Or you could do this:

beh:/1/3/5/socket://192.168.1.111:9100

This retries the job 3 times with 5 second delays between the attempts. If the job still fails, it is discarded, but the queue is not disabled. You want to let cupsd try indefinitely to connect to the device? Good, try this:

beh:/1/0/30/socket://192.168.1.111:9100

Try infinitely until printer comes back. Intervals between connection attempts are 30 seconds. The job does not get lost when the printer is turned off. You can intentionally delay printing simply by switching off the printer. A good configuration for desktop printers and/or home users.

Overall, there is no need to mess around with bash scripts, cron jobs, lpadmin, cupsenable or sudo in order to re-activate CUPS queues going down erratically.

copying data to home directory or backup directory

Mount your new disk on your computer as /home_local or something very similar to that.

Copy data from the lagavulin fileserver either over NFS (without removing any files!):
rsync -av /home/USER/ /home_local/USER/
or over ssh directly from lagavulin:
rsync -av -e “ssh -c blowfish” lagavulin:/home1/USER/ /home_local/USER/

You can do the above when you contiune to work as usual. To do the final transfer you should also use the –delete option to rsync which remove the old files on the target if they don’t exist on the source anymore, i.e.
rsync -av –delete /home/USER/ /home_local/USER/

When doing this it is best to not be logged on and use a lot of programs. Perhaps simply logging in through a text console is the best.

Make sure that the source and target are in the correct order!

When this has been done contact someone to make sure the NFS export is working, the auto.home and auto.backup files are correct and to issue the correct commands to put the information in the NIS tables.

To do the final backup I have a script in my home directory which looks like this and is named backup.sh which I run periodically:

#!/bin/sh
BHOST="auchentoshan"
if [ "`hostname`" == "$BHOST" ]; then
  time rsync -e "ssh -c blowfish" -av --delete /home/daniels/ lagavulin:/home1/daniels/
else
  echo This is not host $BHOST
fi

In this case you should also ensure that you get the correct order for source and target directories!