Digital Sanctum

software development, technology and other square topics

Archive for June, 2008

How to Determine if a Linux machine has a 32 bit or 64 bit kernel

without comments

Based on the output from the following command you can easily determine if a Linux machine has 32 bit or 64 bit kernel:

uname -a

If you see something like x86_64, then your running with a 64 bit kernel. If you use see i386/i486/i586/i686 it’s a 32 bit kernel.

Written by Shane

June 23rd, 2008 at 8:39 pm

Posted in Linux

Stupid Windows Tricks from the command line

without comments

Change the Log on credentials for a windows service:

sc.exe config "YourServiceName" obj= "yourusername" password= "yourpassword"

Bring up services:

services.msc

Copy a directory structure:

xcopy G:\foo\*.* D:\bin\bar /E /D /Y

Copy a directory structure and exclude one or more files/directories:

xcopy \\nyceqasp8081\apps\polyent\*.* D:\apps\bar\ /E /D /Y /EXCLUDE:excludefile.txt

where excludefile.txt is a file containing one or more path exclusions for example D:\apps\bar\logs

Set environment variables:

setx JAVA_HOME "D:\bin\Java\jdk1.5.0_12" /m

The /m here denotes the variable should be a system wide variable. Leaving /m off will add the variable to the current user’s environment instead.

Map a drive and make it persistent (after reboots):

net use G: \\foo.bar.com\spg /P:Yes

Note: These have been tested and known to work on Windows Server 2003. Your mileage may vary on other variants of Windows.

Written by Shane

June 13th, 2008 at 9:20 pm

Silent Install of JDK and JRE

without comments

This week I had a requirement for scripting the installation of the Java 5 JDK and JRE. These instructions require separate install files for the JDK and JRE but will get the job done.

For the JDK, you can place the following in a *.bat file and simply run it from command line:

@echo off
echo Installing JDK…
start /w C:\temp\jdk-1_5_0_12-windows-i586-p.exe /s /v”/qn INSTALLDIR=d:\bin\Java\jdk1.5.0_12 REBOOT=Suppress”

For the JRE:

@echo off
echo Installing JRE…
start /w C:\temp\jre-1_5_0_12-windows-i586-p.exe /s INSTALLDIR=d:\bin\Java\jre1.5.0_12 REBOOT=Suppress

Some related links:

  1. http://java.sun.com/j2se/1.5.0/sdksilent.html
  2. http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/silent.html

Written by Shane

June 13th, 2008 at 6:31 pm

How to migrate a Subversion repository in 4 steps

without comments

  1. sudo svnadmin dump /path/to/svn-repository > svn-repository.dmp
  2. gzip svn-repository.dmp
  3. move svn-repository.dmp.gz to your new server
  4. log in to your new server, then sudo svnadmin load svn-repository

Written by Shane

June 10th, 2008 at 10:13 pm