24 August 2011

17. Linphone with iinet iitalk voip service on Debian Testing 64 (Wheezy)

We've got the Naked DSL from iinet, and included with it is a 'free' voip service, iitalk. Since we haven't got either a modem supporting voip, or an ATA adapter + regular terrestrial phone, we're aiming for the next best - using a software voip solution on our desktop. Linphone is FOSS and available in the debian repos.

You will have received an email from iinet with the following details:
Your Netphone number:         0xxxxxxx
Your Netphone password:     yyyyyyy
Your Netphone PIN:                 zzzz
VoIP SIP domain:            iinetphone.iinet.net.au
VoIP SIP server:              sip.state.iinet.net.au

where state is act, nsw, vic, wa etc. giving something along the lines of sip.act.iinet.net.au


first
sudo apt-get install linphone

You'll find the GUI version on your gnome menu under 'internet'. Start it.
Go to Linphone/Settings
Click on the manage SIP accounts tab.
There are three main sections on this tab: default identity, Proxy accounts and Privacy
Don't bother with the Default identity or Privacy; instead click on Add under Proxy accounts


Your SIP identity: sip: 0xxxxxxx@sip.state.iinet.net.au
SIP proxy addres: sip: sip.state.iinet.net.au
Route (optional): sip:
Registration duration (sec): 3600
Register at startup: yes

You can also set up the account directly in your ~/.linphonerc :

[proxy_0]
reg_proxy=sip:sip.state.iinet.net.au
reg_route=sip:
reg_identity=sip:0xxxxxxx@sip.state.iinet.net.au
reg_expires=3600
reg_sendregister=1
publish=0
dial_escape_plus=0

[auth_info_0]
username=0xxxx
userid=0xxxxxx
passwd=yyyyyyyyyyy
realm="iinetphone.iinet.net.au"


The number after proxy_ and auth_info_ depends on whether you have other accounts defined as well. Note that the .linphonerc file will contain a fair number of other things. Here's my full .linphonerc (with some information replaced by x's)


[sound]
playback_dev_id=ALSA: default device
ringer_dev_id=ALSA: default device
capture_dev_id=ALSA: default device
remote_ring=/usr/share/sounds/linphone/ringback.wav

[video]
device=V4L2: /dev/video0
size=cif
enabled=0
display=0
capture=0
show_local=0
self_view=1

[GtkUi]
advanced_ui=1
uri0=0xxxxxxxx

[net]
download_bw=0
upload_bw=0
firewall_policy=0
mtu=0

[sip]
sip_port=5060
guess_hostname=1
contact=<sip:xxx@192.168.1.2>
inc_timeout=15
use_info=0
use_rfc2833=0
use_ipv6=0
register_only_when_network_is_up=1
default_proxy=0

[auth_info_0]
username=0xxxxxxx
userid=0xxxxxxxx
passwd=yyyyyyy
realm="iinetphone.iinet.net.au"

[rtp]
audio_rtp_port=7078
video_rtp_port=9078
audio_jitt_comp=60
video_jitt_comp=0
nortp_timeout=30

[audio_codec_0]
mime=speex
rate=32000
enabled=1

[audio_codec_1]
mime=speex
rate=16000
enabled=1

[audio_codec_2]
mime=speex
rate=8000
enabled=1

[audio_codec_3]
mime=GSM
rate=8000
enabled=1

[audio_codec_4]
mime=PCMU
rate=8000
enabled=1

[audio_codec_5]
mime=PCMA
rate=8000
enabled=1

[video_codec_0]
mime=MP4V-ES
rate=90000
enabled=1
recv_fmtp=profile-level-id=3

[video_codec_1]
mime=theora
rate=90000
enabled=1

[video_codec_2]
mime=H263-1998
rate=90000
enabled=1
recv_fmtp=CIF=1;QCIF=1

[video_codec_3]
mime=H263
rate=90000
enabled=1

[video_codec_4]
mime=x-snow
rate=90000
enabled=1

[proxy_0]
reg_proxy=sip:sip.state.iinet.net.au
reg_route=sip:
reg_identity=sip:0xxxxxxxxx@sip.state.iinet.net.au
reg_expires=3600
reg_sendregister=1
publish=0
dial_escape_plus=0





11 August 2011

16. Using onboard video card with acceleration on Optiplex 990 on Debian

NOTE: another issue debian users should be aware of is the failure to reboot on sudo shutdown -r now. The fix is easy though: change GRUB_CMDLINE_LINUX in /etc/default/grub to read GRUB_CMDLINE_LINUX="reboot=pci"

--Start Here ---
The videocard (nvidia quadro something or other) my work Optiplex 990 came with only has a 'displayport', and the supplied adapter for it only has DVI-D (no analogue signal, so a VGA converter won't work). Since my 24" monitor doesn't have DVI, and I hate HDMI, and at the same time appreciate graphics acceleration (can't live without my wobbly windows in compiz), I had to generate an /etc/X11/xorg.conf which would allow me to use the motherboard graphics capabilities. Here's that xorg.conf (ripped out the video card, used smxi to generate an xorg-driver dependent xorg.conf):


Section "ServerLayout"
Identifier     "X.org Configured"
Screen      0  "Screen0" 0 0
Screen      1  "Screen1" RightOf "Screen0"
Screen      2  "Screen2" RightOf "Screen1"
InputDevice    "Mouse0" "CorePointer"
InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath   "/usr/lib/xorg/modules"
FontPath     "/usr/share/fonts/X11/misc"
FontPath     "/usr/share/fonts/X11/cyrillic"
FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath     "/usr/share/fonts/X11/Type1"
FontPath     "/usr/share/fonts/X11/100dpi"
FontPath     "/usr/share/fonts/X11/75dpi"
FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
FontPath     "built-ins"
EndSection

Section "Module"
Load  "dbe"
Load  "record"
Load "dri"
Load  "dri2"
Load "glx"
Load  "extmod"
EndSection

Section "InputDevice"
Identifier  "Keyboard0"
Driver      "kbd"
EndSection

Section "InputDevice"
Identifier  "Mouse0"
Driver      "mouse"
Option    "Protocol" "auto"
Option    "Device" "/dev/input/mice"
Option    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier   "Monitor0"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Monitor"
Identifier   "Monitor1"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Monitor"
Identifier   "Monitor2"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Device"
Identifier  "Card0"
Driver "intel"
BusID       "PCI:0:2:0"
EndSection

Section "Device"
Identifier  "Card1"
Driver "intel"
BusID       "PCI:0:2:0"
EndSection

Section "Device"
  Identifier  "Card2"
Driver "intel"
BusID       "PCI:0:2:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device     "Card0"
Monitor    "Monitor0"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device     "Card1"
Monitor    "Monitor1"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen2"
Device     "Card2"
Monitor    "Monitor2"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

Section "Extensions"
# Option      "Composite" "disable"
# Option      "RENDER" "disable"
EndSection

10 August 2011

15. ORTEP-3 for Windows (Winortep) under Wine

Note: for those who use Mac OS X and get sent here by google, you can also use wine to run ortep3v2. See here for instructions on how to install wine: http://wiki.winehq.org/MacOSX

The installation file can be downloaded from http://www.chem.gla.ac.uk/~louis/software/ortep3/. Install in the same fashion as you would with any other windows program under wine. I will assume that you have installed it in c:\ortep3v2

Request a license the usual way. Make a file called Ortep3-license in the c:\ortep3v2 directory (/home/you/.wine/drive_c/ortep3v2). Put the license information in it:

########################################################################
Program license for : Ortep3 for Windows
User name  : XXXXXXXXXX
User email : XXXX@XXXXX.XXX
User affiliation : Department of Chemistry, XXXXX, XXXXX
Windows version  : Windows XP
License number   : XXXXXXXXXX
########################################################################

So far everything is the same as for a regular windows installation.
The one difference arrives when it comes to setting the ORTEP3DIR variable:
go to the linux shell, type regedit
Navigate to HKEY_CURRENT_USER/Environment
If you don't have the Environment directory, create a new key with that name, then create a string value which you call ORTEP3DIR. Double-click on the data field, and set it to c:\\ortep3v2

You should now be ready to go.

Winortep can write pov-ray files -- and they are well-written, logical and very easy to read/modify


WinOrtep is a full-featured program which can do just about anything.

08 August 2011

14. Evolution email and Google Calendar(s)

The process is already described here:
http://www.ubuntugeek.com/how-to-sync-google-and-evolution-calendars-in-ubuntu.html.

It's not much of a post, but it may be of help to someone who tried the Google option when setting up the calendar sync in Evolution and found it less than satisfactory.

Edit 16/12/2011:
Recently (last two days, version 3.0.3-3) been getting error messages in evolution when trying to connect to my google calendar. While using the method described above for a while I switched to using 'google' instead of 'caldav' as the calendar type at some point. Well, it doesn't work anymore.

Here's how to use google calendar in Evolution:
New -> Calendar
Type -- CalDav


URL: caldav://www.google.com/calendar/dav/myemail%40gmail.com/events/
Use SSL: yes
User name: myemail@gmail.com
User email: myemail@gmail.com

Then clock 'Browse server for calendar and select the
+ /calendar/dav/myemail%40gmail.com/
         - myemail@gmail.com


Whether  you want to copy content offline or use it as default calendar is a personal choice.

Edit: 16/12/2011 -- 2 hours later
Well, it's not working anymore. Same TLS handshake BS as before.

"Error loading calendar
Cannot open calendar: Unexpected HTTP status code 6 returned (Peer failed to perform TLS handshake)"

What I can't understand is why there is no good description of this problem on the web, given that Evolution is the default email and calendar client for gnome. I don't like thunderbird/icedove+sunbird/iceowl much, but things seem to work better in general there.

07 August 2011

13. phpSheduleIt - basic installation

phpScheduleIt is a nice web-driven instrument scheduling system, which I first come into contact with as an NMR user at the University of California at Davis, where it is used to manage the scheduling of the instruments in the NMR facility there.

You will need to have a LAMP server set up (see e.g. http://www.howtoforge.com/ubuntu_debian_lamp_server). You will need apache2, php and mysql to play nicely together. Basically follow steps one and two, then sudo /etc/init.d/apache2 restart.

Download phpScheduleIt from http://www.php.brickhost.com/

A basic way to get it up and running goes as follows:

1. create a directory under /var/www. In our example it will be /var/www/nmr
sudo mkdir /var/www/nmr. Unzip the file you downloaded from www.php.brickhost.com and put the files in the /var/www/nmr directory

2. in your terminal, go to /var/www/nmr and chmod o+x all files (including subdirectories)

3. cp /var/www/nmr/config/config.php.new /var/www/nmr/config/config.php

4. Edit it.
change $conf['app']['weburi'] = 'http://localhost/phpScheduleIt';
to

change $conf['app']['weburi'] = 'http://localhost/nmr'; 
edit other relevant items, such as adminEmail, defaultLanguage, timeFormat, emailType, defaultPassword etc,

The admin email is important, since this will become the administrator account.

5. go to http://localhost/nmr/install
If nothing happens, or you get an error message, it's time to start trouble-shooting. Going to the terminal and
cd /var/www/nmr/install
php index.php
might give some useful information. Most likely you have either a) made an error in config/config.php, or b) you haven't chmod:d the subdirectories.

6.  If all goes well, you are asked for your root user name and root mysql password (which you set during the installation). Thus, login as root with the correct password. Once you're in, hit the button saying 'create tables'. If all went well you can now delete the /var/www/nmr/install directory.

7. Go to http://localhost/nmr
You should be greeted with a log in window. Important: select create new user and enter the email address you gave as the administrator email in the config.php file. This will then automatically become an administrator account. It has nothing to do with the order you create accounts in - it's all about what email address you put in the config.php file. 

8.  Once you've set up the account you are able to create instruments, user groups, booking restrictions etc. 
Anyone who wants to use the facilities can create their own new registered users, BUT only the administrator(s) can assign resources to them. 

9. Be careful with your GMT setting...

This page has some information as well: http://www.m-osaka.com/jp/plaza/readme.html