23 August 2013

500. Changing language in Debian (GNOME 3, terminal) to e.g. fr_CH

This is both obvious, and tricky at the same time.

1. Install locales
The first step is to install the languages you need
sudo apt-get install locales
sudo dpkg-reconfigure locales

2. Optional: language packs
If you want e.g. libreoffice to use the new language, you'll need to install the corresponding language pack. Most programmes will NOT need this, but libreoffice and iceweasel do. The same goes for KDE.
sudo apt-get install libreoffice-l10n-fr iceweasel-l10n-fr icedove-l10n-fr

Basically, search for packages with l10n in their names.

3. GNOME
Select the new language in GNOME 3 by gong to Region and Language:
Now, here's the trick: even if the language you want is listed, click on the "+" sign in the bottom left corner, and select it like this:
While you now have two 'French' items, this is necessary or the language will not be correctly set. If you do NOT do this some things will change language, some won't (e.g. Activities won't change to Activités). In that case, if you log out, then back in and go to Languages you'll find that the language is set to "Unspecified [ANSI_X3.4-1968]". See the screenshot at the very  bottom of this post for an example of what it looks like.


Log out of GNOME and log back in again. Et voilà.
And...we have French! French everywhere.


4. Optional: set it in terminal
If you set the language in GNOME as shown above you shouldn't need to do this. However, if you are not using GNOME 3 you may want to set the language explicitly in your terminal by sticking the following in your ~/.profile or ~/.bashrc
export LANG="fr_CH.utf8"

When it's NOT OK:
Note how it says 'Pays et Langue' but still says 'Activities' i.e. the language for some items has been changed, but not all.
See step 3 for an explanation of what's going on.

499. Briefly: Drawing NMR sequences using metapost and Mark White's pulse.mp

Since it's Friday afternoon and I'm not likely to get anything useful done in the hour that remains before going home, I might as well put up another post.

Since posting http://verahill.blogspot.com.au/2013/08/498-briefly-drawing-nmr-pulse-sequences.html I've had a look at this: http://www.celos.net/comp/pulses/

And that actually is (almost -- let's not get carried away here) exactly what I have been looking for. The main issue was that it's meant for metapost -- or rather, the main issue was my unfamiliarity with metapost. Anyway, my life is know complete.

So here's how to get started...

First 'install' the metapost script:
sudo apt-get install texlive-metapost
mkdir ~/texmf/metapost
cd ~/texmf/metapost -p
wget http://www.celos.net/comp/pulses/pulses.mp
sudo texhash

Next, time to test-drive it
mkdir ~/tmp/pulse_test -p
cd ~/tmp/pulse_test
vim test.mp
input pulses.mp beginfig(0); initf; startline(rf,"RF"); xline(1); xpulse(0.5,0.5,"90"); ospan(-0.25,-1.0,1.5,"d1"); xline(0.75); xpulse(1.0,0.5,"180"); ospan(-0.5,-1.0,1.5,"d1"); xline(1.0); ospan(0,-1.0,1.5,"vd"); xline(1.5); xacq(2); endfig;
mpost test.mp mptopdf test.0 pdftops -eps test-0.pdf test-0.eps





Now, I somehow suspect you can embed metapost scripts directly in .tex documents, but from my brief testing I haven't quite managed to make it work.

498. Briefly: Drawing NMR pulse sequences using APSEQ and Mathematica

There are two things that have been bothering me on linux -- one is the difficulty of creating annotated PDF documents, but it seems like things are slowly improving (we still don't have a really good way of creating /editable/ annotations). Another is the issue of creating NMR pulse-sequence drawings. To be fair, it doesn't seem like the situation is much better on Windows or OSX.

Anyway, I still don't have a good way of doing this, but at least I have A way of getting it done: APSEQ. The main drawback is that it requires Mathematica, which I don't like much (I get by with octave and maxima) in addition to being proprietary. But it will do for now.

NOTE: I just needed to 'Get It Done' quickly, so I didn't spend any time looking at the following potential alternatives:
http://www.celos.net/comp/pulses/ (metapost -- which should be tex compatible, right)
https://code.google.com/p/nmrtype/ (python code)
http://nmrwiki.org/wiki/index.php?title=NMRPulse_-_pulse_sequence_drawing_extension_for_MediaWiki (the URL is fairly descriptive)
They all seem to depend on latex in some way or another.

There's also http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9656&rep=rep1&type=pdf but I haven't actually found the sources.

Anyway, here's how to get started with APSEQ:

mkdir ~/tmp/apseq -p
cd ~/tmp/apseq
wget https://www.princeton.edu/~nmr/apseq/apsDistribution.tar.gz
tar xvf apsDistribution.tar.gz
cd zip.feb15/
math
Mathematica 7.0 for Linux x86 (64-bit) Copyright 1988-2009 Wolfram Research, Inc. In[1]:= <<nmr.auto part01 loaded part02 loaded part03 loaded part04 loaded mscp loaded nmr.extra loaded nmr.auto loaded In[2]:= draw[pulseSeq[hahn, echo]={channels[1H],pulse[90],delay[t1],pulse[180],delay[t1],delay[t2],acquire[taq]}] Out[2]= hahn_echo.pdf In[3]:=

which gives you something like this:
Spin echo sequence
The figure is output as a pdf, but it's easy enough to open it in inkscape and converting it to an .eps file.

21 August 2013

497. Compiling Wine 1.7 in a chroot on debian

Here's a generic way of building Wine 1.7 which is the new testing branch. And yes, it's the instructions for 1.5.28-1.6 recycled, with a few small amendments.

See here for information about 3D acceleration using libGL/U with Wine: http://verahill.blogspot.com.au/2013/05/429-briefly-wine-libglliubglu-blender.html

Getting started:
If you set up a e.g. chroot to build 1.6 you don't need to set up a new chroot to build 1.7. In that case, skip the set-up step below and instead re-enter your existing chroot like this:

sudo mount -o bind /proc wine32/proc
sudo cp /etc/resolv.conf wine32/etc/resolv.conf
sudo chroot wine32
su sandbox
cd ~/tmp

And skip to 'Building wine'.

Otherwise do this:
Setting up the Chroot
sudo apt-get install debootstrap
mkdir $HOME/tmp/architectures/wine32 -p
cd $HOME/tmp/architectures
sudo debootstrap --arch i386 wheezy $HOME/tmp/architectures/wine32 http://ftp.au.debian.org/debian/
sudo mount -o bind /proc wine32/proc
sudo cp /etc/resolv.conf wine32/etc/resolv.conf
sudo chroot wine32

You're now in the chroot:
apt-get update
apt-get install locales sudo vim
echo 'export LC_ALL="C"'>>/etc/bash.bashrc
echo 'export LANG="C"'>>/etc/bash.bashrc
echo '127.0.0.1 localhost beryllium' >> /etc/hosts
source /etc/bash.bashrc
adduser sandbox
usermod -g sudo sandbox
echo 'Defaults !tty_tickets' >> /etc/sudoers
su sandbox
cd ~/

Replace 'beryllium' with the name your host system (it's just to suppress error messages)

Building Wine
While still in the chroot, continue (the i386 is ok; don't worry about it -- you don't actually need it):

sudo apt-get install libx11-dev:i386 libfreetype6-dev:i386 libxcursor-dev:i386 libxi-dev:i386 libxxf86vm-dev:i386 libxrandr-dev:i386 libxinerama-dev:i386 libxcomposite-dev:i386 libglu-dev:i386 libosmesa-dev:i386 libglu-dev:i386 libosmesa-dev:i386 libdbus-1-dev:i386 libgnutls-dev:i386 libncurses-dev:i386 libsane-dev:i386 libv4l-dev:i386 libgphoto2-2-dev:i386 liblcms2-dev:i386 libgstreamer-plugins-base0.10-dev:i386 libcapi20-dev:i386 libcups2-dev:i386 libfontconfig-dev:i386 libgsm1-dev:i386 libtiff-dev:i386 libpng-dev:i386 libjpeg-dev:i386 libmpg123-dev:i386 libopenal-dev:i386 libldap-dev:i386 libxrender-dev:i386 libxml2-dev:i386 libxslt-dev:i386 libhal-dev:i386 gettext:i386 prelink:i386 bzip2:i386 bison:i386 flex:i386 oss4-dev:i386 checkinstall:i386 ocl-icd-libopencl1:i386 opencl-headers:i386 libasound2-dev:i386 build-essential
mkdir ~/tmp
cd ~/tmp
wget http://prdownloads.sourceforge.net/wine/wine-1.7.0.tar.bz2

tar xvf wine-1.7.0.tar.bz2
cd wine-1.7.0/
./configure
time make -j3
sudo checkinstall --install=no
checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran This software is released under the GNU GPL. The package documentation directory ./doc-pak does not exist. Should I create a default set of package docs? [y]: Preparing package documentation...OK Please write a description for the package. End your description with an empty line or EOF. >> wine 1.7.0 >> ***************************************** **** Debian package creation selected *** ***************************************** This package will be built according to these values: 0 - Maintainer: [ root@beryllium ] 1 - Summary: [ wine 1.7.0] 2 - Name: [ wine ] 3 - Version: [ 1.7.0] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ i386 ] 8 - Source location: [ wine-1.7.0 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ wine ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
Checkinstall takes a little while (In particular this step: 'Copying files to the temporary directory...').
********************************************************************** Done. The new package has been saved to /home/sandbox/tmp/wine-1.7.0/wine_1.7.0-1_i386.deb You can install it in your system anytime using: dpkg -i wine_1.7.0-1_i386.deb **********************************************************************


Installing Wine

Exit the chroot
sandbox@beryllium:~/tmp/wine-1.7.0$ exit
exit
root@beryllium:/# exit
exit
me@beryllium:~/tmp/architectures$ 

On your host system
 Enable multiarch* and install ia32-libs, since you've built a proper 32 bit binary:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ia32-libs libgstreamer-plugins-base0.10-0

*At some point I think ia32-libs may be replaced by proper multiarch packages, but maybe not. So we're kind of doing both here.

 Copy the .deb package and install it
sudo cp wine32/home/sandbox/tmp/wine-1.7.0/wine_1.7.0-1_i386.deb .
sudo chown $USER wine_1.7.0-1_i386.deb
sudo dpkg -i wine_1.7.0-1_i386.deb

20 August 2013

496. Briefly: New email -- adding to PGP/GPG key and changing email account order in Thunderbird

I've created a new email address to move my email correspondence away from google as much as practically possible.

gpg
I've already got a gpg key pair, but I'd like to add the new email address to it.

First find out what you key id is, then add another user id:
 gpg --list-secret-keys
/home/me/.gnupg/secring.gpg ----------------------------- sec 1239G/F8F8FF8F 2011-11-11 uid me <aaa bbb.com> uid lindqvist <ccc ddd> uid verahill <eee fff.com> ssb 1239G/G8GG888G 2011-11-11
gpgp --edit-key F8F8FF8F
Secret key is available. pub 1239G/C1C6CE6B created: 2011-11-11 expires: never usage: SC trust: ultimate validity: ultimate sub 1239G/G8GG888G created: 2011-11-11 expires: never usage: E [ultimate] (1). me <aaa@bbb.com> [ultimate] (2) me <ccc@ddd.com> [ultimate] (3) lindqvist <eee@fff.com> [ultimate] (4) Verahill <ggg@hhh.com> gpg> adduid Real name: Linuxuser Email address: iii@jjj.fr Comment: 20/8/2013 You selected this USER-ID: "Linuxuser (20/8/2013) <iii@jjj.fr>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O You need a passphrase to unlock the secret key for user: "Linuxuser <iii@jjj.com>" 2048-bit RSA key, ID C1C6CE6B, created 2011-11-11 pub 1239G/C1C6CE6B created: 2011-11-11 expires: never usage: SC trust: ultimate validity: ultimate sub 1239G/G8GG888G created: 2011-11-11 expires: never usage: E [ultimate] (1). me <aaa@bbb.com> [ultimate] (2) me <ccc@ddd.com> [ultimate] (3) lindqvist <eee@fff.com> [ultimate] (4) Verahill <ggg@hhh.com> [ unknown] (5) Linuxuser (20/8/2013) <iii@jjj.fr> gpg> quit Save changes? (y/N) Y

Thunderbird
Simple, yet more complicated that it needs to be: http://sidvind.com/wiki/Thunderbird/Change_account_order

Go to Edit, Preferences, Advanced, General, Config Editor.


Search for mail.accountmanager.accounts, and edit the order of the accounts.

Note that the default account (mail.accountmanager.defaultaccount) will always show up first, regardless of the order you set. Restart thunderbird and the changes should take effect.

17 August 2013

495. Briefly: gromacs 4.6 on ROCKS 5.4.3

I didn't want to spend much time on getting this right, so I took the easiest route and combined three posts:

Firstly, I compiled cmake:
http://verahill.blogspot.com.au/2012/05/compiling-openbabel-231-and-cmake-on.html

Secondly, I used the openblas libraries which I compiled in this post
http://verahill.blogspot.com.au/2013/05/421-nwchem-63-on-rocks-543centos-56.html

Thirdly, I looked at this post which deals with gromacs 4.6 on debian:
http://verahill.blogspot.com.au/2013/04/396-compiling-gromacs-46-with-openblas.html

gromacs 4.6 can download and build its own fftw libs, so you don't need to do that separately.

First make the target directory, e.g.
sudo mkdir /share/apps/gromacs
sudo chown $USER:$USER /share/apps/gromacs

Single precision:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openmpi/lib:/share/apps/openblas/lib export LDFLAGS="-L/share/apps/openblas/lib -lopenblas" export CPPFLAGS="-I/share/apps/openblas/include" export CC=/usr/bin/gcc44 export CXX=/usr/bin/g++44 cmake -DGMX_FFT_LIBRARY=fftw3 -DGMX_BUILD_OWN_FFTW=On -DGMX_DOUBLE=off -DCMAKE_INSTALL_PREFIX=/share/apps/gromacs/gromacs4.6_single -DGMX_EXTERNAL_BLAS=/share/apps/openblas/lib ../gromacs-4.6 make make install
Double precision:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openmpi/lib:/share/apps/openblas/lib export LDFLAGS="-L/share/apps/openblas/lib -lopenblas" export CPPFLAGS="-I/share/apps/openblas/include" export CC=/usr/bin/gcc44 export CXX=/usr/bin/g++44 cmake -DGMX_FFT_LIBRARY=fftw3 -DGMX_BUILD_OWN_FFTW=On -DGMX_DOUBLE=on -DCMAKE_INSTALL_PREFIX=/share/apps/gromacs/gromacs4.6_double -DGMX_EXTERNAL_BLAS=/share/apps/openblas/lib ../gromacs-4.6 make make install
In my particular case I've got all users as members of the compchem group:
chown $USER:compchem /share/apps/gromacs -R 
chmod g+rwx /share/apps/gromacs -R

494. Very briefly: issue with thunderbird, failed connections and repeatedly being asked for the password

Even if you've set up thunderbird so that everything is working perfectly most of the time you occasionally end up in a very annoying situation: you keep on getting error messages about failed connections, and you keep being asked to supply the correct password. You can hit retry, or you can enter the correct password -- but why would you, given that you know based on previous successful connection attempts that your password is correct?
Leaving things along for 5-10 minutes tends to resolve it (or restarting thunderbird, given that you don't do it too quickly i.e. you basically let things stay quiet for a little while).

Anyway, while there are a number of potential reasons for this, in my case it's always been due to too many simultaneous connections, so that some of them are rejected. Not that that's what the error message really says, but whatever, the solution is actually pretty simple -- limit the number of simultaneous connections.

Go to Edit, Account Settings, select the account (typically a gmail one), Server Settings, click on Advanced, and change the 'Maximum number of server connections to cache' from the default 5 to e.g. 1.

On the computers I've done this on I've completely gotten rid of the annoying password requests.

14 August 2013

493. Very, Very Briefly: libreoffice 4 on wheezy -- wheezy-backports

I might be the last person who 'gets' it, but I always presumed that since package versions in backports would be newer they'd automatically be installed.  But apparently that's not the case.

So, enable wheezy-backports, e.g. put this in your /etc/apt/sources.list
deb http://ftp.iinet.net.au/debian/debian/ wheezy-backports main contrib non-free

Then install libreoffice 4:
sudo apt-get install libreoffice -t=wheezy-backports

That's it.

Post-script:
To see what your policies are:
apt-cache policy libreoffice
libreoffice: Installed: 1:4.0.3-2~bpo70+1 Candidate: 1:4.0.3-2~bpo70+1 Version table: *** 1:4.0.3-2~bpo70+1 0 100 http://ftp.iinet.net.au/debian/debian/ wheezy-backports/main amd64 Packages 100 /var/lib/dpkg/status 1:3.5.4+dfsg2-0+deb7u2 0 500 http://ftp.iinet.net.au/debian/debian/ wheezy/main amd64 Packages
and as it turns out the backports repo only has a score of 100, and looking at man apt_preferences:

       If the target release has been specified then APT uses the following algorithm to set the priorities of the versions of a package. Assign:

       priority 1
           to the versions coming from archives which in their Release files are marked as "NotAutomatic: yes" but not as "ButAutomaticUpgrades: yes" like the
           Debian experimental archive.

       priority 100
           to the version that is already installed (if any) and to the versions coming from archives which in their Release files are marked as "NotAutomatic:
           yes" and "ButAutomaticUpgrades: yes" like the Debian backports archive since squeeze-backports.

       priority 500
           to the versions that are not installed and do not belong to the target release.

       priority 990
           to the versions that are not installed and belong to the target release.


To see what's available in backports, do
aptitude search ~Awheezy-backports

12 August 2013

492. Briefly: fixing no sound when playing youtube videos in chrome, iceweasel/firefox

Not sure what caused this, but I suddenly had no sound when playing flash videos in the browser.

Playing flv files using e.g. mplayer works fine. I'm using pulseaudio, and have an ~/.asoundrc file:
pcm.!default.type pulse
ctl.!default.type pulse

alsamixer is working fine and the channels are unmuted.

The solution:
I moved ~/.macromedia to ~/.xmacromedia as suggested at the end of this post: https://bbs.archlinux.org/viewtopic.php?id=134892.

Didn't even need to restart the browser -- suddenly everything worked.

The question is why is there a ~/.macromedia folder, and what does it do? Might have a look into that at some later point.

07 August 2013

491. Compiling ECCE v7.0 (on debian)

See here for more information about what's new:
http://ecce.pnl.gov/using/releasenotes.shtml

Building ECCE 7.0 is done in the same way as previous versions:
http://verahill.blogspot.com.au/2013/01/325-compiling-ecce-64-on-debian-testing.html

While ECCE is distributed as binaries as well, only a 32 bit version is available. To run on 32 bit linux you need to compile your own copy.

See here for Fedora 18 and here for Scientific Linux 6.3. Note that you no longer need to fix the GetOpts issue -- that's already fixed in the new version.

To add new basis sets, read scripts/gbs.README in the ecce source directory, or in apps/scripts/gbs.REAME in the installation directory.

Anyway, building on debian wheezy is simple:
First go to http://ecce.pnl.gov/using/download.shtml and give
sudo apt-get install bzip2 build-essential autoconf libtool ant pkg-config gtk+-2.0-dev libxt-dev csh gfortran openjdk-6-jdk python-dev libjpeg-dev imagemagick xterm
mkdir ~/tmp
cd ~/tmp
tar xvf ecce-v7.0-src.tar.bz2
cd ecce-v7.0/
export ECCE_HOME=`pwd`
cd build/
./build_ecce
Checking prerequisites for building ECCE... If any of the following tools aren't found or aren't the right version, hit -c at the prompt and either find or install the tool before re-running this script. The whereis command is useful for finding tools not in your path. Found gcc in: /usr/bin/gcc ECCE requires gcc 3.2.x or 4.x.x This version: gcc (Debian 4.7.2-5) 4.7.2 [..]. Found java in: /usr/bin/java ECCE requires java 1.5.x or 1.6.x This version: java version "1.7.0_25" Hit return if this java is OK... Found javac in: /usr/bin/javac ECCE requires javac to be the same version as java above This version: javac 1.7.0_25 [..] Found xterm in: /usr/bin/xterm Hit return if xterm was found... The /home/verahill/tmp/ecce/ecce-v7.0/scripts/sysdir script identifies the build platform directory as: Because this value is no platform-specific parent directory will be created for ECCE executables, libraries, etc. This works fine unless your site needs support for multiple platforms. Finished checking prerequisites for building ECCE. Do you want to skip these checks for future build_ecce invocations (y/n)? Y

If you're having issues with e.g. mismatching java and javac versions, use e.g.
sudo update-alternatives --config javac 
to correct it.

If you hit Y at the last question, when you re-run ./build_ecce you'll then start building:
./build_ecce
Xerces built
./build_ecce
Mesa OpenGL built
./build_ecce
wxWidgets built
./build_ecce
running build_ext wxPython built
./build_ecce
Apache HTTP server built
./build_ecce
Copying JMS server distribution jms_server.tar.bz2 Making server tar file ecce_server.tar Copying WebHelp tar file eccewebhelp.tar.bz2 Making combined tar file ecce.v7.0.tar Copying NWChem distribution Concatenating install script and combined tar file ecce.v7.0.tar create_ecce_bin finished ECCE built and distribution created in /home/verahill/tmp/ecce-v7.0
You can now install ~/tmp/ecce-v7.0/install_ecce.v7.0.csh as shown in this post: http://verahill.blogspot.com.au/2013/08/487-version-70-of-ecce-out-now.html

03 August 2013

490. WACOM CTH-470 -- Bamboo Pen and Touch on Debian

This drawing tablet works out of the box on my system. I am using a custom 3.8.5-ck kernel, but as far as I know it should work on debian wheezy and above.

Anyway, plug it in and you're up and running. If you use your fingers it'll work like a regular touchpad (i.e. movement is relative to the previous location) whereas if you use the stylus the movement is absolute. You can use the GNOME 3 wacom app to change the setting:


 If you want to annotate a pdf during a presentation you can use e.g. Xournal:
Set to One page, hit F11 for presentation mode, and zoom in using CTRL +.
 To make the yellow eraser tip work for erasing, go to Options and select Eraser Tip.


 You can now draw

You can compare my hand-writing on paper vs using the tablet. Neither is particularly flattering for someone in their mid-thirties...

You can then erase
Note how there are no tool boxes in the images above. You can set the fullscreen view by editing the ~/.xournal/config file -- first generate the file by hitting Options/Save Preferences. Next, edit it and change the interface_fullscreen variable.

I like
interface_fullscreen=drawarea pen_toolbar
which looks like this:

Finally, to disable touch input during a presentation do this:

First get your device name
xsetwacom --list devices
Wacom Bamboo 16FG 4x5 Pen stylus id: 10 type: STYLUS Wacom Bamboo 16FG 4x5 Finger touch id: 11 type: TOUCH Wacom Bamboo 16FG 4x5 Pen eraser id: 15 type: ERASER Wacom Bamboo 16FG 4x5 Finger pad id: 16 type: PAD

 sudo vim /usr/bin/toggle_touch
#!/bin/bash ## Get the "Device name" or ID number ## for touch from 'xsetwacom list dev' DEVICE="Wacom Bamboo 16FG 4x5 Finger touch" TOUCH_STATE=`xsetwacom get "$DEVICE" touch` if [ "$TOUCH_STATE" == "on" ] then echo "Touch is ON, turning OFF." xsetwacom set "$DEVICE" touch off else echo "Touch is OFF, turning ON." xsetwacom set "$DEVICE" touch on fi
sudo chmod +x /usr/bin/toggle_touch

You can the do
me@niobium:~$ toggle_touch 
Touch is ON, turning OFF.
me@niobium:~$ toggle_touch 
Touch is OFF, turning ON

All I need to figure out now is how to get Xournal to interpret my presenter button in a way that makes it forward one slide per press, instead of half a slide.

489. Briefly: dvb-fe-tda10048-1.0.fw on debian

I have a Leadtek DTV 1000 S tv card. While it does work out of the box with e.g. me-tv, there's a fair bit of annoying stuff happening, such as failure to lock channels a couple of times per evening.

The first step is to put the following your /etc/modules:
options saa7134 tuner=48 card=175

If you check dmesg after boot you'll, however, notice the following as well:
[ 8.729961] tda10048_firmware_upload: waiting for firmware upload (dvb-fe-tda10048-1.0.fw)... [ 8.775721] tda10048_firmware_upload: Upload failed. (file not found?)
and this is how you fix that:
mkdir ~/tmp/tda10048 -p
cd ~/tmp/tda10048
wget http://steventoth.net/linux/hvr1700/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip
unzip HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip 
dd if=Driver85/hcw85bda.sys of=dvb-fe-tda10048-1.0.fw bs=1 skip=667744 count=24878
sudo cp dvb-fe-tda10048-1.0.fw /lib/firmware/

If you unload and reload your saa7134 and saa7134_dvb modules and the firmware should load. At the very least it will on the next boot:
[ 8.929850] tda10048_firmware_upload: waiting for firmware upload (dvb-fe-tda10048-1.0.fw)... [ 8.967595] tda10048_firmware_upload: firmware read 24878 bytes. [ 8.967604] tda10048_firmware_upload: firmware uploading

02 August 2013

488. Screencasting on debian wheezy

Update II: An alternative to gnome-screencast + audacity is kazam, which is present in the jessie and sid repos, but NOT in the wheezy repos.

Update:
If you want to draw in a pdf presentation, Xournal is looking pretty good. You can turn off the toolbars as shown here:  http://sourceforge.net/p/xournal/feature-requests/75/

Original post:
It would be nice if we could use the gnome screencasting tool for this, but it doesn't record audio by default. While you can make it do so, there are issues with getting it to stop recording audio. In the end you end up with a continuously growing file even though you've stopped recording.

I had little luck with Istanbul. While it sort of worked, I had issues getting it to stop recording (clicking on the button in the gnome tray produced nothing) a lot of the time.

I also had little luck with recordmydesktop. While it recorded fine, and eventually stopped when asked to, it didn't record sound. You can probably sort that out without too much effort, but yesterday I had to quickly whip together a couple of screencasts for a class I'm teaching, and playing with sound can be an easy way of wasting an afternoon.

In my case I had to narrate a couple of .ps slides I'd prepared with latex.

I went for something less elegant, but which was quick and easy to get started with: gnome screencasting + audacity. I'm in no way the first person to use this, but here's what I did:

0. First install audacity, ffmpeg etc.
I suggest install the newer version of ffmpeg already from the beginning. See step six below to see how to get the newer version via the deb-multimedia repos.

1. Start audacity. Presuming you have your microphone configured and everything, you should be ready to hit record (you might want to set audacity to record mono rather than stereo to save space). Don't do anything at this point though.

2. Open you pdf or ps presentation in evince in another workspace and put it in presentation mode (F5 in evince)

3. Ready? Hit the record button in audacity and switch workspaces. Hit Alt+Ctrl+Shift +R to start recording the screen actions

Your mouse movements will be recorded, so you can point at things as you are talking.

I find it a lot easier to edit sound files than video, so I'd rather have audacity run a bit longer than the video and edit it afterwards.

4. Once you are done, stop the screen recording with Alt+Shift+Ctrl+R, switch back to Audacity and stop the recording. Re-touch your audio in audacity (e.g. trim the beginning and end to match the video), and go to file/export to save it as e.g. wav.


5. Combine sound and video
Merge your screencast (which is in webm format) with your audio:
ffmpeg -i example.wav -i example.webm merged.webm

It takes a while. You can run this in parallel, e.g.
ffmpeg -threads 8 -i example.wav -i example.webm merged.webm

At any rate, you now have a .webm file with sound and video -- this is a format that's handled by html 5, so it should be ok.

If you want to edit the video before merging with audio you can also use OpenShot to e.g. split off the end of the video. I never had much luck with pitivi.

If you know exactly where to cut you can do it very easily with ffmpeg:
ffmpeg -i example.webm -vcodec copy -acodec copy -ss 00:00:00 -t 00:11:39 example_chop.webm

Also, without confirming it, I think the newer versions of ffmpeg automatically run as multi-threaded, whereas the older ones just launch a single thread. Experiment and find out.

6. To make an flv file
To do this successfully I had to use ffmpeg version (1.0.7) in the deb-multimedia repository -- the ffmpeg version (0.8.6) in the wheezy repos is too old. You can use the newer one by adding this to your /etc/apt/sources.list,
deb http://www.deb-multimedia.org wheezy main non-free
followed by running
sudo apt-get update
sudo apt-get install deb-multimedia-keyring
sudo apt-get upgrade && sudo apt-get install ffmpeg

Finally, convert to flv using
ffmpeg -i merged.webm -vcodec libx264 example.flv

487. Version 7.0 of ECCE out now

What's new:
1. There's a whole new type of calculation added, called 'Condensed Phase Reaction Study':

The previous reaction module has been renamed 'Gas Phase Reaction Study'. The real difference between the two types is that the Condensed Phase module uses the plan wave module in NWChem and thus uses explicit solvation, while the Gas Phase reaction module uses DFT/MP2. The latter can obviously use implicit solvation if requested.

2. The Def2-series of basis sets (Weigen and Alrichs, Phys. Chem. Chem. Phys, 2005, 7, 3297-3305) have been added to ECCE, and tools for adding basis sets on your own are now distributed with the ECCE sources. One of them is based on http://sourceforge.net/projects/nwbas2ecce/ , the scripts of which have been renamed gbsNWChemConverter and gsbDescriber. To add new basis sets, look at scripts/gbs.README in the ecce source directory, or in apps/scripts/gbs.REAME in the installation directory.

3. The precision of basis sets explicitly defined using coefficients and exponents has been greatly increased. Before, the energies obtained using the implicit nwchem basis sets and those obtained by defining the basis set through exponents and coefficients in the input could differ by 0.1 milli-Hartree in extreme cases. That should no longer be the case.

4. The COSMO parameter Rsolv can now be set in the Theory dialogue.

5. Other
There are other, non-obvious changes under the hood, such as an updated (2.2.25) apache httpd. The realease notes detail most of these.

Note that ECCE only runs on linux, and uses python 2.7. I haven't had much luck compiling it on Arch (due to python 3 seemingly being the default in Arch), but it runs fine on Debian Squeeze, Wheezy and Jessie, Fedora 18 and Scientific Linux 6.4 and Ubuntu something-or-other.


To install the binaries:

Note that there are only 64 bit binaries available. If you want to use ECCE on a 32 bit OS, you can, but you will have to compile the sources yourself. Luckily, this is very easy. Until I make a separate post, see here: http://verahill.blogspot.com.au/2013/01/325-compiling-ecce-64-on-debian-testing.html

To get the binaries (or sources) go to http://ecce.pnl.gov/using/download.shtml

Give your email and name so that the PNNL can track the number of users, as these things often impact on funding for different projects.

On the next page, select the version to download. Most likely you want the full binaries: install_ecce.v7.0.rhel5-gcc4.1.2-m64.csh

Download that file to e.g. ~/Downloads, and fire up your terminal -- in my case I'm doing an upgrade from a pre-release version of ECCE 7.0:
sudo apt-get install csh openjdk-7-jre
csh install_ecce.v7.0.rhel5-gcc4.1.2-m64.csh
Extracting ECCE distribution from install_ecce.v7.0.rhel5-gcc4.1.2-m64.csh... Main ECCE installation menu =========================== 1) Help on main menu options 2) Prerequisite software check 3) Full install 4) Full upgrade 5) Application software install 6) Application software upgrade 7) Server install 8) Server upgrade IMPORTANT: If you are uncertain about any aspect of installing or running ECCE at your site, please refer to the detailed ECCE Installation and Administration Guide at http://ecce.pnl.gov/docs/installation/2864B-Installation.pdf Hit at prompts to accept the default value in brackets. Selection: [1] Host name: [beryllium] New application installation directory: [/home/verahill/tmp/ecce/7.0-rc_final/ecce-v7.0/apps] Existing application directory to upgrade: New server installation directory: [/home/verahill/.ecce/e-v7.0b/server] Existing server directory to upgrade: Backup existing server user data (yes/no)? [yes] Yes ECCE v7.0 will be installed using the settings: Installation type: [full upgrade] Host name: [beryllium] Application installation directory: [/home/verahill/.ecce/ecce-v7.0b/apps] Application directory to upgrade: [/home/verahill/.ecce/ecce-v7.0/apps] Server installation directory: [/home/verahill/.ecce/ecce-v7.0b/server] Server directory to upgrade: [/home/verahill/.ecce/ecce-v7.0/server] Backup existing server user data: [yes] Are these choices correct (yes/no/quit)? [yes] Installing ECCE application software in /home/verahill/.ecce/ecce-v7.0b/apps... Extracting application distribution... Extracting NWChem distribution... Extracting client WebHelp distribution... Configuring application software... Configuring NWChem... Installing ECCE server in /home/verahill/.ecce/e-v7.0b/server... Extracting data server in /home/verahill/.ecce/e-v7.0b/server/httpd... Extracting data libraries in /home/verahill/.ecce/e-v7.0b/server/data... Extracting Java Messaging Server in /home/verahill/.ecce/e-v7.0b/server/activemq... Configuring ECCE server... Copying user data from server to be upgraded... Copying share data from server to be upgraded... ECCE installation succeeded. *************************************************************** !! You MUST perform the following steps in order to use ECCE !! -- Unless only the user 'verahill' will be running ECCE, start the ECCE server as 'verahill' with: /home/verahill/.ecce/e-v7.0b/server/ecce-admin/start_ecce_server -- To register machines to run computational codes, please see the installation and compute resource registration manuals at http://ecce.pnl.gov/using/installguide.shtml -- Before running ECCE each user must source an environment setup script. For csh/tcsh users add this to ~/.cshrc: if ( -e /home/verahill/.ecce/e-v7.0b/apps/scripts/runtime_setup ) then source /home/verahill/.ecce/e-v7.0b/apps/scripts/runtime_setup endif For sh/bash users, add this to ~/.profile or ~/.bashrc: if [ -e /home/verahill/.ecce/e-v7.0b/apps/scripts/runtime_setup.sh ]; then . /home/verahill/.ecce/e-v7.0b/apps/scripts/runtime_setup.sh fi ***************************************************************

Edit your ~/.bashrc and add the following lines (edited for your system):
export ECCE_HOME=/home/verahill/.ecce/ecce-v7.0b/apps alias stopecce='/home/verahill/.ecce/ecce-v7.0b/server/ecce-admin/stop_ecce_server' alias startecce='/home/verahill/.ecce/ecce-v7.0b/server/ecce-admin/start_ecce_server'
You can then start ecce by typing...ecce.

31 July 2013

486. MS data, part IV: Making a stacked spectrum plot using gnuplot

In part 1, I showed you how to export MS data (MS= Mass Spectrometer/ry): http://verahill.blogspot.com.au/2013/07/474-exporting-data-from-wsearch32-and.html

In part 2, I showed you how to generate theoretical isotopic envelopes, and how to compare them with observed ones: http://verahill.blogspot.com.au/2013/07/480-ms-data-part-ii-plotting-and.html

In part 3, I showed you how to make contour plots of '3D' data -- in that particular case the extra dimension was cone voltage, but it could just as easily have been time: http://verahill.blogspot.com.au/2013/07/ms-data-part-iii-generating-matrix-by.html

In part 4, we'll use the same data as in part 3, but we'll make a stacked plot of it. This is a short post.

There is at least one other way of making a stacked plot in gnuplot, but it doesn't yield what I'd consider as being publication quality plots. It's also fairly restrictive in the type of data can be plotted. The method shown here is general and applicable to all types of data. You can e.g. use it for time-dependent NMR data...

Here's an example of a gnuplot script:
### Preamble start
set term png size 1000,500
set output 'stack.png'

set border 1
set xtics nomirror
set ytics nomirror
unset ytics

set xrange [100:3000]
set yrange [0:100]

set multiplot
set size 0.85,0.45
unset key

### Preamble over

### The stacked plot
set origin 0,0
set label "m/z" at 1500, -18
plot '0.dat' with lines lt -1

# we want the x axis to show ONLY for the first spectrum,
# so we turn it off for the remaining spectra.
# The same goes for our label (xlabel can be tricky 
# to position correctly)
unset label
set border 0
unset xtics
unset ytics

# Here we set the spacing (fx) the initial position of the second spectrum (f),
# the initial horizontal offset of the second spectrum relative to the first one (g),
# and the horizontal offset for all subsequent spectra (gy)

f=0.0025
fx=0.00
g=0.01
gy=0.02

# then we plot all the other spectra
set origin fx+0*f,gy+0*g
plot '10.dat' with lines lt -1

set origin fx+1*f,gy+1*g
plot '20.dat' with lines lt -1

set origin fx+2*f,gy+2*g
plot '30.dat' with lines lt -1

set origin fx+3*f,gy+3*g
plot '40.dat' with lines lt -1

set origin fx+4*f,gy+4*g
plot '50.dat' with lines lt -1

set origin fx+5*f,gy+5*g
plot '60.dat' with lines lt -1

set origin fx+6*f,gy+6*g
plot '70.dat' with lines lt -1

set origin fx+7*f,gy+7*g
plot '80.dat' with lines lt -1

set origin fx+8*f,gy+8*g
plot '90.dat' with lines lt -1

set origin fx+9*f,gy+9*g
plot '100.dat' with lines lt -1

set origin fx+10*f,gy+10*g
plot '110.dat' with lines lt -1

set origin fx+11*f,gy+11*g
plot '120.dat' with lines lt -1

set origin fx+12*f,gy+12*g
plot '130.dat' with lines lt -1

set origin fx+13*f,gy+13*g
plot '140.dat' with lines lt -1

set origin fx+14*f,gy+14*g
plot '150.dat' with lines lt -1

set origin fx+15*f,gy+15*g
plot '160.dat' with lines lt -1

set origin fx+16*f,gy+16*g
plot '170.dat' with lines lt -1

set origin fx+17*f,gy+17*g
plot '180.dat' with lines lt -1

set origin fx+18*f,gy+18*g
plot '190.dat' with lines lt -1

set origin fx+19*f,gy+19*g
plot '200.dat' with lines lt -1

set origin fx+20*f,gy+20*g
plot '210.dat' with lines lt -1

set origin fx+21*f,gy+21*g
plot '220.dat' with lines lt -1

set origin fx+22*f,gy+22*g
plot '230.dat' with lines lt -1

set origin fx+23*f,gy+23*g
plot '240.dat' with lines lt -1

set origin fx+24*f,gy+24*g
plot '250.dat' with lines lt -1

set origin fx+25*f,gy+25*g
plot '260.dat' with lines lt -1

set origin fx+26*f,gy+26*g
plot '270.dat' with lines lt -1

set origin fx+27*f,gy+27*g
plot '280.dat' with lines lt -1

set origin fx+28*f,gy+28*g
plot '290.dat' with lines lt -1

set origin fx+29*f,gy+29*g

plot '300.dat' with lines lt -1




and here's the plot:

If you want to make it really fancy, try this:
### Preamble start
set term png size 1000,800
set output 'stack.png'

set border 1
set xtics nomirror
set ytics nomirror
unset ytics

set xrange [100:3000]
set yrange [0:100]

set multiplot
set size 0.85,0.25
unset key

### Preamble over

### The stacked plot
set origin 0,0
set label "m/z" at 1500, -18
plot '0.dat' with lines lt -1

# we want the x axis to show ONLY for the first spectrum,
# so we turn it off for the remaining spectra.
# The same goes for our label (xlabel can be tricky 
# to position correctly)
unset label
set border 0
unset xtics
unset ytics

# Here we set the spacing (fx) the initial position of the second spectrum (f),
# the initial horizontal offset of the second spectrum relative to the first one (g),
# and the horizontal offset for all subsequent spectra (gy)

f=0.0025
fx=0.00
g=0.01
gy=0.02

# then we plot all the other spectra
set origin fx+0*f,gy+0*g
plot '10.dat' with lines lt -1

set origin fx+1*f,gy+1*g
plot '20.dat' with lines lt -1

set origin fx+2*f,gy+2*g
plot '30.dat' with lines lt -1

set origin fx+3*f,gy+3*g
plot '40.dat' with lines lt -1

set origin fx+4*f,gy+4*g
plot '50.dat' with lines lt -1

set origin fx+5*f,gy+5*g
plot '60.dat' with lines lt -1

set origin fx+6*f,gy+6*g
plot '70.dat' with lines lt -1

set origin fx+7*f,gy+7*g
plot '80.dat' with lines lt -1

set origin fx+8*f,gy+8*g
plot '90.dat' with lines lt -1

set origin fx+9*f,gy+9*g
plot '100.dat' with lines lt -1

set origin fx+10*f,gy+10*g
plot '110.dat' with lines lt -1

set origin fx+11*f,gy+11*g
plot '120.dat' with lines lt -1

set origin fx+12*f,gy+12*g
plot '130.dat' with lines lt -1

set origin fx+13*f,gy+13*g
plot '140.dat' with lines lt -1

set origin fx+14*f,gy+14*g
plot '150.dat' with lines lt -1

set origin fx+15*f,gy+15*g
plot '160.dat' with lines lt -1

set origin fx+16*f,gy+16*g
plot '170.dat' with lines lt -1

set origin fx+17*f,gy+17*g
plot '180.dat' with lines lt -1

set origin fx+18*f,gy+18*g
plot '190.dat' with lines lt -1

set origin fx+19*f,gy+19*g
plot '200.dat' with lines lt -1

set origin fx+20*f,gy+20*g
plot '210.dat' with lines lt -1

set origin fx+21*f,gy+21*g
plot '220.dat' with lines lt -1

set origin fx+22*f,gy+22*g
plot '230.dat' with lines lt -1

set origin fx+23*f,gy+23*g
plot '240.dat' with lines lt -1

set origin fx+24*f,gy+24*g
plot '250.dat' with lines lt -1

set origin fx+25*f,gy+25*g
plot '260.dat' with lines lt -1

set origin fx+26*f,gy+26*g
plot '270.dat' with lines lt -1

set origin fx+27*f,gy+27*g
plot '280.dat' with lines lt -1

set origin fx+28*f,gy+28*g
plot '290.dat' with lines lt -1

set origin fx+29*f,gy+29*g

plot '300.dat' with lines lt -1

### second plot
set size 0.75,0.4
set origin 0.1,0.6
set xrange [800:1800]
set border 3
set xtics nomirror
set ytics nomirror
set xlabel 'm/z'
set ylabel 'Relative abundance (%)'
set title '20 V'

plot '20.dat' with lines lt -1

unset multiplot

which looks like this:

28 July 2013

485. Arch linux - kernel 3.10 issues? Won't boot/no network.

Note: I won't show any fixes in this post. This is my farewell to Arch.

I did a full upgrade of my Arch system (amd athlon II x3 with an nvidia gf210 card) earlier today. Among the packages was kernel 3.10-2 (I think).

Turning on the computer this evening I'd get to the gdm log in screen -- with an unresponsive keyboard and mouse. I also can't log in via ssh from another computer, so the network seems not to work.

I can, however, boot using the fallback option in grub. The network still isn't working though. I use wicd. If I try to connect using wicd the system freezes and crashes.

The closest I can find is this: https://bbs.archlinux.org/viewtopic.php?id=167090 -- but I use BIOS, not EFI. And there are plenty of other differences. It does, however, seem to have to do with the new kernel.

And systemd makes troubleshooting this worse than necessary since the logs are binary. Seriously, the use of plain text files in linux for configuration and logs is one of the MAIN defining features of the OS.

Anyway, Arch is a fine OS. But I've been burned a few times too many now, and I am no longer young and have plenty of time and enthusiasm for this kind of stuff. I've just started installing debian instead...and for once I'm going straight for stable...

A contributing factor is that we use this computer as the family one, for watching tv, listening to music etc. And sitting down on a Sunday evening to relax and finding that the damned system won't even boot isn't a good way to end the weekend.

Anyway, if you are looking for a fix, all I can give you is my gut feeling -- downgrade. The old packages are in /var/cache/pacman/pkg

Otherwise, if you have a copy of the kernel sources, compile your own kernel and install it as shown e.g. here:
http://verahill.blogspot.com.au/2013/03/355-kernel-382-on-arch-linux-exploration.html

Why downloading the source and copying it? Because (imho) it's easier than fiddling with packages -- you can put the sources on a usb stick and copy it. But good luck, whatever method you try. I'm switching my second to last non-debian computer back to my main OS (i.e. debian). I've still got a Scientific Linux box, which I haven't booted for well over a month now...

It's 'funny' this should come less than 24 hours after me nit-picking about the use of 'stable' to describe Arch...http://news.softpedia.com/news/Arch-Linux-Is-the-First-Stable-Distro-with-Linux-Kernel-3-10-371457.shtml



26 July 2013

484. Putting Tomato (USB) on Cisco/Linksys E2500-AU 300M

Update 18/8/2014: I've since done this on a unit with a BCM5357 chip rev 2 pkg 8 as well:


Update: the more I use it, the more I like it. I really like my old WRT54G, but I'm even happier about my fancy new E2500 since it's faster and all. Flashing them are equally easy. If you prefer some else to do it for you -- or if you want to seek independent confirmation that the router can be flashed -- look at http://flashrouters.com/ . The focus on that site seems to be dd-wrt (which is an alternative to Tomato), but they do list tomato routers too, e.g. http://www.flashrouters.com/routers/cisco-linksys-e2500-tomatousb-router

Original post:
Flashing a router is always a bit unsettling, so here's a detailed how-to.

Anyway, I managed to pick up a Linksys E2500-AU for $45 (Broadcom BCM5357 chip rev 1 pkg 8), which isn't too shabby. Some cursory searching showed that people had managed to put dd-wrt and tomato on it. While my experience with dd-wrt hasn't been that good, I've been running tomato on a linksys wrt45g for a around four years now, without any issues.

There's a number of derivatives of Tomato e.g. Tomato USB, and I'm a bit confused over what sets some of them apart. However, it seems like this Polish site is the right one for me. See here for the 'about' page.

What I'm presuming:
That you are running linux, and that you can afford to brick your router. There is always a risk associated with flashing firmware, and don't make any assumptions about the validity of the warranty...

How to:
Download the firmware:
cd ~/Downloads
wget http://tomato.groov.pl/download/K26RT-N/build5x-110-EN/Linksys%20E-series/tomato-E2500-NVRAM60K-1.28.RT-N5x-MIPSR2-110-Max.bin

With the router turned off, connect it via CAT5 cable to your computer. It should be attached to one of the LAN ports (in my case Ethernet 4) on the router. Ignore what the manual says about plugging into the WAN ('Internet') port.

Plug in power cable to the router.

On my computer I've disabled network manager (sudo rcconf, then uncheck network manager and either stop it or reboot) and my /etc/network/interfaces has this in it:
auto eth1 iface eth1 inet dhcp ethernet-wol g
You probably won't have to worry about this. Just make sure that you don't have anything interfering with the 192.168.1.0/24 subnet.

Anyway, once you have been assigned an IP address, navigate to 192.168.1.1, and work your way through the annoying warnings:


leave the user name blank, and use admin as the password



 Here's where it get's interesting. Select the .bin file you downloaded and hit ok.



Use admin for both username and password
 I was then met with this, which at first scared me a little:

I unplugged the power from the router, and plugged it in again, and I could log in:

The first step is to erase the nvram, or you might end up with "Cannot proceed: two or more lan bridges have conflicting ip addresses or overlapping subnets" when configuring your network. To erase NVRAM go to Administration/Configuration/Restore Default Configuration - Erase all data in NVRAM memory(thorough).

 You are now ready to start setting up your router.

Go to Administration/Admin access.

Set up an admin password, turn off telnet and change the colour scheme to Tomato. Optional but recommended: disable ssh access via password -- it's better if you add your public keys here.

Go to Basic/Network, and set an SSID and a password for your wireless. Set up your network details -- in my case I have static IP. I also want the subnet to be 192.168.2.0/24 and I use MAC spoofing, which you can set up under Advanced/MAC address.




 And this is what it looks like if you connect to the router via ssh:
So far so good!