Tuesday, August 5, 2008
Change VC++ Win App to Console App
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
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
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... ;
Wednesday, May 14, 2008
Sun Volume Maintenance
metastat d5
d25: Submirror of d5
State: Resyncing
Size: 8395200 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c1t1d0s5 0 No Resyncing
2- Check disk needs maintenance with format analyze or fsck commands.
3- If error repaired re-enable submirror with metareplace command:
metareplace -e d5 c1t1d0s5
after the command, submirror state change to Resyncing and if there is no hard error it will become OK.
Complete Help @ Sun
Tuesday, May 13, 2008
Microsoft Mary, Mike and Sam Voice SAPI 5.0
http://download.microsoft.com/download/speechSDK/SDK/5.1/WXP/EN-US/speechsdk51.exe
If the engine is not installed download engine 5.1 and install this first:
https://www.cepstral.com/downloads/public/other/SAPI_5.1_installer.msi
Microsoft Mary, Mike and Sam Voice SAPI 5.0
http://download.microsoft.com/download/speechSDK/SDK/5.1/WXP/EN-US/speechsdk51.exe
If the engine is not installed download engine 5.1 and install this first:
https://www.cepstral.com/downloads/public/other/SAPI_5.1_installer.msi
Monday, April 21, 2008
Remove Unix User Expiry Date
usermod -e "" username
The command will change shadow file, not manually. The value of parameter -e can be a date to set a new expiry date.
Sunday, April 13, 2008
.rhosts and remote login
A point should be considered is that the permissions of the owner of this file should be set. (chmod [700, 600,500,400] .rhosts).
-rwx------ 1 user1 other 20 Apr 13 17:39 .rhosts
Another file that is used by system to remote access after checking of .rhosts is /etc/hosts.equiv. Each recored line in this file contain hostname [username], means which user from which machine can access without password to this machine. Same as previous file + char can be used to indicate all host or/and all users.
Attend to this point that user is local user that exist in /etc/passwd of
server machine.
Saturday, April 12, 2008
Unix Change Timezone & Cron Job
TZ=IRST-4:30
format of this variable value depends on platform.
The file /etc/TIMEZONE should be chnaged to reflex settings after reboot.
after changing the timezone cron task should be restarted to apply new timezone information,
/etc/init.d/cron stop
/etc/init.d/cron start
or kill /usr/bin/cron task and start it again.
Tuesday, April 8, 2008
Internal Causes of Call release in Siemens IN 7b
1 = unallocated (unassigned) number | 55 = incoming calls barred within CUG |
Sunday, April 6, 2008
Swap VoMS Application or Database Cluster
1- chris application should be stopped and when starting the framework should run as last application
(/opt/xpress/SxFramework/scripts/Sx.sh SxFrameWork stop|start)
2- check sun cluster status
scstat
The status of cluster, like which app or db on which cluster, online or offline
Node name Status
--------- ------
Cluster node: voms1 Online
Cluster node: voms2 Online
3- Stop appropriate resource group
scswitch -F -g [rg_sxfwapp|rg_sxfwdb] (-F make offline)
4- Change primary node
scswitch -z -D [appvol|dbvol] -h [voms2|voms1] (-z change primary node)
5- Make resource online
scswitch -Z -g [rg_sxfwapp|rg_sxfwdb] (-Z make resources online)
6- Start chris application as mentioned above
Thursday, April 3, 2008
Sending Double Message in Dialogic Sigtran
To prevent sending more than one same message the retransmission configuration of both side must be same. In dialogic side it's done by CNTOS command and RMIN(retransmission min) and RMAX(retransmission max) parameters. In cisco itp side can be seen by sh cs7 m3ua command.
Windows XP Timezone and Daylight Saving
http://support.microsoft.com/kb/914387
TZEdit can edit time zone information.
Tuesday, February 19, 2008
Solaris Network Configuration
/usr/sbin/ifconfig -a
Configure network card and enable it in hardware level
ifconfig eth0 plumb
Assign ip and mask to interface
ifconfig eth0 192.168.100.12 broadcast 192.168.100.255 netmask 255.255.255.0
Uping the interface to work
ifconfig eth0 up
all commands together
ifconfig eth0 192.168.100.12 broadcast 192.168.100.255 netmask 255.255.255.0 plumb up
Check other hosts addressing for interfaces
arp -a
Assign default boot-time IP to interfaces by inserting ip address in proper hostname file
/etc/hostname.eth0 or /etc/hostname.qfe2
The postfix period (eth0) depends on device driver and number of that type.
Mapping names to IP is set in /etc/hosts
www.name1 192.168.10.10
www.name2 172.168.10.25
Setting defult gateway to act as router by inserting gateway address in /etc/defaultrouter
To set ip address of an interface by DHCP at boot-time proper hosname.*** file should be empty and another empty file, /etc/dhcp.*** , should be created.
Monday, February 18, 2008
Format SQLPlus Output
set newpage 0
set pagesize 999
Format number column:
col[umn] colName for[mat] 999..number of digits..99
charachter:
col[umn] colName for[mat] a(length of string)
Wednesday, February 6, 2008
VPN and LAN Together
route add dest-addresses mask dest-addr-mask gateway-ip
route add 192.168.0.0 mask 255.255.0.0 192.168.100.120
Wednesday, January 30, 2008
Presenting of Point Code in SCCP Called Party
Presence of PC in CDPA is equal to set bit #2.
SCCP_CONFIG 10278 0x8 0x00020102 0x00000001
Detail of setting these bits is discussed on SCCP Programmers Manual, ext_options section.
Sunday, January 27, 2008
Cisco Telnet Session Timeout
-->exec-timeout 5 0 // Session will be disconected after 5 min of inactivity
-->logout-warning 60 //Warning timeout before automatically logoff
-->absolute-timeout 15 //After 15 min router wil disconnect telnet session
Sunday, January 20, 2008
Change Structure Member Alignmment
Thursday, January 17, 2008
Randomization
int k = 1 + rand() % 80; // for random number 1 to 80
Monday, January 14, 2008
Start & Stop IN Application
stop: mkup -dtK
start: mkup -rstK
*These command have to be run in instscp user context.
** The first application which comes up will become the master counter manager.
Other useful command in this subject:
Check Up & Down of process on local and remote hosts
mkup -iploc
mkup -iprem
Check master and slave Counter Manager
cmctx_ls -l
Wednesday, January 9, 2008
Unsigned Primitive Type in Java
2- Converting unsigned types to standard java types:
byte b;
int i = b & 0xff;
int i;
long l = i & 0xffffffffL;
3- Combining two unsigned shorts into an unsigned int.
short ush = 4;
short usl = 9999;
int ucombined = ( ush & 0xffff ) << 16 | ( usl & 0xffff );
4-/**
* Convert an unsigned int to a String.
* @param i the int to convert.
* @return the equivalent unsigned String
*/
public static void unsignedToString( int i )
{
return Long.toString( i & 0xffffffffL )
}