Friday, December 2, 2016

Articles Worth Reading

Below is a reading list that i find interesting.



Working with native memory in managed languages.
- https://dzone.com/articles/understanding-sunmiscunsafe

Friday, September 4, 2015

Debugging MPI applications with GDB

Basic GDB

'sayHello' being the program binary

> gdb sayHello

> b 10  - set the breakpoint at line 10


> run   - run the program under debugger


> print 'variable_name'  - print the variable name


Ctrl+x , a    will enable the gui based debugging in the gdb.


MPI debugging,

running a program under gdb

> mpiexec -n 4 xterm -e gdb ./gtc

this will bring up 4 xterm terminals. we have to run the processes in each xterm separately.

> mpiexec -n 1 xterm -e gdb ./your_app : -n 3 ./your_app : -n 1 xterm -e gdb ./your_app

here we control the specific process ranks to debug.

Tuesday, May 5, 2015

Compiling/Installing Mainline Linux Kernel on Ubuntu



Canonical provides Ubuntu flavors of mainline kernel. However I wanted to install the latest kernel, straight from the Linus's git repo . :)

I used a virtual machine environment to compile and install the kernel. We can install the following
software packages using Ubuntu's package manager (apt).

- Qemu - virtualization platform
- Virt-manager - GUI for qemu

I used 14.04 Ubuntu distribution - downloaded it from the canonical site.
Create a new virtual machine and install Ubuntu, log in to the machine. From here on-wards, we are inside our VM.

Now we checkout the mainline kernel from Linus's github repo.

> git clone --depth 3 https://github.com/torvalds/linux.git

Here i have selected depth as 3 to avoid entire version history checkout. Go inside the linux source directory.

> cd linux

Lets first change the target name of our kernel by editing the Makefile, change the param to,

EXTRAVERSION = -test

Now we have to prepare the configuration of the target Linux kernel. Here we are configuring the set of modules that we want to package with our kernel. Manual config is a tedious task. We have two options,

1. Get the config of the current Ubuntu distribution and reuse it.
2. Get the list of loaded modules of the currently running system and use it as the config.


If you are following the first option, then copy the config-xxx file found under /boot directory of Ubuntu to our Linux source directory as .config

>cp /boot/config-3.13.0-40-generic .config
>make oldconfig

However this config has large number of modules, which don't get loaded at runtime at all. Hence we can create a much light weight system by creating a config out of our currently loaded modules in the system.
Hence I used,

>make localmodconfig

Since our mainline kernel is the bleeding edge, it will require some entirely new configs. The config program will prompt you for input, accept the default values. (just press and hold ENTER)

Now we have config suitable for our target environment. Lets compile the kernel source,

> make > /dev/null

Once the build is complete, our shiny new kernel image can be found at:

linux/arch/x86_64/boot/bzImage

Next step would be to install it. Before that we have to install the kernel modules we built along with our kernel.

>sudo make INSTALL_MOD_STRIP=1 modules_install

This will install the new modules under,  /lib/modules/4.1.0-test+

Now install the kernel,

>sudo make install


Create the initramfs file system for our new kernel, This is the ram file system that is get loaded before real file system setup.

>sudo update-initramfs -c -k 4.1.0-test+

Finally update the grub, so it can find our new kernel during the boot process.


>sudo update-grub

Now if you examine the /boot directory, you should see newly created files,

- vmlinuz-4.1.0-test+
- System.map-4.1.0-test+
- config-4.1.0-test+

Before restart, lets configure the GRUB menu, so that we can choose our kernel during the boot process. Edit, /etc/default/grub file and comment out the below lines. Otherwise, the grub would not display the splash screen and will go on to boot the latest kernel.


#GRUB_HIDDEN_TIMEOUT=0 
#GRUB_HIDDEN_TIMEOUT_QUIET=true

Restart the virtual machine.

During the boot process select, 'advanced options' from grub menu




And select the new kernel.




Once you are log in to the system, just double check using the shell command,

>uname -a 

We are done.! 

Monday, May 4, 2015

Intel Processor Micro-architecture Code Names

It follows a tick-tock naming convention.

Tock - New micro-architecture while keeping the process technology the same.
Tick  - Improving on the previous micro-architecture using process technology. (45nm etc.)


Nehalem (tock)         45nm
Westmere (tick)        32nm

Sandy Bridge (tock)  32 nm
Ivy Bridge (tick)        22 nm

Haswell (tock)            22nm
Broadwell (tick)          14nm



source - Wikipedia Articles




Tuesday, July 16, 2013

[Webinar] Extending WSO2 Carbon for Your Middleware Needs

I am going to conduct a webinar on the $title. In this webinar we are going to cover the possible usages of the extension points provided by Carbon platform. Carbon is a very powerful middle-ware platform as it is... , however it provides enough flexibility to the developer if he/she wants to alter the default behavior.



Carbon Runtime View - diagram by sameeraJayasoma.































In this webinar we are going to cover topics such as ,

1. Authentication framework in Carbon
2. Deployment engine and how to introduce your own artifact deployment model
3. Component architecture in Carbon, and how it benefits.
4. How to make use of extension points to achieve monitoring requirements
5. etc.

I am going to take few use-cases and explain how we can achieve them using Carbon extension points. If time permits i'm hoping to do some demos as well. Interested ? :) Please register via this link,

http://wso2.com/library/webinars/2013/07/how-to-extend-wso2-carbon-for-your-middleware-needs



Saturday, June 29, 2013

Enabling SAML2 SSO for WSO2 Carbon Server, OpenSSO/OpenAM as the IDP

WSO2 Carbon products comes with in-built web-SSO authenticators. Within minutes, you can enable web-SSO for any WSO2 Carbon server using WSO2 Identity Server as the IDP. In this blog post we are using, OpenSSO/OpenAM as the IDP and do the configuration.

Pre-requisites


1. Download and install openAM/openSSO [download the war file from here]
2. Download the WSO2 product.

Setting up the environment

Configuring OpenSSO/OpenAM


openSSO provides two mechanisms to register an service provider,
  • Creating a SP fedlet
  • Setting up a SP using a meta file called sp.xml
In this post I'm using the latter approach.

  1. Configure the sp.xml file.

  • The given sp.xml sample file uses, https://localhost:9443/acs as the redirection URL. Configure it according to your environment. https:///acs
  • EntityID element of the sp.xml should match the corresponding value of ‘ServiceProviderID’ in the authenticators.xml file
  









urn:oasis:names:tc:SAML:2.0:nameid-format:transient







   


2. Go to Common Tasks -> Register Remote Service Provider link and select the sp.xml as the file    to uploaded and select a Circle of Trust.




   


3. Go to Federation ­> entity providers in the openSSO management console and select the
newly registered service provider.Select/tick response signing attribute.






















Under name ID format list, make sure you specify, ‘transient’ and ‘unspecified’ name ID
formats.

Setting up WSO2 Carbon Server

1. Enable the SSO authenticator and configure the IDP URL in authenticators.xml found under
$CARBON_HOME/repository/conf/security/authenticators.xml

10

/carbon/admin/login.jsp
https://localhost:9443/acs
http://localhost:8080/opensso/SSOPOST/metaAlias/idp<
/Parameter>
opensso





Change the following params accordingly,
  • ServiceProvideID - This can be any identifier. Doesn’t have to be a URL. However the configured value should be equal to the value we configured in the ‘’ in sp.xml
  • IdentityProviderSSOServiceURL - The URL of your IDP
  • idpCertAlias - This is the certificate that get used during response validation from the IDP. OpenSSO servers’ public key should be imported to the Carbon servers keystore with the alias name ‘opensso’

Exporting/Importing Certificates

Add the public key of the selected circle of trust in to the Carbon keystore(wso2carbon.jks) found
under $CARBON_HOME/resources/security/wso2carbon.jks. You can use Java keytool to do that.

-Exporting a public key

Here we will be using the default shipped openSSO keystore certificate. It has the alias name of ‘test’
and typically located in /home/opensso/opensso/keystore.jks. The default password is ‘changeit’. To
export the public key of ‘test’,

keytool -export -keystore keystore.jks -alias test -file test.cer

The public key will get stored in ‘test.cer’ file. you can view the certificate content with the command,

keytool -printcert -file test.cer

- Importing a public key to the wso2carbon.jks

Now import the ‘test.cer’ into Carbon key stores found under $CARBON_HOME/repository/resources/security/wso2carbon.jks

keytool -import -alias opensso -file test.cer -keystore wso2carbon.jks

view the imported certificate using the command
keytool -list -alias opensso -keystore wso2carbon.jks -storepass wso2carbon

Testing the Environment


Try accessing the carbon management console. (eg. https://localhost:9443/carbon) The call will
redirect you to IDP (openSSO login page). Enter username and the password in the openSSO login
page. Once you properly authenticated you will redirect back you to the WSO2 Carbon product login
page as a logged in user.
Please note: The authenticated user has to be in the Carbon servers’ user-store for authorization
(permission) purposes. Since the above described test environment does not share the same user
store between IDP (openSSO server) and SP (Carbon server) i created a user called ‘amAdmin’ in
Carbon server user store. Otherwise there will be a authorization failure during the server login.

"[2013-06-17 10:22:04,601] ERROR
{org.wso2.carbon.identity.authenticator.saml2.sso.SAML2SSOAuthenticator} - Authentication
Request is rejected. Authorization Failure."

Please Note: As of this writing, there are interop issues with released version of Carbon servers and OpenSSO. I have created a JIRA here, along with the patch to rectify the issue. Future Carbon releases will fix this issue.