Friday 12 December 2014

MacPorts problem installing mono-addins

OSX version: 10.9.5
MacPorts version: 2.3.3
mono-addins version: 0.6.2

Command line error:
$ sudo port install mono-addins
--->  Computing dependencies for mono-addins
--->  Building mono-addins
Error: org.macports.build for port mono-addins returned: command execution failed
Please see the log file for port mono-addins for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_mono-addins/mono-addins/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port mono-addins failed

main.log error: (toward the end)
:info:build error CS1705: Assembly `gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' references `Mono.Cairo, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' which has a higher version number than imported assembly `Mono.Cairo, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'

Find it fast using:
grep -n ":info:build error" /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_mono-addins/mono-addins/main.log 

Where is Mono.Addins.Gui?:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_mono-addins/mono-addins/work/mono-addins-0.6.2/Mono.Addins.Gui

From https://monoaddins.codeplex.com/discussions/399592 :
"Go to makefile in the Mono.Addins.Gui project and find ASSEMBLY_COMPILER_FLAGS. Add -sdk:4 after -d:DEBUG and run make again."

 

Monday 20 October 2014

Upgrade Crunchbang from wheezy/waldorf to janice/jessie (stable to testing) simplified


Following jschueths's post Updating Crunchbang to the Next Release I decided to use SED to make everything easier, instead of making the changes one-by-one by hand.

We should probably make backups of the files we are modifying first:
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.waldrof
$ sudo cp /etc/apt/preferences /etc/apt/preferences.waldrof
Then one command to make all the modifications:
$ sudo sed -i 's/waldorf/janice/g;s/wheezy/jessie/g' /etc/apt/sources.list /etc/apt/preferences
Then as jschurths said:
$ sudo apt-get update
$ sudo apt-get --no-install-recommends dist-upgrade

Sunday 19 October 2014

Block incoming WAN (Internet) connections for SAMBA using iptables


 This is my idea on how one might keep WAN connections from hitting a SAMBA server:
iptables -m multiport -m comments -A INPUT -s 192.168.0.0/24 -p tcp --dports 137:139,445,43270,43273 -j ACCEPT --comment "Allow local connections to SAMBA - TCP"
iptables -m multiport -m comments -A INPUT -s 192.168.0.0/24 -p udp --dports 137:139,445,43270,43273 -j ACCEPT --comment "Allow local connections to SAMBA - UDP"


iptables -m multiport -m comments -A INPUT -p tcp --dports 137:139,445,43270,43273 -j DROP --comment "Block WAN connections to SAMBA - TCP"
iptables -m multiport -m comments -A INPUT -p udp --dports 137:139,445,43270,43273 -j DROP--comment "Block WAN connections to SAMBA - UDP"
 The ports *should* be right for SAMBA. The network address and range (192.168.0.0/24) might have to be changed to reflect you LAN (internal network)

Tuesday 28 January 2014

Unity 4 - Third Person Controller and Camera useage hints and tips

1.) First thing first, when applying the components "Third Person Controller" and even more importantly "Third Person Camera" BOTH scripts should be applied to your player object. "Third Person Camera" is not meant to be applied to a camera, as much as the name might suggest it.

If you attached the "Third Person Camera" script to a camera you probably got a message like the following:

Please assign a target to the camera that has a ThirdPersonController script attached.
UnityEngine.Debug:Log(Object)
ThirdPersonCamera:Awake() (at Assets/Standard Assets/Character Controllers/Sources/Scripts/ThirdPersonCamera.js:58)

2.) If you can't find "Third Person" Controller or Camera look under Components > Scripts.

3.) If you leave the "Camera Transform" attribute under "Third Person Camera" blank the script will try to use the Main Camera automatically. If you have no main camera (for whatever reason) and don't assign a camera transform to it there will be issues.... With an error probably like the following:

MissingComponentException: There is no 'Camera' attached to the "something" game object, but a script is trying to access it.
You probably need to add a Camera to the game object "something". Or your script needs to check if the component is attached before using it.

4.) If you get the following error:
InvalidCastException: Cannot cast from source type to destination type.
ThirdPersonCamera.Awake () (at Assets/Standard Assets/Character Controllers/Sources/Scripts/ThirdPersonCamera.js:52)
...it is probably because there is a collider on your player object. Take off the collider. Something ("Character Controller" I assume) is adding automagically.

5.) If you get weird jumpiness when turning, make sure all the above it straightened out. Then make sure the Camera isn't a child object of the player... Who knows, maybe it got there when you were experimenting with the scripts initially? :p