eXTReMe Tracker
Mar 302011

FSL: flirt is used to compute an intial affine normalization of the T1 weighted images; this is then fed to fnirt to compute the overall transformation. flirt is also used to register the EPI’s to the subject’s structural image. This was then used along with fnirt-s warp in applywarp to normalize the EPIs.

Script for normalizing the T1-weighted structurals to the template:

Registering T1-structural to MNI152
bet my_structural my_betted_structural
 flirt -ref ${FSLDIR}/data/standard/MNI152_T1_2mm_brain -in my_betted_structural -omat my_affine_transf.mat
 fnirt --in=my_structural --aff=my_affine_transf.mat --cout=my_nonlinear_transf --config=T1_2_MNI152_2mm
 applywarp --ref=${FSLDIR}/data/standard/MNI152_T1_2mm --in=my_structural --warp=my_nonlinear_transf --out=my_warped_structural

Registering functional data to MNI152 (via structural scan)

bet my_structural my_betted_structural
 flirt -ref my_betted_structural -in my_functional -dof 7 -omat func2struct.mat
 flirt -ref ${FSLDIR}/data/standard/MNI152_T1_2mm_brain -in my_betted_structural -omat my_affine_transf.mat
 fnirt --in=my_structural --aff=my_affine_transf.mat --cout=my_nonlinear_transf --config=T1_2_MNI152_2mm
 applywarp --ref=${FSLDIR}/data/standard/MNI152_T1_2mm --in=my_functional --warp=my_nonlinear_transf --premat=func2struct.mat --out=my_warped_functional
Mar 172011

On the destination computer type the following command. Replaceing middleuser with your name and replacing middle with the domain of the middle computer.

ssh -R 10002:localhost:22 middleuser@middle

This will open port 10002 for listening and forward all future connections to port 22 at destination. This connection must remain on the entire time to ensure that you can access your destination computer whenever you want.

Now if sshd is set to use GatewayPorts you should be able to connect with this:

ssh destinationuser@middle -p 10002

If you are not sure if GatewayPorts is on or you don’t have the access to change it use the following method to connect:

First connect to the middle computer how you would normally.

ssh user@middle

Then connect to the localhost of the middle computer on port 10002.

ssh user@localhost -p 10002

Note: The port 10002 is arbitrary you can use any port you want.

You should now be remotely logged into your computer behind the NAT/Firewall. Enjoy.

Content copied from :http://www.marksanborn.net/howto/bypass-firewall-and-nat-with-reverse-ssh-tunnel/

Mar 152011

If you are on a network that has MAC addresses hardwired, i.e. you can only access the network if a certain MAC address is plugged into a specific ethernet jack on the wall, you don’t have too many options.

One option I used recently is spoofing the MAC address of your device. Its done by editing the hardware address to match the MAC address of the device that’s allowed on that ethernet jack.

If you are using Linux, make a note of your current IP address in a text file.

sudo ifconfig -a | grep eth0 > ~/Desktop/netaddressbak.txt

Run the same command on the device that’s attached to the network to find its MAC address: Lets say its – 01:82:39:B2:41:30

Before you attach your new device to the ethernet cable, change its MAC address to the one listed above.

sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether 01:82:39:B2:41:30
sudo ifconfig eth0 up
sudo ifconfig eth0 | grep HWaddr

This should now list the address as 01:82:39:B2:41:30.

You can now attach this device on the network to gain full connectivity (unless there are some programs that are supposed to ping every once in a while).

Mar 142011
 #$x would be the input filename and %3d will pad it to be a 3 digit number with zero pads, %4d will make it 4 digit and so on.
 num=`expr match "$x" '[^0-9]*\([0-9]\+\).*'`
 paddednum=`printf "%03d" $num`
 echo $paddednum