passwordless SSH on osx

Use at your own risk people!
For user:
ssh-keygen -t dsa
cat ~/.ssh/id_dsa.pub | ssh example.com ‘cat >> ~/.ssh/authorized_keys; chmod 644 ~/.ssh/authorized_keys; cat ~/.ssh/authorized_keys’
For Root:
sudo ssh-keygen -t dsa
sudo cat /var/root/.ssh/id_dsa.pub | ssh root@example.com ‘cat >> ~/.ssh/authorized_keys; chmod 644 ~/.ssh/authorized_keys; cat ~/.ssh/authorized_keys’

Bash script to break apart a Mastery Manager Export

# This code is only for use under adult supervision. Proceed at your own risk. 🙂
#!/bin/bash
ORIGIFS=$IFS
# set $IFS to end-of-line
IFS=`echo -en “\n\b”`
if ( !$1 )
then
echo ‘usage: batch.command Name_Of_MM_Export_To_Process’;
break;
fi
for l in $(cat $1 )
do
if `echo ${l} | grep  “Student” 1>/dev/null 2>&1`
#this line is the header, start a new output file
then
file=$(($file+1))
echo $l > $file.txt
echo -n ‘.’
else
# this line is not a header, write it to the current file
echo $l >> $file.txt
fi
done;  # end the loop
# return the original IFS
IFS=$ORIGIFS
plue a little one liner to rename the files using line 2, column 2 as the title.
n=0 ; for i in $(ls) ; do mv $i $(cat $i | head -n 2 | tail -n 1 | cut -d, -f2 | tr ‘ ‘ ‘_’ | tr ‘/’ ‘-‘ | tr -d ‘”‘)–$n.txt ; n=$(($n+1)) ; done

SSRS Expressions: Scope and Commenting Tips

In SSRS, Scope is confusing as hell. Below is an example of adding comments to SSRS expressions and how to probe scope. Adding a line like:

iif(inscope(“matrix1_dept”),”[d]”,””)

will display a “[d]” in cells that are in the scope of group “matrix_dept”, and nothing if it is outside that
scope. By adding multiple scope tests, you can see where cells lie in the scheme of things.