30 November 2012

JBoss and security

JBoss implementaiton of security is JBossSX. It both supports declarative J2EE (JEE) and role-based security model.
  • Default implementation for declarative security model is JAAS.
Declarative: you declare the security roles and permissions using a standard XML message, rather than embedding in your code.
Secure access to EJBs and web components using ejb-jar.xml and web.xml deployment descriptors.
  • isCallerInRole
  • security-role-ref/role-name
New from EJB 2.0, specify what identity an EJC should use when it invokes methods on other components.

26 November 2012

First impression of AppStore for Mac

I do like having all the applications that can be installed in one place. It is a really nice feature to have. Whenever you want, you can go there, find your app, have your apps backed up, read others reviews and so on.
These are all good only and only if the application you are installing won't be different from what you can get out of the AppStore. Interesting right? Apple has put some guideline in place for those applications in App Store of its Mac. For example, if you install TextWrangler from AppStore you won't get the ability to use its command line tools, such as edit .bash_profile. However, if you download from their website, you will get the full application with all the perks. See what they are saying themselves.


In order to comply with Apple’s submission guidelines, the Mac App Store version of BBEdit does not support automatic installation and updating of the bbedit, bbfind, and bbdiff command-line tools (and their associated man pages). However, it is possible to install the tools without using BBEdit’s built-in installation, and once installed, they will work correctly.

BBEdit is another product of Bare Bones Software, similar to TextWrangler. To me, it is not a really nice direction Apple is heading. Asking developers to reduce their software capabilities to be accepted in AppStore is not something I am looking for. After learning that, I didn't even once clicked on the AppStore icon in the Mac, old school searching, finding the application website, and downloading directly from there was and will be what I am going to do.

16 November 2012

Eclipse Project Red Exclamation Mark

This is something bothering me for a long time. I was working in a project dealing with several dependencies. After some reboots I got an exclamation mark next to the java project, like this one. There are no notes or suggestions on what is going wrong. Cleaning the projects won't work either. After some research, I have figured out that this kind of problem is related to the working code, which means it is something going wrong on the build directory. Whenever you got exclamation mark error, you first better try to clean your project, if no success, try deleting the build directory and any other build related material in your project code.

Here it says

The red exclamation mark means Eclipse is having trouble finding a required library or source.

15 November 2012

Bashrc, Bash_profile & how to change shell color in linux

There is a difference between bashrc and bash_profile in different distributions of Linux. You might need to specifically find out about the distribution you are working with. Generally difference between them are as follow:

According to the bash man page, .bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells. (more)

There are several things you can do with your bash_profile and bashrc. Let us examine some of them. Let's say you want to change how the command prompt looks, you can each time set it to what you want, or better you can set it in your bash_profile and let it be. You can set something like this:

export PS1="\e[0;31m[\u@\h \W]\$ \e[m"

for a full range of what you can do with your PS1 (prompt in Linux/Unix) you can search online or look at BASH Shell change the color of my shell prompt under Linux or UNIX or How to: Change / Setup bash custom prompt (PS1)
.

8 November 2012

How to reload bash_profile in Linux / Unix ?

Have you ever wanted to reload your bash_profile in your Linux / Unix system? You obviously don't want to restart your whole system or re-login to your system to enable your new settings like newbies. What you can do is to reload your bash_profile file using a simple syntax. You just need to use source to do that as so:

source .bash_profile

and it will do the trick.

6 November 2012

JAAS Notes

Java Authentication and Authorization Service, or JAAS, pronounced "Jazz"

Configuration files for JAAS
  • *.login.conf (e.g. form login)
  • *.policy (which identity grant which permission)
LoginModule (interface)
LoginContext (Class)
  • Kick off authentication process by creating a subject (if no subject passed to it will create a new one)
Subject
  • e.g. user, resource, system, ...
Principal
  • Face of subject
  • subject 1..* principal
-------

Passes
  1. Create instance of LoginContext e.g. LoginContext(string, callBackHandler) [string the name, callBackHandler used for passing information back to LoginModule]
  2. CallBackHandler (->Handle Method ->Transfers required information to LoginModule)
    empty subject created before authentication begin
    passed to all LoginModuels
    if authentication successful, populated with principals and credentials
    then subject can be get from getSubject in LoginContext
-------

Login Process (Two Passes)

  • Phase 1
LoginMethod each loginModule login
  • Phase 2
commit method of all login modules invokes
login if successful -> commit methods of all login modules invoked -> then attaching principals and credentials

5 November 2012

Extending task-bar using dual monitor in Windows 7

Have you noticed whenever you are connecting your Microsoft Windows PC or laptop to a second monitor, there is only one task-bar and it will stay with the main display? Is it a good option or not, you can have your say. However, I believe for most developers like me, it is not a great advantage. You do not know which windows are open in which monitor. So, if you are eager to have extended task-bar for your extra monitor, I would recommend using Actual Multiple Monitors. This is not an open source program nor it is a free one, but is has many free features that you can utilize. If you find yourself so in love with the application to use all its features you can try buying it. I have tried several applications and this is one of the best I came across. My criteria was simplicity and the ability to show the window position related to the monitor its being used.