20 Ocak 2014 Pazartesi

How to set a classpath in Websphere Application Server v8.5

When JSP files or Servlets import external java packages, the CLASSPATH must be set correctly in order for the WebSphere compiler to access the required classes.

There are several methods to set the CLASSPATH:
  • You can set the CLASSPATH in one of the batch files that WebSphere Application Server uses to initialize the environment variables. It is called setupCmdLine (.bat for Windows, .sh for Unix) and it is located in <WebSphere installation root>/AppServer/bin. Open this file and add the path to your jar files at the end of WAS_CLASSPATH line:
  • You can also copy the required classes and JAR files into one of the directories listed in the table below. By default, these directories are included in the CLASSPATH of the WebSphere Java compiler.

















http://www.globfx.com/support/swfchartgen/kb.php?id=0bd97e55-3f6f-4f1f-91db-c5222dccbcbf



16 Ocak 2014 Perşembe

Remove old kernels on RHEL v6.3

1. Keep at least two kernels for emegency cases to ensure your ass
2. Remove older kernels but consider step 1

you can remove kernels using rpm -e command








3. Install yum-utils package and apply
# package-cleanup --oldkernels --count=2  so that you can keep two  kernels.
























4. vi /etc/yum.conf and modify installonly_limit parameter to limit the number of installed kernels

15 Ocak 2014 Çarşamba

Update Kernel on RHEL v6.3



Download the latest rpms of kernel and kernel-firmware.
Don't use update option for kernel because if you encounter any problem during update process, you will not be able to have a chance to use former kernel. Therefore, to avoid such a problem, use install option. In this case , you can enable or disable one of the kernel installations using the grub.conf file.

1. rpm -ivh kernel-firmware-2.6.32-431.3.1.el6.noarch.rpm
2. rpm -ivh kernel-2.6.32-431.3.1.el6.x86_64.rpm
3. chech /etc/grub.conf
vi /etc/grub.conf
default=0 means first kernel from list is active
default=1 means second kernel from list is active
4. After you make the latest kernel active , you can reboot the system
5. init 6

6 Ocak 2014 Pazartesi

Delete files older than 3 days in Windows Server 2008 using PowerShell

1.Solution

#----- define parameters -----#

#----- get current date ----#
$Now = Get-Date
#----- define amount of days ----#
$Days = "3"
#----- define folder where files are located ----#
$TargetFolder = "C:\backup"
#----- define extension ----#
$Extension = "*.zip"
#----- define LastWriteTime parameter based on $Days ---#
$LastWrite = $Now.AddDays(-$Days)
#----- get files based on lastwrite filter and specified folder ---#
$Files = Get-Childitem $TargetFolder -Include $Extension -Recurse | Where {$_.LastWriteTime -le "$LastWrite"}
foreach ($File in $Files)
    {
    if ($File -ne $NULL)
        {
        write-host "Deleting File $File" -ForegroundColor "DarkRed"
        Remove-Item $File.FullName | out-null
        }
    else
        {
        Write-Host "No more files to delete!" -foregroundcolor "Green"
        }
    }

2. Solution

dir C:\backup -for -rec | ? {$_.LastWriteTime -le (Get-Date).AddDays(-3) -and !$_.PsIsContainer} | del -fo