Wednesday, March 24, 2010

Shutter - screencapture

# Repos and key
sudo add-apt-repository ppa:shutter/ppa
# Install
sudo aptitude update && sudo aptitude install shutter

Tuesday, March 16, 2010

qavimator on Karmic 32-64bit

sudo apt-get install subversion qt4-qmake libqt4-dev freeglut3-dev
svn co https://qavimator.svn.sourceforge.net/svnroot/qavimator qavimator
cd qavimator/
qmake
make
sudo make install
qavimator


works well.
Tip use gtk-RecordMyDesktop to record animation.

Friday, March 12, 2010

bdb_equality_candidates: (memberUid) not indexed

bdb_equality_candidates: (memberUid) not indexed


For Precise 12.04

sudo /etc/init.d/slapd stop


#Open the right OpenLDAP config file with an editor:
sudo nano /etc/ldap/slapd.d/cn\=config/olcDatabase\=\{1\}hdb.ldif


#Add new lines (after the one with olcDbIndex: objectClass eq in it) for the missing indexes. Eg.:

olcDbIndex: cn eq
olcDbIndex: gidNumber eq
olcDbIndex: memberUid eq
olcDbIndex: uid eq
olcDbIndex: uidNumber eq
olcDbIndex: uniqueMember eq

#Run the OpenLDAP indexer for your configuration:

sudo slapindex -F /etc/ldap/slapd.d/

#will get an permission error so
#Fix file permissions in your OpenLDAP database:

sudo chown -R openldap:openldap /var/lib/ldap

#Start the LDAP server:
sudo /etc/init.d/slapd start





For Karmic

from http://ilostmynotes.blogspot.com/2009/08/eliminating-openldap-uid-not-indexed.html

echo "dn: olcDatabase={1}hdb,cn=config
changetype: modify
replace: olcDbIndex
olcDbIndex: uid,uidNumber,gidNumber,memberUid,uniqueMember,objectClass,cn eq" > indexchanges.ldif
sudo ldapmodify -f indexchanges.ldif -D cn=admin,cn=config -x -y /etc/ldap.secret
sudo /etc/init.d/slapd stop
sudo su -s /bin/bash -c slapindex openldap
sudo /etc/init.d/slapd start



For Hardy
from https://help.ubuntu.com/community/OpenLDAP-SambaPDC-OrgInfo-Posix

/etc/ldap/slapd.conf in the database definitions section (ie. after the first database directive).
# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,sn,mail,givenname eq,pres,sub
index uidNumber,gidNumber,memberUid eq,pres
index loginShell eq,pres
# I also added this line to stop warning in syslog ..
index uniqueMember eq,pres
## required to support pdb_getsampwnam
index uid pres,sub,eq


Following this, stop the LDAP server, run slapindex, and restart the LDAP server.
sudo /etc/init.d/slapd stop

sudo slapindex
# WARNING!
# Runnig as root!
# There's a fair chance slapd will fail to start.
# Check file permissions!

# Correct the ownership of the index files ..
sudo chown openldap:openldap /var/lib/ldap/*
sudo /etc/init.d/slapd start

openshot, simple scan and audio caputre

#openshot
sudo add-apt-repository ppa:openshot.developers
sudo apt-get update
sudo apt-get install openshot

# simple-scan
sudo add-apt-repository ppa:robert-ancell/simple-scan
sudo apt-get update
sudo apt-get install simple-scan




to capture audio direct from soundcard playback

arecord -f cd -t wav out.wav

could get this to work
arecord -f cd -t raw | lame -x - out.mp3

Tuesday, October 20, 2009

Ubuntu NIS server for OS X 10.4

I'm having problems with ldap and 10.4 so I'm using NIS


UBUNTU (8.04) server

#NFS
echo "portmap mountd nfsd statd lockd rquotad : 192.168.1.0/255.255.255.0" | tee -a /etc/hosts.allow

#LDAP
echo "ldap : 192.168.1.0/255.255.255.0" | tee -a /etc/hosts.allow

#www
echo "www : ALL" | tee -a /etc/hosts.allow

NIS Deny
echo "nis : ALL" | tee -a /etc/hosts.deny

NIS
sudo apt-get install portmap nis
sed -i -e "s/^NISSERVER=false/NISSERVER=true/" /etc/default/nis
#sed -i -e "s/^NISCLIENT=true/NISCLIENT=false/" /etc/default/nis

echo "ypserv ypbind : 192.168.1.0/255.255.255.0" | tee -a /etc/hosts.allow

# /etc/default/portmap

echo "ypserver 192.168.1.8" | tee -a /etc/yp.conf
sed -i -e "s/=1000/=1002/" /var/yp/Makefile # change MINUID & MINGID
sed -i -e "s/^0.0.0.0/255.255.255.0/" /etc/ypserv.securenets
sed -i -e "s/0.0.0.0$/192.168.1.0/" /etc/ypserv.securenets


# for OSX support sudo shadow2passwd.sh
sudo /usr/lib/yp/ypinit -m # XXXXXX.XXXXXXX.net

sudo /etc/init.d/portmap restart
sudo /etc/init.d/nis restart

ypcat passwd

OSX 10.4 NFS client

#NFS
sudo -s



ln -s /Users /home
mkdir /home/staff
mkdir /home/students
echo "192.168.1.8:/home/staff /Users/staff nfs -i,-P,-b,-s 0 0
192.168.1.8:/home/students /Users/students nfs -i,-P,-b,-s 0 0" > /etc/fstab
niload -m -v fstab . < /etc/fstab
mount -a



If there is file locking issues you need to add locallock, '-L' to the Applications>Utilities>netinfo

OS X 10.4 nis client

OS X 10.4 nis client
http://zhadum.org.uk/2007/02/16/mac-os-x-and-nis-just-not-good-friends/

Nis on 10.4 is broken and need a script to stop the lgin from locking up.

sudo -s
echo "nohup /usr/local/bin/fix-nis 25 >/tmp/fix-nis.log 2>&1 &" >> /etc/rc.local
chmod +x /etc/rc.local

mkdir /usr/local
mkdir /usr/local/bin/
nano /usr/local/bin/fix-nis

#!/bin/sh
if [ $# -gt 0 ]
then
sleep "$1"
fi

NFSDIR=/home/staff/doug
if [ -d $NFSDIR ]
then
echo "Directory \"$NFSDIR\" exists."
exit 1
fi

killall lookupd
sleep 1
killall -HUP automount
sleep 2

if [ ! -d $NFSDIR ]
then
echo "Directory \"$NFSDIR\" still doesn't exists, retrying."

sleep 10
killall lookupd
sleep 1
killall -HUP automount
sleep 2
if [ ! -d $NFSDIR ]

then
echo "Directory \"$NFSDIR\" still doesn't exists, giving up"
exit 1
fi
fi

echo "Fixed NIS."
exit 0

chmod +x /usr/local/bin/fix-nis