Archive for July, 2011

Upload files to Sharepoint from linux

20 July, 2011 Comments off


It seemed almost impossible to penetrate the fortress that is Sharepoint with only NTLM authentication enabled. Turns out its really easy when you know how.

curl to the rescue!

You can upload files using curl directly into Sharepoint via it’s HTTP PUT interface.

curl --ntlm --user username:password --upload-file myfile.xls

Told you, easy when you know how.

Categories: General

Shibboleth settings for TorqueBox

16 July, 2011 Comments off

Authentication Settings

Notes on setting up Shibboleth against an Apache Reverse Proxy to TorqueBox.

Config File: /etc/httpd/conf.d/shib.conf

ShibUseHeaders On
AuthType shibboleth
ShibRequestSetting requireSession 1
require valid-user

The ‘ShibUseHeaders On‘ setting tells Shibboleth to pass along its attributes as request headers so your sinatra/rails application can gain access to them allowing you to implement your own authorisation system.

Simple Authorisation

If you don’t need a complex authorisation system and you don’t mind users seeing a standard Shibboleth authorisation error page:

You can implement this via your Shibboleth settings using the require statement:

ShibUseHeaders On
AuthType shibboleth
ShibRequestSetting requireSession 1
require grouper_groups ~ MySecurityGroup

Here we require the custom grouper_groups attribute matches on the regular expression after the ‘~‘. Basically to access the protected url the user must be a member of the MySecurityGroup.

Top Tip

When playing with your Shib settings don’t forget to restart httpd to see the affect.
sudo /sbin/service httpd restart

Categories: torquebox

Setup Apache Reverse Proxy to Torquebox

16 July, 2011 Comments off

Setup Apache as a Reverse Proxy in front of a standalone Torquebox server.

Apache Setup

Proxy Module

For this to work Apache must have the mod_proxy module loaded:

Config file: /etc/httpd/conf/httpd.conf

ProxyRequests Off # Switch off forward proxy
ProxyPreserveHost On # Pass host name onto the proxy
ProxyPass /myapp http://localhost:8080/myapp/ # Map url to remote server
ProxyPassReverse /myapp http://localhost:8080/myapp/ # Adjust header sent from remote server to match url

Here we are passing all calls to the /myapp/ url on to the Torquebox server http://localhost:8080/myapp/

TorqueBox Setup

In your Torquebox application folder create a file ‘config/torquebox.yml’ which contains a context which matches the Apache reverse proxy url.


context: /myapp
version: 1.9

Categories: General, torquebox

TorqueBox – gem install error

14 July, 2011 Comments off

TorqueBox Install

I’m playing with latest version of TorqueBox (Currently 2.x.incremental.245) the easiest way to install it is via a gem:

gem install torquebox-server --pre --source

Full details on the TorqueBox blog (


Anyhoose when doing the gem install on my dev server (CentOS 5.6) I got the error:

Error: Your application used more memory than the safety cap of 500m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).


After a bit digging around it turns out you need to set the heap size when running the gem install:

jruby -J-Xmx900m -S gem install torquebox-server --pre --source

More details on stackoverflow.

Hope that helps someone or maybe me if have to do this again!

Categories: torquebox


12 July, 2011 Comments off


scp ~/.ssh/


sudo mkdir /home/git/myrepo
cd /home/git/myrepo
sudo git --bare init
sudo chown -R git:git /home/git/myrepo


mkdir myrepo
cd myrepo
git init

# add some files

git add .
git commit -m "added some files"

git remote add origin
git push origin master

rm -r myrepo/
git clone

Categories: git