7/26/2012

Change Apple Mac OS X Software Update Service (SUS) address

Apple IU Software Update service allows uses to keep their Mac OS X machines updated with the latest software updates and security patched. In some controlled environments, the update servers are specified in the user profile. Sometimes there may be delays in the server updates, or problems with the local update server and users may desire to connect to Apple's services directly. Here's are some instructions that users may find useful. Please note that to make configuration changes you will need Administrative privileges on your Mac.

Users should also note that where a URL for the update catalog is not specified, network administrators may have implemented transparent update redirection by manipulating DNS entries on a local server for URLs such as; http://swscan.apple.com, http://swquery.apple.com, http://swdownload.apple.com, http://swcdn.apple.com

Check the SUS server settings
To check you current SUS settings, issue the following command from a terminal;
  1. /usr/libexec/PlistBuddy -c Print /Library/Preferences/com.apple.SoftwareUpdate.plist
  2. /usr/libexec/PlistBuddy -c Print ~/Library/Preferences/com.apple.SoftwareUpdate.plist
The above commands would produce an output similar to the following;

Dict {
    LastAttemptSystemVersion = 10.7.2 (11C74)
    LastRecommendedUpdatesAvailable = 0
    RecommendedUpdates = Array {
    }
    CatalogURL = http://XXX.XXX.XXX.XX:8088/index.sucatalog
    LastResultCode = 2
    ScheduleFrequency = 1
    LastUpdatesAvailable = 0
    LastAttemptDate = Thu Jul 26 10:37:51 EST 2012
    LastSuccessfulDate = Thu Jul 26 10:37:51 EST 2012
}

Change the SUS server settings back to Apple's default
Delete the CatalogURL entry by issuing the following command to force the IU software update to connect to Apple's URL

  1. defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL

To change the SUS server
To change the SUS server to any other value issue the following command from a terminal;
  1. defaults write com.apple.SoftwareUpdate CatalogURL 'http://SERVER:PORT/index.sucatalog'
References
  1. http://support.apple.com/kb/HT3923

7/25/2012

How to install Springer Lecture Notes in Computer Science (LNCS) style for MiKTeK on Windows 7

Following on from my previous post... I had the same issue when working on my Microsoft Windows desktop at home, i.e. got the following error "! LaTeX Error: File `llncs.cls' not found.". So had to download the "llncs2e.zip" file yet again from "http://www.springer.com/computer/lncs?SGWID=0-164-6-793341-0/"
  1. Dowload and extract llncs2e.zip
  2. Create a directory called splncs in C:\Program Files\MiKTeX 2.?\bibtex\bst
  3. Move the extracted file splncs.bst, splncs_srt.bst, and splncs03.bst into the new directory C:\Program Files\MiKTeX 2.9\bibtex\bst\splncs
  4. Move the extracted directory ?? into C:\Program Files\MiKTeX 2.9\tex\latex
  5. Rebuild the filename database by Miktek - Maintenance - Settings, and click on the "Refresh FNDB" button (this may take a while depending on your computer)

7/24/2012

Springer Lecture Notes in Computer Science (LNCS) style

When working on a recent paper for a conference, I was required to produce it using the Spring Lecture Notes in Computer Science (LNCS) style. Being naive, I assumed TeX would automatically download the required package... unfortunately I got the following error "LaTeX Error: File `llncs.cls' not found." So I had to install the class manually. Here are the instructions for installing it on Mac OS X for latex from macport.
  1. Download the llncs2e.zip package from the Springer website [1]
  2. Unzip the file into the tex-live distribution location for macport, i.e. /opt/local/share/texmf-texlive-dist/tex/latex
  3. Rebuild the ls-R databases using TeX by executing sudo texhash
  4. To get the bibliography style setup, change directory by using cd /opt/local/share/texmf-texlive-dist/bibtex/bst
  5. Make a directory to hold the style sudo mkdir splncs; cd splncs
  6. Either copy or link the files sudo ln -s ../../../tex/latex/llncs2e/*.bst .
TexLive
If you are using a variant of TexLive such as MacTex, then you can copy the style files (*.bst) into "/usr/local/texlive/2012/texmf-dist/bibtex/bst/splncs" and the tex files into "/usr/local/texlive/2012/texmf-dist/tex/latex/llncs" and finally to update the ls-R database use "sudo /usr/local/texlive/2012/bin/x86_64-darwin/texhash"


Makefile
My Makefile now run without issues. Here's a copy of my Makefile

PROJ=paper


OS := $(shell uname -s)

.PHONY: all pdf clean read 

all: pdf

pdf: $(PROJ).tex
 pdflatex $(PROJ)
 bibtex $(PROJ)
 pdflatex $(PROJ)
 pdflatex $(PROJ)

diff: $(PROJ)-original.tex
 latexdiff $(PROJ)-original.tex $(PROJ).tex > $(PROJ)-diff.tex
 pdflatex $(PROJ)-diff
 bibtex $(PROJ)-diff
 pdflatex $(PROJ)-diff
 pdflatex $(PROJ)-diff

readdiff:
ifeq ($(OS), windows32)
 start ${PROJ}-diff.pdf
endif
ifeq ($(OS), Darwin)
 open -a /Applications/Preview.app/Contents/MacOS/Preview ${PROJ}-diff.pdf
endif
ifeq ($(OS), Linux)
 acroread ${PROJ}-diff.pdf
endif

read:
ifeq ($(OS), windows32)
 start ${PROJ}.pdf
endif
ifeq ($(OS), Darwin)
 open -a /Applications/Preview.app/Contents/MacOS/Preview ${PROJ}.pdf
endif
ifeq ($(OS), Linux)
 acroread ${PROJ}.pdf
endif

clean:
 rm -f ${PROJ}.ps ${PROJ}.pdf ${PROJ}.log ${PROJ}.aux ${PROJ}.out ${PROJ}.dvi ${PROJ}.bbl ${PROJ}.blg ${PROJ}.toc 

cleandiff:
 rm -f ${PROJ}-diff.ps ${PROJ}-diff.pdf ${PROJ}-diff.log ${PROJ}-diff.aux ${PROJ}-diff.out ${PROJ}-diff.dvi ${PROJ}-diff.bbl ${PROJ}-diff.blg ${PROJ}-diff.toc 

References
  1. http://www.springer.com/computer/lncs/lncs+authors?SGWID=0-40209-0-0-0

7/20/2012

My ant build.xml file

I am doing some development work using Java and am using ant to build my code. Decided to post a copy of the build.xml file here... sorry about the formatting


<project name="TODO-PROJ-NAME" basedir="." default="main">
    <property name="username"    value="TODO-USERNAME"/>
    <property name="proj.name"   value="TODO-PROJ-NAME"/>
    <property name="proj.ver"    value="TODO-VER"/>
    <property name="proj.owner"  value="TODO-COPYRIGHT"/>

    <tstamp>
        <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
    </tstamp>
    
    <property name="src.dir"     value="src"/>
    <property name="build.dir"   value="bin"/>
    <property name="lib.dir"     value="lib"/>
    <property name="classes.dir" value="${build.dir}/classes"/>
    <property name="jar.dir"     value="${build.dir}/jar"/>
    <property name="javadoc.dir"     value="${build.dir}/javadoc"/>

    <property name="main-class"  value="fj.com.kush.ui.TODO-PROJ"/>

    <path id="project.classpath">
 <fileset dir="${lib.dir}">
  <include name="*.jar"/>
 </fileset>
        <pathelement path="${classes.dir}"/>
    </path>


    <target name="clean">
        <delete dir="${build.dir}"/>
        <delete>
            <fileset dir="." includes="**/*~" defaultexcludes="false"/>
        </delete>     
    </target>


    <target name="compile">
        <mkdir dir="${classes.dir}"/>
 <javac destdir="${classes.dir}" includeantruntime="false" debug="true" debuglevel="lines, vars, and source">
  <src path="${src.dir}"/>
  <classpath refid="project.classpath"/>
 </javac>
    </target>


    <target name="javadoc">
        <mkdir dir="${javadoc.dir}"/>
 <javadoc destdir="${javadoc.dir}">
                <fileset dir="${src.dir}"/>
        </javadoc>
    </target>


    <target name="release" depends="jar, javadoc" description="make a new release of the project"/>


    <target name="copy.properties">
 <mkdir dir="${classes.dir}"/>

 <patternset id="properties.files">
  <include name="**/*.properties"/>
 </patternset>

 <copy todir="${classes.dir}">
  <fileset dir="${src.dir}">
   <patternset refid="properties.files"/>
  </fileset>
 </copy>
    </target>


    <target name="jar" depends="compile,copy.properties">
        <mkdir dir="${jar.dir}"/>
 <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
            <manifest>
  <attribute name="Implementation-Title" value="${proj.name}"/>
  <attribute name="Implementation-Version" value="${proj.ver}"/>
  <attribute name="Implementation-Vendor" value="${proj.owner}"/>
                <attribute name="Main-Class" value="${main-class}"/>
  <attribute name="Built-By" value="${username}"/>
  <attribute name="Built-Date" value="${TODAY}"/>
  <attribute name="Class-Path" value="./"/>
            </manifest>
        </jar>
    </target>


    <target name="run" depends="jar">
        <java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
    </target>


    <target name="clean-build" depends="clean,jar"/>


    <target name="main" depends="clean,run"/>
</project>