Archive for 2009

Tivoli Storage Manager - Tape Libray Usage

Monday, July 13th, 2009

Hi,

We do a lot of work work with Tivoli Storage Manager and a lot of our smaller customers have storage pools that will not fit into their tape library. We know this is totally wrong but is life and it happens.

Heres a small script we thought we would share, it has helped us loads over the past years; it displays the current tape libray usage so you can make an informed choice on the tapes to remove or reclaim.

def script q_li_usage “select volume_name,stgpool_name,pct_utilized,status from volumes where volume_name in (select volume_name from libvolumes)”

TSM Support

Application Access Levels with PHP

Saturday, February 28th, 2009

Hello all

This week we got a job in to write an intranet site for a large Insurance company in the UK.

It had 60 or so applications that needed writing with access to each being given on a per user basis.

So for example user “A” could see applications 1 and 3, and user B could only use application 2.

So how do you do this easily?

We started off having a link table, it had User ‘A’ mapped to application 1 and so on. Which is ok but they have 5000+ staff and 60 applications so that would be a table with 300,000 rows in it, which in its self in MySql is nothing really, it just seemed excessive.

What we came up with is a bitwise solution so each application had a bit assigned to it. So if you remember your binary “0 1 2 4” etc. Each application was assigned a binary number, so application 1 was “1” in binary, application 2 was “10” ,application 3 was “100” and so on

So if a user as an access level of 7, that would translate in to a binary number of 111 so they could access application 1, 2 and 3. If a user had an access level of 4 for example they could only access application 3.

Binary (Base 2) Application
0 Superuser
1 Application 1
2 Application 2
4 Application 3
8 Application 4

We will post the class over the next few weeks if any body else wants to use it.

Happy coding