Bushfire density map prototype

Note: This is purely for educational purposes only and there is no warranty for the validity of information. Hopefully there is someone out there who will refine the code for the community to utilise the technology effectively.

Data use: http://sentinel.ga.gov.au/GPX/hs00to12.gpx ; 16 Feb 2009 16:38 Sydney Time

Resources:

http://jeffreybarke.net/2008/07/density-map-tutorial/
http://sentinel.ga.gov.au/acres/sentinel/gpx_data.shtml

Recovering Windows XP Profile

After doing a windows install on existing OS, windows xp is not very good in using existing User Profiles.This also happens when joing a new Domain.

To recover the old profile so you can get Outlook data and other Application settings, open the Registry Editor

Run > regedit

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

You will get something like S-x-x-xx-xxxxx…

Change the ProfileImagePath to the directory of your old profile : ie %SystemDrive%\Documents and Settings\your_username

Vnc on Centos 5

useradd vncuser
passwd vncuser
yum groupinstall ” X Window System” “GNOME Desktop Environment”
yum install vnc-server

vi /etc/sysconfig/vncservers
VNCSERVERS=”1:vncuser”
VNCSERVERARGS[2]=”-geometry 1024×768 -nolisten tcp -nohttpd”

service vncserver start
chkconfig vncserver on /* auto start at boot */

vi /home/vncuser/.vnc/xstartup
exec gnome-session &

su vncuser
vncpasswd

tail -f /home/vncuser/.vnc/hostname:1.log
.vnc/xstartup: Permission denied

chmod + x /home/vncuser/.vnc/xstartup

service vncserver restart

Oracle 11g on Centos 5

Download oracle from here:
http://download.oracle.com/otn/linux/oracle11g/linux_11gR1_database_1013.zip

Post Installation Task
vi /etc/oratab
demo1:/u01/app/oracle/product/11.1.0/db_1:Y

oraenv /* use the database username during the install or SID */
ORACLE_SID = [root] ? demo1
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 is /u01/app/oracle

Init for Database and Listenere
vi /etc/init.d/oracle
#!/bin/bash
#
# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Oracle Database startup script

# Source function library.

. /etc/rc.d/init.d/functions

ORACLE_OWNER=”oracle”
ORACLE_HOME=”/u01/app/oracle/product/11.1.0/db_1″

case “$1″ in
start)
echo -n $”Starting Oracle DB:”
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/dbstart $ORACLE_HOME”
echo “OK”
;;
stop)
echo -n $”Stopping Oracle DB:”
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/dbshut $ORACLE_HOME”
echo “OK”
;;
*)
echo $”Usage: $0 {start|stop}”
esac

chmod +x /etc/init.d/oracle
chkconfig oracle on
service oracle start

Init for Enterprise Manager Database Control

vi /etc/init.d/oraemctl
#!/bin/bash
#
# oraemctl Starting and stopping Oracle Enterprise Manager Database Control.
# Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Enterprise Manager DB Control startup script

# Source function library.

. /etc/rc.d/init.d/functions

ORACLE_OWNER=”oracle”
ORACLE_HOME=”/u01/app/oracle/product/11.1.0/db_1″

case “$1″ in
start)
echo -n $”Starting Oracle EM DB Console:”
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/emctl start dbconsole”
echo “OK”
;;
stop)
echo -n $”Stopping Oracle EM DB Console:”
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/emctl stop dbconsole”
echo “OK”
;;
*)
echo $”Usage: $0 {start|stop}”
esac

chmod +x /etc/init.d/oraemctl
chkconfig oraemctl on
service oraemctl start
Environment variable ORACLE_SID not defined. Please define it.

vi /home/oracle/.bash_profile
ORACLE_HOME=”/u01/app/oracle/product/11.1.0/db_1″; export ORACLE_HOME
ORACLE_SID=”demo1″; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
alias sqlplus=’rlwrap sqlplus’
alias adrci=’rlwrap adrci’

service oraemctl start

rwlrap
yum install compat-readline43
wget -c http://ivan.kartik.sk/oracle/download_from.php?site_id=5
rpm -ivh rlwrap-0.24-rh.i386.rpm

Oracle Enterprise Manager
https://hostname:1158/em
username: system
password is the db user password during the db creation

References:
http://www.oracle.com/technology/pub/articles/smiley-11gr1-install.html
http://mdinh.wordpress.com/2007/09/06/oracle-10gr1-install-on-centos-5-notes/
http://ivan.kartik.sk/oracle/install_ora11gR1_elinux.html#st3

Joining Centos 5 to Windows 2003 R2 Domain

Windows 2003 R2
1. Control Panel -> Add/Remove Programs -> Add/Remove Windows Components -> Active Directory Services
Check Identity Management for Unix -> Details -> Check Admnistration Components and Server for NIS
/* Be sure to insert Windows Server 2003 R2 Disc2 */

2. Administrative Tools -> Active Directory Users and Computers. Unix Attributes will be added on the user properties

3. Configuring Users

Administrator
Administrative Tools -> Active Directory Users and Computers -> Administrator -> Unix Attributes
NIS Domain: jamieson
UID: 10001
Login Shell: /bin/bash
Home Directory: /home/Administrator
Primary group name/GID: 20000

winbind
Create a regular domain user with password never expires and user cannot change password.

Centos 5
yum install samba samba-common samba-client
yum install ntp
chkconfig ntpd on

vi /etc/ntp.conf
server 0.centos.pool.ntp.org
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org

/etc/init.d/ntpd restart

vi /etc/resolv.conf
search jamieson.local
nameserver 192.168.40.251

vi /etc/hosts /* Just in case of DNS failure */
192.168.40.251 S3.jamieson.local S3

vi /etc/krb5.conf
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log

[libdefaults]
default_realm = JAMIESON.LOCAL
dns_lookup_realm = true
dns_lookup_kdc = true
ticket_lifetime = 24h
forwardable = yes

[realms]
JAMIESON.LOCAL = {
kdc = S3:88
admin_server = S3:749
default_domain = JAMIESON.LOCAL
}

[domain_realm]
.jamieson = JAMIESON.LOCAL
jamieson = JAMIESON.LOCAL

vi /etc/ldap.conf
host ip.address.of.ad.domain.dns.server
base dc=jamieson,dc=local
uri ldap://s3.jamieson.local/
binddn winbind@jamieson.local
bindpw strong-winbind-account-password
scope sub
ssl no
nss_base_passwd dc=jamieson,dc=local?sub
nss_base_shadow dc=jamieson,dc=localsub
nss_base_group dc=jamieson,dc=local?sub?&(objectCategory=group)(gidnumber=*)
nss_map_objectclass posixAccount user
nss_map_objectclass shadowAccount user
nss_map_objectclass posixGroup group
nss_map_attribute gecos cn
nss_map_attribute homeDirectory unixHomeDirectory
nss_map_attribute uniqueMember member

vi /etc/nsswitch.conf
passwd: files winbind ldap
shadow: files winbind ldap
group: files winbind ldap

#hosts: db files nisplus nis dns
hosts: files dns

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files winbind
rpc: files winbind
services: files

netgroup: nisplus files winbind

publickey: nisplus

automount: files nisplus winbind
aliases: files nisplus

vi /etc/samba/smb.conf
[global] /* It is very important that this option be inside global */
workgroup = JAMIESON
security = ads
realm = JAMIESON.LOCAL
use kerberos keytab = true
;encrypt passwords = yes
# Optional. Use only if Samba cannot determine the Kerberos server automatically.
;password server = kerberos.example.com
password server = S3.JAMIESON.LOCAL

vi /etc/security/system_operators
root
administrator
winbind

[root@dtp ~]# chkconfig smb on
[root@dtp ~]# chkconfig winbind on
[root@dtp ~]# service smb start
Starting SMB services: [ OK ]
Starting NMB services: [ OK ]
[root@dtp ~]# service winbind start
Starting Winbind services:

kinit administrator@JAMIESON.LOCAL

getent passwd administrator
Administrator:*:10001:20000:Administrator:/home/Administrator:/bin/bash

net ads join -w JAMIESON -U Administrator

Reference:

CentOS 5 and Windows 2003 R2 Active Directory Integration

Alfresco Labs 3c installer on Ubuntu 8.04 Server 64bit

Install Jdk
sudo apt-get install sun-java6-jdk

Install Openoffice
sudo apt-get install openoffice.org
/* To prevent the X display error */
apt-get install openoffice.org-headless

Install swftools
sudo apt-get install swftools
/* The installer will ask the path for Java and Openoffice */

Download the Alfresco Labs 3c installer
Alfresco-Labs-3c-Linux-x86-Install

/* Rename the installe into .bin so it will run. */
sudo chmod +x Alfresco-Labs-3c-Linux-x86-Install
sudo mv Alfresco-Labs-3c-Linux-x86-Install Alfresco-Labs-3c-Linux-x86-Install.bin
sudo ./Alfresco-Labs-3c-Linux-x86-Install.bin

Alfresco.sh configuration
sudo vi /opt/Alfresco/alfresco.sh
export JAVA_OPTS=’-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -server’

Repository (alf_data, lucene-indexes and database)
sudo vi /opt/Alfresco/tomcat/shared/classes/alfresco/extension/custom-repository.properties

dir.root=/opt/Alfresco/alf_data
dir.indexes=/opt/Alfresco/alf_data/lucene-indexes
 
db.name=alfresco
db.username=alfresco
db.password=password
db.pool.initial=10
db.pool.max=100
 
#
# Property to control whether schema updates are performed automatically.
# Updates must be enabled during upgrades as, apart from the static upgrade scripts,
# there are also auto-generated update scripts that will need to be executed.  After
# upgrading to a new version, this can be disabled.
#
db.schema.update=true
 
#
# Derby connection
#
#db.driver=org.apache.derby.jdbc.EmbeddedDriver
#db.url=jdbc:derby:/opt/Alfresco/alf_data/derby_data/alfresco;create=true
 
#
# HSQL connection
#
#hsql#db.driver=org.hsqldb.jdbcDriver
#hsql#db.url=jdbc:hsqldb:file:/opt/Alfresco/alf_data/hsql_data/alfresco;ifexists=true;shutdown=true;
 
#
# MySQL connection (This is default and requires mysql-connector-java-5.0.3-bin.jar, which ships with the Alfresco server)
#
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco

Hibernate dialect
sudo vi /opt/Alfresco/tomcat/shared/classes/alfresco/extension/custom-hibernate-dialect.properties
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect

Configuring CIFS
/* Custom Config Folder is in /opt/Alfresco/tomcat/shared/classes/alfresco/extension/ */
/* Config Folder is in /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/ */
sudo vi /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.xml

vi /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.properties
cifs.localname=${localname}
cifs.domain=SPE3CH
cifs.broadcast=255.255.255.255

vi /opt/Alfresco/tomcat/shared/classes/alfresco/extension/file-servers-custom.xml
<config evaluator=”string-compare” condition=”CIFS Server” replace=”true”>
<serverEnable enabled=”true”/>
<host name=”${cifs.localname}A” domain=”SPE3CH”/>
<comment>Alfresco CIFS Server</comment>
<broadcast>192.168.1.255</broadcast>
<tcpipSMB platforms=”linux,solaris,macosx,windows”/>
<netBIOSSMB platforms=”linux,solaris,macosx,windows”/>
<tcpipSMB port=”1445″ platforms=”linux,solaris,macosx”/>
<netBIOSSMB sessionPort=”1139″ namePort=”1137″ datagramPort=”1138″ platforms=”linux,solaris,macosx”/>
<hostAnnounce interval=”5″/>
<Win32NetBIOS/>
<Win32Announce interval=”5″/>
<authenticator type=”enterprise”>
</authenticator>
<sessionDebug flags=”Negotiate,Socket”/>
</config>

Test Alfresco CIFS
smbclient -U admin \\\\127.0.0.1\\alfresco admin
if
smbclient -U admin \\\\192.168.1.101\\alfresco admin
Error connecting to 192.168.1.101 (Connection refused)
Connection to 192.168.1.101 failed (Error NT_STATUS_CONNECTION_REFUSED)

Check if you have DNS is On. If not or you still get the error like above:

vi /etc/hosts
127.0.0.1 localhost
192.168.1.101 ubuntu unbuntua

CIFS server debugging
vi /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties log4j.logger.org.alfresco.smb.protocol=debug

Using init script
groupadd alfresco
useradd -m -g alfresco alfresco
chown -R alfresco.alfresco /opt/Alfresco

vi /opt/Alfresco/tomcat/bin/setenv.sh
export JAVA_HOME=”/usr/lib/jvm/java-6-sun”
export JAVA_OPTS=’-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -server -Djava.io.tmpdir=/opt/Alfresco/tomcat/temp’

vi /opt/Alfresco/tomcat/bin/catalina.sh
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export JRE_HOME=/usr/lib/jvm/java-6-sun export JAVA_OPTS=’-Xms1024m -Xmx1024m’

sudo vi /etc/init.d/alfresco
chmod +x /etc/init.d/alfresco

Alfresco init script

#
# Alfresco init script for Ubuntu
# 2 nov 2007 Joost Horward
#
 
export ALFRESCO_HOME=/opt/Alfresco
export CATALINA_BASE=/opt/Alfresco/tomcat
export CATALINA_HOME=/opt/Alfresco/tomcat
export PIDFILE=/var/run/alfresco
export LOGFILE=/opt/Alfresco/alfresco.log
 
# Set any default JVM values
export JAVA_OPTS='-Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -server -Djava.io.tmpdir=/opt/Alfresco/tomcat/temp'
 
cd "$ALFRESCO_HOME"
#
# redirect FROM TO PROTOCOL
# setup port redirect using iptables
redirect() {
	echo "Redirecting port $1 to $2 ($3)"
	iptables -t nat -A OUTPUT -d localhost -p $3 --dport $1 -j REDIRECT --to-ports $2
	iptables -t nat -A PREROUTING -d $HOSTNAME -p $3 --dport $1 -j REDIRECT --to-ports $2
	iptables -t nat -A OUTPUT -d $HOSTNAME -p $3 --dport $1 -j REDIRECT --to-ports $2
}
 
#
# setup_iptables
# setup iptables for redirection of CIFS and FTP
setup_iptables () {
 
	echo "1" &gt;/proc/sys/net/ipv4/ip_forward
	# Clear NATing tables
	iptables -t nat -F
	# FTP NATing
	redirect 21 2021 tcp
 
	# CIFS NATing
	redirect 445 1445 tcp
	redirect 139 1139 tcp
	redirect 137 1137 udp
	redirect 138 1138 udp
}
 
#
# start_openoffice
#
start_openoffice(){
	sudo -H -u alfresco /usr/lib/openoffice/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard &amp;
}
 
case $1 in
start)
	if [ -f $PIDFILE ] ; then
		echo "Alfresco is already running!"
		exit 1
	fi
	touch $PIDFILE
	echo "Starting OpenOffice service ..."
	start_openoffice
 
	echo "Setting up iptables ..."
	setup_iptables	
 
	echo "Starting Alfresco ..."
 	echo  -e "\n\n\n\n\n\n\n\n\n\n`date` Starting Alfresco ..." &gt;&gt;$LOGFILE
 	sudo chown alfresco:alfresco $LOGFILE
	sudo -H -u alfresco sh $CATALINA_HOME/bin/startup.sh
        ;;
stop)
	sudo -H -u alfresco sh $CATALINA_HOME/bin/shutdown.sh
	killall -w -u alfresco
        echo  -e "`date` Stopping Alfresco ..." &gt;&gt;$LOGFILE
	rm $PIDFILE
        ;;
restart)
	rm $PIDFILE
	sudo -H -u alfresco sh $CATALINA_HOME/bin/shutdown.sh
	killall -w -u alfresco
 	 echo  -e "\n\n\n\n\n\n\n\n\n`date` Restarting Alfresco ..." &gt;&gt;$LOGFILE
	sudo -H -u alfresco sh $CATALINA_HOME/bin/startup.sh
	touch $PIDFILE
        ;;
zap)
	echo "Zapping $PIDFILE ..."
	rm $PIDFILE
	;;
*)
	echo "Usage: alfresco [start|stop|restart|zap] [tail]"
	exit 1
	;;
 
esac   
 
case $2 in
tail)
	tail -f $LOGFILE
	;;
esac
 
exit 0

/etc/init.d/alfresco start

Logging

Tomcat
mkdir -p /var/log/alfresco/tomcat/logs
chown -R alfresco.alfresco /var/log/alfresco/
rm -r /opt/Alfresco/tomcat/logs
ln -s /var/log/alfresco/tomcat/logs /opt/Alfresco/tomcat/logs

Alfresco
rm /opt/Alfresco/alfresco.log
ln -s /var/log/alfresco/alfresco.log /opt/Alfresco/alfresco.log

vi /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties
log4j.appender.File.File=/var/log/alfresco/alfresco.log

Troubleshooting

Repairing a trashed install. backup your alf_data

rm -rf /opt/Alfresco/alf_data
mkdir /opt/Alfresco/alf_data
chown -R alfresco.alfresco /opt/Alfresco/alf_data
 
rm -rf /opt/Alfresco/tomcat/temp/Alfresco
mkdir -rf /opt/Alfresco/tomcat/temp/Alfresco
chown -R alfresco.alfresco /opt/Alfresco/tomcat/temp/Alfresco
 
mysql -uroot -p
drop database alfresco;
create database alfresco;
exit;
 
/etc/init.d/alfresco start

Fixing openoffice not found
vi /opt/Alfresco/tomcat/shared/classes/alfresco/extension/bootstrap/openoffice-startup-context.xml
change soffice to soffice.bin and remove the quotes

/* Fixing permission denied on soffice */
chmod -R 755 /usr/lib/openoffice/

Refreshing lucene index
rm -rf /alf_data/lucene-indexes
sudo vi /tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties
# The index recovery mode (NONE, VALIDATE, AUTO, FULL)
index.recovery.mode=FULL

Reference

Installing Alfresco on Ubuntu 7.10
Installing Alfresco on Ubuntu 8.04

Multiboot OSX + Linux + Future OS with grub

Convert MBR to GUID Partition

Backup
Do a complete Time Machine
Boot your Leo Installer that has access to Disk Utility, Terminal and Restore from System Backup
Erase the MBR system disk
Use diskutility to create an GUID partion, putting 300mb as free space in front of the partition
Restart

Restore from Time Machine
Boot your Leo Installer and this time do a Restore from System Backup, select your Time Machine and restore everthing on the new GUID partition
Install Chameleon
Use disk utility to repair permissions

Creating ext2
newfs_ext2 -c /dev/disk0s1
fsck_ext2 /dev/disk1s2
sudo mount_ext2 /dev/disk1s2 /Volumes/boot
disktool -r
copy boot0, boot1h and boot to /Volume/boot

On your Linux
vi /boot/grub/menu.1st
title Mac OSX
root (hd0,1)
kernel /boot
boot

Project: Active Directory with roaming profiles and secondary backup

Active Directory on Windows 2003 R2 – Primary
1. A fully working AD is complemented by DHCP and DNS.

2. When sharing DOS based application with database, turn off offline caching to prevent unwanted lockups and corruption of files.

3. Roaming profile files should be stored in another server and offline chaching must be turned off as well. Everything is copied in a roaming profile except of Internet Cache and temporary data.

4. An email server within the domain must be entered in the DNS with its IANA IP.

Windows 2003 SP2 – Secondary AD
1. Must be the backup station with DDS3 tape and External raid storage.

2. Logon script must be updated to reflect the drive mapping relevant to change in 1

Resources

Working with Roaming User Profiles

Profile and Folder Redirection In Windows Server 2003

Step by Step Guide to Settiing Up Addtional Domain Controller