Sunday, November 7, 2010

Bribery

"the practice of offering something (usually money) in order to gain an illicit advantage"

The first question is should I accept it where most or all people do it, so the first answer is absolutely not, it is not moral. But when it becomes part of organization culture and provide better opportunities for whom got it what can do. What must do when your manager or top level officers do ? Leaving the company is a good option if possible.

The worse thing is that you face it in technological company, where you expect the skills & ingenuity is the scale of progress & promotion.

These are just the questions.

Sunday, April 11, 2010

Soalris Zone Initial Configuration

After installing new zone by zoneadm command don't forget to login to zone console by zlogin -C zoneName to complete zone installation and initial configuration.

If don't your services don't run on zone, no port open to listen for connection and many other misleading problems.

Tuesday, August 5, 2008

Change VC++ Win App to Console App

To change the windows application in Visual C++ to console after change the name of WinMain method to another name to prevent the linker to set it as entry point and add a main method you may get the error:
LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

So you need another change in your project properties:
Project Properties -> Linker -> System -> SubSystem

and set it to
Console (/SUBSYSTEM:CONSOLE)

rather than
Windows (/SUBSYSTEM:WINDOWS)

That suggested to the linker that maybe the program entry point should be “main” rather than “WinMain

Monday, August 4, 2008

Run Java Application using Server JVM

Every form of Sun's Java runtime comes with both the "client VM" and the "server VM." Unfortunately, Java applications and applets run by default in the client VM. The Server VM is much faster than the Client VM, but it has the downside of taking around 10% longer to start up, and it uses more memory.

There are two ways to run Java applications with the server VM:

1. When launching a Java application from the command line, use java -server [arguments...] instead of java [arguments...]. For example, use java -server -jar beanshell.jar.

2. Modify the jvm.cfg file in your Java installation. (It's a text file, so you can use Notepad or Emacs to edit it.) This is located in C:\Program Files\Java\j2reXXX\lib\i386\ on Windows, /usr/java/j2reXXX/lib/i386/ on Linux. You will see two lines:

-client KNOWN
-server KNOWN

You should change them to:

-server KNOWN
-client KNOWN

This change will cause the server VM to be run for all applications, unless they are run with the -client argument.

Saturday, August 2, 2008

Solaris Log Files

  • /var/adm/syslog -- Logs common system events
  • /var/adm/messages -- Miscellaneous log file for most events on a system
  • /var/cron/log -- Logs all jobs run in crontab
  • /var/lp/logs/lpsched -- Logs information related to the print services
  • /var/adm/pacct -- Used for process accounting

Tuesday, July 29, 2008

Scripting Oracle SQL

To run sql commands of oracle in a script to use abilities of it like scheduling with crontab write the shell script commands in script.sh as belows

script.sh:
FILENAME=$(date +'%d-%m-%Y.txt')
sqlplus user/pass@db-sid <<EOL >> $FILENAME
select * from tbl1 where rownum<10000;
EOL

If sqlplus can't be run in the context of the this user the above script can be called in another script with su -c or specifying oracle user in crontab.

Monday, May 19, 2008

Delete Duplicate Rows in Oracle

DELETE FROM our_table
WHERE rowid not in
(SELECT MIN(rowid)
FROM our_table
GROUP BY column1, column2, column3... ;