In previous versions of Mac, you can just drag & drop apps to the finder window, but with Mavericks, you also need to hold the cmd button while drag & drop.
Friday, May 2, 2014
Unix Startup Scripts
There is always a confusion on which dot file to use to initialise environment variables under unix (i.e) .bash_profile , /etc/profile , .bashrc, .bash_login et.al?
There is two different types of shells called login shell & interactive shell and each has it own sequence of dot files to look for while starting. How do you differentiate them ? When trying to remotely login through ssh or any shell which asks to login is considered as login shell.
In the case of a login shell, the /etc/profile file is sourced first. Then it looks for the files in below sequence
In the case of a interactive shell, then it looks for ~/.bashrc and executes it if present.
On my setup what ideally I do is to keep my environment variables in ~./profile file as the subshell (or) subprocess would inherit that. All the alias definitions would go into the ~/.bashrc file.
A good reference is available here
There is two different types of shells called login shell & interactive shell and each has it own sequence of dot files to look for while starting. How do you differentiate them ? When trying to remotely login through ssh or any shell which asks to login is considered as login shell.
In the case of a login shell, the /etc/profile file is sourced first. Then it looks for the files in below sequence
.bash_profile -> ~/.bash_login -> .profile and whichever is found first & readable is executed.
In the case of a interactive shell, then it looks for ~/.bashrc and executes it if present.
On my setup what ideally I do is to keep my environment variables in ~./profile file as the subshell (or) subprocess would inherit that. All the alias definitions would go into the ~/.bashrc file.
A good reference is available here
How to open more than one instance of the app in mac
Normally you can only open one instance of the application in mac from the applications menu.. To open multiple instances here is a way to do it - either open a terminal & type open -n <The .app file path' or create a apple script which will do it for you. Make sure you save it as .app to launch it as an application.
Below is an example for a sample script i have created to launch multiple instances of soap ui.
Below is an example for a sample script i have created to launch multiple instances of soap ui.
simple hack to open unauthorized apps in mac
By default the security & privacy setting in mac would allow you open applications downloaded from appstore & identified developers. The apps that you download from web, normally they are not allowed to be opened and a simple hack to do is to press command and double click on the app. This will open a window with a warning having a open button. The other option is to change the security & privacy setting to open applications downloaded from anywhere and that could be a bit risky.
bash vs sh
There is always a confusion as to why we define the following while writing a shell script in unix based system:
#! /bin/sh (or) #! /bin/bash
#! is known as shebang which lets the rest of the line to be considered as a interpreter directive by the program loader. Thus the program loader knows which interpreter needs to be used to execute the shell script.
sh - Bourne Shell used to be the default shell of the old unix systems.
bash - Bourne-again shell is the outcome of the GNU project and it supersedes sh. In Mac and most of the linux distributions bash is shipped as the default interpreter. In fact sh is considered as a system shell and hence in most distributions is mostly a symbolic link to bash.
Saturday, January 1, 2011
Too Many Files Open
In my new Ubutnu VM while was trying to deploy a composite, all of a sudden I started getting the following error with JDK 1.6:
Message send failed: Too many open files
It turned out that the default value(1024) for file descriptor is less and after increasing it to >=4096, the error disappeared.
Use the command ulimit(Bash) to list the descriptor value.
Increase the file descriptor value in
/etc/security/limits.conf
* soft nofile 4096
* hard nofile 4096
restart the server and you should be good to go
Wednesday, December 8, 2010
Starting WLS Managed Server without entering the credentials
Its simple. Create the boot.properties file under the managed server directory and provide the credentials.
$MW_HOME/user_projects/domains/[domain]/servers/[managed_server]/security
In my case the location is:
/home/ganesh/software/Oracle/MiddlewarePS2/user_projects/domains/soa_domain/servers/soa_server1/security
Also
If you want to specify a custom directory add the following to the startup scripts for the server.
-Dweblogic.system.BootIdentityFile=(path)/boot.properties
$MW_HOME/user_projects/domains/[domain]/servers/[managed_server]/security
In my case the location is:
/home/ganesh/software/Oracle/MiddlewarePS2/user_projects/domains/soa_domain/servers/soa_server1/security
Also
If you want to specify a custom directory add the following to the startup scripts for the server.
-Dweblogic.system.BootIdentityFile=(path)/boot.properties
Subscribe to:
Posts (Atom)