Windows creates a Pagefile.sys file in "C" drive's root directory, and it is used to swap data between the hard drive and the faster random access memory, or RAM. By default, this file can be up to three times the amount of RAM you currently have installed. Being as the paging file is primarily used when you run out of RAM, which can happen when you run several powerful business applications at the same time, the amount allocated for the pagefile.sys can be too large for practical use. This isn't a big deal when you have ample free space on your hard drive, but if you're running short on storage space for your business files, you might want to reduce pagefile.sys.
Step 1
Click "Start," right-click "Computer" and select "Properties."
Step 2
Click "Advanced System Settings," select the "Advanced" tab and choose "Settings" in the Performance section.
Step 3
Click the "Advanced" tab and select "Change" in the Virtual Memory section.
Step 4
Deselect "Automatically Manage Paging File Size for all Drives."
Step 5
Click "Custom Size" and enter a smaller value in the "Initial Size (MB)" and "Maximum Size (MB)" fields. Alternately, click "No Paging File" if you want to remove pagefile.sys entirely. This is only recommended if you have a lot of RAM.
Step 6
Click "Set." Click "Yes" if you receive a confirmation or warning window.
Step 7
Click "OK" to each of the windows to exit them.
Step 8
Restart your computer for the settings to become active.
Sunday, 1 February 2015
Windows Admin - How to config SYS file
While Windows has moved away from using Microsoft Disk Operating System as a base, versions of DOS still persist. Some programs refuse to run in modern versions of Windows and require a DOS emulator. If your business runs programs in DOS, understanding how to configure the Config.sys file to load your devices, such as a CD-ROM, is necessary. Configurations vary, so check which version of DOS your company is using.
Step 1
Press "Windows-R" to open the Run menu. Type "cmd" (without quotes here and in subsequent commands) and press "Enter" for a command prompt.
Step 2
Type "cd\" and press "Enter." Type "edit config.sys" in the command window to open an editor for the Config.sys file.
Step 3
Type in the configuration options for your Config.sys file. The most common Config.sys commands are the following: DEVICE=C:\WINDOWS\HIMEM.SYS DOS=HIGH,UMB DEVICE=C:\WINDOWS\EMM386.EXE noems
The Himem.sys file is a high memory manager, into which the next command "DOS=HIGH,UMB" loads DOS. "EMM386" is the extended-memory support and is generally disabled with the "noems" command.
Step 4
Add any devices you need to load to Config.sys with the "DEVICEHIGH" command, such as "DEVICEHIGH=C:\ATAPI\CDROM.sys" for a CD-ROM drive.
Step 5
Type "LASTDRIVE=S," where "S" is the last drive letter you want available to DOS.
Step 6
Add the following lines to your Config.sys file to add a menu to your Config.sys and boot loading: [MENU] MENUITEM STARTUP, Basic Startup MENUITEM NETWORK, Network Start
This displays a menu on startup with the items Startup and Network. Farther down in the file, type "[STARTUP]" along with any commands to run under that item, such as the basic configuration in the previous example, which enables you to specify commands for the various Config.sys configurations based on your needs. See Resources for more Config.sys options.
Step 7
Press "Alt-F" then "S" to save the file, or click on the "File" menu and choose "Save."
Step 8
Press "Alt-F" then "X" to exit, or choose "Exit" from the menu.
Step 1
Press "Windows-R" to open the Run menu. Type "cmd" (without quotes here and in subsequent commands) and press "Enter" for a command prompt.
Step 2
Type "cd\" and press "Enter." Type "edit config.sys" in the command window to open an editor for the Config.sys file.
Step 3
Type in the configuration options for your Config.sys file. The most common Config.sys commands are the following: DEVICE=C:\WINDOWS\HIMEM.SYS DOS=HIGH,UMB DEVICE=C:\WINDOWS\EMM386.EXE noems
The Himem.sys file is a high memory manager, into which the next command "DOS=HIGH,UMB" loads DOS. "EMM386" is the extended-memory support and is generally disabled with the "noems" command.
Step 4
Add any devices you need to load to Config.sys with the "DEVICEHIGH" command, such as "DEVICEHIGH=C:\ATAPI\CDROM.sys" for a CD-ROM drive.
Step 5
Type "LASTDRIVE=S," where "S" is the last drive letter you want available to DOS.
Step 6
Add the following lines to your Config.sys file to add a menu to your Config.sys and boot loading: [MENU] MENUITEM STARTUP, Basic Startup MENUITEM NETWORK, Network Start
This displays a menu on startup with the items Startup and Network. Farther down in the file, type "[STARTUP]" along with any commands to run under that item, such as the basic configuration in the previous example, which enables you to specify commands for the various Config.sys configurations based on your needs. See Resources for more Config.sys options.
Step 7
Press "Alt-F" then "S" to save the file, or click on the "File" menu and choose "Save."
Step 8
Press "Alt-F" then "X" to exit, or choose "Exit" from the menu.
Windows Cmd - Useful Ones
1. List Dir structure in Tree style
tree /A "C:\TIBCOProjects" > C:\TIBCOProjects\DirTree.txt
2. Flush DNS changes in the network
ipconfig /flushdns
3. Net Stat find info and kill process
Ex.: Find process running on a specific port 8080
netstat -ano | find "8080"
or
netstat -ano | findstr 8080
----------------Sample--------------------
netstat -ano | find "4001"
sample outcome:
TCP 0.0.0.0:4001 0.0.0.0:0 LISTENING 1536
TCP 10.20.2.220:4001 10.20.10.108:1654 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1696 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1737 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1783 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1829 TIME_WAIT 0
----------------------------------------------
Kill the process running on the specific process id:
taskkill /F /PID <pid>
4. Sort then Unique the file recs:
Write the bat file with following content:
@echo off
goto :TopOfCode
=======================================================================
Author:
Warren Chen
Date: 2014.10.20
Useage:
SortAndUniqueFile.bat [SourceFile] [> OutputFile]
e.g.
SortAndUniqueFile.bat "c:\test case\input.txt" > "c:\test case\output.txt"
=======================================================================
:TopOfCode
setlocal disabledelayedexpansion
set "prev="
for /f "delims=" %%F in ('sort %1' ) do (
set "curr=%%F"
setlocal enabledelayedexpansion
if !prev! neq !curr! echo !curr!
endlocal
set "prev=%%F"
)
5. Move file from share location to local in Batch
Write bat file with following content:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
rem ========== Configuration area ==========
set sourceDir=\\ulttib01\admin\test
set targetDir=C:\test\MoveFile\output
set fileType=*.xml
set batchSize=10
set fileCount=0
set sleepSec=1
set netDrive=s:
set leftFileCount=0
rem ========== Configuration area ==========
net use %netDrive% %sourceDir%
goto MoveFile
:MoveFile
for %%a in ("%netDrive%\%fileType%") do (
set /a fileCount+=1
rem echo the file is: %%a
if !fileCount! leq %batchSize% move "%%a" %targetDir%
)
set /a fileCount=0
:CountFile
set leftFileCount=0
for %%f in ("%netDrive%\%fileType%") do (
set /a leftFileCount+=1
)
echo File left: %leftFileCount%
goto CheckPoint
:CheckPoint
if !leftFileCount! gtr 1 (
echo sleep
ping 1.1.1.1 -n 1 -w 3000 > nul
echo finished sleep
goto MoveFile
) ELSE (
goto End
)
:CountFile1
FORFILES /S /M %netDrive%\*.xml /C "set /a fileCount+=1"
echo The file number is now: %fileCount%
:End
net use /del s:
ENDLOCAL
tree /A "C:\TIBCOProjects" > C:\TIBCOProjects\DirTree.txt
2. Flush DNS changes in the network
ipconfig /flushdns
3. Net Stat find info and kill process
Ex.: Find process running on a specific port 8080
netstat -ano | find "8080"
or
netstat -ano | findstr 8080
----------------Sample--------------------
netstat -ano | find "4001"
sample outcome:
TCP 0.0.0.0:4001 0.0.0.0:0 LISTENING 1536
TCP 10.20.2.220:4001 10.20.10.108:1654 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1696 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1737 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1783 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1829 TIME_WAIT 0
----------------------------------------------
Kill the process running on the specific process id:
taskkill /F /PID <pid>
4. Sort then Unique the file recs:
Write the bat file with following content:
@echo off
goto :TopOfCode
=======================================================================
Author:
Warren Chen
Date: 2014.10.20
Useage:
SortAndUniqueFile.bat [SourceFile] [> OutputFile]
e.g.
SortAndUniqueFile.bat "c:\test case\input.txt" > "c:\test case\output.txt"
=======================================================================
:TopOfCode
setlocal disabledelayedexpansion
set "prev="
for /f "delims=" %%F in ('sort %1' ) do (
set "curr=%%F"
setlocal enabledelayedexpansion
if !prev! neq !curr! echo !curr!
endlocal
set "prev=%%F"
)
5. Move file from share location to local in Batch
Write bat file with following content:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
rem ========== Configuration area ==========
set sourceDir=\\ulttib01\admin\test
set targetDir=C:\test\MoveFile\output
set fileType=*.xml
set batchSize=10
set fileCount=0
set sleepSec=1
set netDrive=s:
set leftFileCount=0
rem ========== Configuration area ==========
net use %netDrive% %sourceDir%
goto MoveFile
:MoveFile
for %%a in ("%netDrive%\%fileType%") do (
set /a fileCount+=1
rem echo the file is: %%a
if !fileCount! leq %batchSize% move "%%a" %targetDir%
)
set /a fileCount=0
:CountFile
set leftFileCount=0
for %%f in ("%netDrive%\%fileType%") do (
set /a leftFileCount+=1
)
echo File left: %leftFileCount%
goto CheckPoint
:CheckPoint
if !leftFileCount! gtr 1 (
echo sleep
ping 1.1.1.1 -n 1 -w 3000 > nul
echo finished sleep
goto MoveFile
) ELSE (
goto End
)
:CountFile1
FORFILES /S /M %netDrive%\*.xml /C "set /a fileCount+=1"
echo The file number is now: %fileCount%
:End
net use /del s:
ENDLOCAL
Linux Script - Useful Ones
[Tested in cygwin]
1. Find Strings in the Dir.
find [Dir Path] -type f -name "*.[FileTypePostFix]" | xargs grep "[search string]" -bn --color=auto
e.g.
find . -type f -name "*.substvar" | xargs grep "P1O1" -bn --color=auto
2. Copy the Dir Structure under specific Dir (auto creates all the non-exist dirs)
Instruction:
XCOPY <<SourceFolder>> <<Destination>> /O /X /E /H /K /T
/E - Copies folders and subfolders, including empty ones.
/H - Copies hidden and system files also.
/K - Copies attributes. Typically, Xcopy resets read-only attributes.
/O - Copies file ownership and ACL information.
/X - Copies file audit settings (implies /O).
/T : Copies the subdirectory structure (that is, the tree) only, not files
(To copy empty directories, you must include the /e command-line option.)
Ex:
xcopy C:\temp D:\temp /O /X /E /H /K /T
It copies all the dir structure under C:\temp to D:\temp
3. Remove dup-record in the file
sort -u input.txt > output.txt
4. Find specific file
find . -type f -name '*.xml'
5. Find file numbers in dir and sub dir
find . -type f |wc -l
6. list all dirs:
find . -type d
7. Remove Files Postfix
find -type f -name '*.temp' -print0 | while read -d $'\0' f; do mv "$f" "${f%.temp}"; done
TIBCO - RV testing basic script
Send request via RV transport
tibrvsend -service 9494 -network ;239.255.9.4 -daemon tcp:9494 test aaaa
Send request via RV transport
tibrvlisten -service 9494 -network ;239.255.9.4 -daemon tcp:9494 test
tibrvsend -service 9494 -network ;239.255.9.4 -daemon tcp:9494 test aaaa
Send request via RV transport
tibrvlisten -service 9494 -network ;239.255.9.4 -daemon tcp:9494 test
TIBCO - Get some EMS statistics (Windows)
1. Write the bat file EMS_Statistic_cmd.bat with following content:
@ECHO OFF
REM Basic Configuration =========================================
REM Set directory
set EMS_HOME=c:\tibco\ems\5.1\bin
set TARGET_EMS=tcp://10.20.2.251:7222
set EMS_USER=admin
set EMS_PASS=T1bc0_prd_jms
set OUT_FILE_NAME=Statistic_out_
set FILE_POSTFIX=TIBCO_NEWPROD_EMS_7222
rem set maxbytesize=10000000
REM Basic Configuration =========================================
:loop
for /f "tokens=1-3 delims=:." %%a in ("%time%") do set timestamp=%%a:%%b:%%c
for /f "tokens=1-3 delims=/." %%a in ("%date%") do set datestamp=%%a/%%b/%%c
rem echo current date time is: %datestamp%-%timestamp%
rem echo the file name will be: %OUT_FILE_NAME%%FILE_POSTFIX%.txt
echo.
REM pslist -x %1% 2>&1
echo.
%EMS_HOME%\tibemsadmin -server %TARGET_EMS% -script EMS_Statistic_cmd.script -ignore -user %EMS_USER% -password %EMS_PASS% >%OUT_FILE_NAME%%FILE_POSTFIX%.txt
echo.
sleep 20
echo =================================================
rem FOR /F "usebackq" %%A IN ('"%OUT_FILE_NAME%%FILE_POSTFIX%.txt"') DO set size=%%~zA
rem if %size% LSS %maxbytesize% (
rem echo.%OUT_FILE_NAME%%FILE_POSTFIX%.txt is ^< %maxbytesize% bytes
rem ) ELSE (
rem echo.%OUT_FILE_NAME%%FILE_POSTFIX%.txt is ^>= %maxbytesize% bytes
rem set FILE_POSTFIX=%datestamp%-%timestamp%
rem )
IF one == one (goto loop)
:endloop
2. Write the EMS_Statistic_cmd.script with content:
time on
timeout 120
info
show connections full
show topics
show queues
show consumers full
show db
3. Run the script and collecting the stats
@ECHO OFF
REM Basic Configuration =========================================
REM Set directory
set EMS_HOME=c:\tibco\ems\5.1\bin
set TARGET_EMS=tcp://10.20.2.251:7222
set EMS_USER=admin
set EMS_PASS=T1bc0_prd_jms
set OUT_FILE_NAME=Statistic_out_
set FILE_POSTFIX=TIBCO_NEWPROD_EMS_7222
rem set maxbytesize=10000000
REM Basic Configuration =========================================
:loop
for /f "tokens=1-3 delims=:." %%a in ("%time%") do set timestamp=%%a:%%b:%%c
for /f "tokens=1-3 delims=/." %%a in ("%date%") do set datestamp=%%a/%%b/%%c
rem echo current date time is: %datestamp%-%timestamp%
rem echo the file name will be: %OUT_FILE_NAME%%FILE_POSTFIX%.txt
echo.
REM pslist -x %1% 2>&1
echo.
%EMS_HOME%\tibemsadmin -server %TARGET_EMS% -script EMS_Statistic_cmd.script -ignore -user %EMS_USER% -password %EMS_PASS% >%OUT_FILE_NAME%%FILE_POSTFIX%.txt
echo.
sleep 20
echo =================================================
rem FOR /F "usebackq" %%A IN ('"%OUT_FILE_NAME%%FILE_POSTFIX%.txt"') DO set size=%%~zA
rem if %size% LSS %maxbytesize% (
rem echo.%OUT_FILE_NAME%%FILE_POSTFIX%.txt is ^< %maxbytesize% bytes
rem ) ELSE (
rem echo.%OUT_FILE_NAME%%FILE_POSTFIX%.txt is ^>= %maxbytesize% bytes
rem set FILE_POSTFIX=%datestamp%-%timestamp%
rem )
IF one == one (goto loop)
:endloop
2. Write the EMS_Statistic_cmd.script with content:
time on
timeout 120
info
show connections full
show topics
show queues
show consumers full
show db
3. Run the script and collecting the stats
TIBCO Admin - Connecting from TIBCO to MS SQL using Windows Authentication (TIBCO Driver + 3party Driver)
Connecting from TIBCO to MS SQL using Windows Authentication (TIBCO Driver + 3party Driver)
Opt1: using MS JDBC Driver
1. Get the latest version of Microsoft SQL Server JDBC Driver from microsoft.com site. Unzip it. Then:
JDBC_Driver:
URL:

Test===================================================================
Opt2: using MS JDBC Driver
1. Configure your BW-application to use appropriate driver and connection string:
JDBC_Driver:
URL:
Test
com.microsoft.sqlserver.jdbc.SQLServerDriver1. Get the latest version of Microsoft SQL Server JDBC Driver from microsoft.com site. Unzip it. Then:
- copy sqljdbc4.jar to <tibco_home>\tpcl\5.6\jdbc
- Note that: The sqljdbc.jar sometimes cannot be used as the JRE environment version may not supporting it.
- copy \auth\x86\sqljdbc_auth.dll to C:\WINDOWS\SysWOW64 (or to C:\WINDOWS\System32 on 32bit system) and to <tibco_home>\tra\5.6\bin
JDBC_Driver:
com.microsoft.sqlserver.jdbc.SQLServerDriverURL:
jdbc:sqlserver://<server_name>;instanceName=<instance>;databaseName=<database>;integratedSecurity=true;e.g.jdbc:sqlserver://stetibsql01:1433;databaseName=Tib_PROD_REF;integratedSecurity=true;
Test===================================================================
Opt2: using MS JDBC Driver
tibcosoftwareinc.jdbc.sqlserver.SQLServerDriver1. Configure your BW-application to use appropriate driver and connection string:
JDBC_Driver:
tibcosoftwareinc.jdbc.sqlserver.SQLServerDriverURL:
jdbc:tibcosoftwareinc:sqlserver://<server_name>;instanceName=<instance>;databaseName=<database>;authenticationMethod=type2;loadLibraryPath=[tpcl_jdbc_dir];e.g.jdbc:tibcosoftwareinc:sqlserver://stetibsql01:1433;databaseName=Tib_PROD_REF;authenticationMethod=type2;loadLibraryPath=C:\tibco\classic\tpcl\5.8\jdbc;StringInputParameterType=varcharTest
Subscribe to:
Posts (Atom)
