Monday, January 31, 2011

How to change Linux system date/time ?

Only root can change the system time.
To set the time in the software clock (Linux's idea of what time it is), you need the `date' program. At some point, you will probably want the hardware clock to be updated. The program for this is called `hwclock'. Keeping the hardware clock updated will result in the time being correct even after a power cycle.
You may want to mess around with the command-line switches you see in the man pages to get the software clock right, and then run `hwclock --systohc' to save this time to the hardware clock.

Wednesday, January 19, 2011

Automate GUI-based applications with script



References:
http://sikuli.org/

file:///D:/Magazine/Archive/2010/114/033-035_sikuli/article.html

Tuesday, January 18, 2011

Gradle tips

// File: build.gradle
usePlugin 'java'
defaultTasks 'clean', 'build' // Run tasks clean and build if no task is specified.

Reference: http://mrhaki.blogspot.com/2009/11/gradle-goodness-setting-default-tasks.html

Cloning a Virtual Machine in VirtualBox


> cd E:\VM\VBOX\
> set path=%path%;C:\Program files\Oracle\VirtualBox
> vboxmanage clonehd MYXP.vdi MYXP_2.vdi


Reference: http://umairj.com/191/cloning-a-virtual-machine-in-virtualbox/#


Monday, January 17, 2011

Linux password history

pam_cracklib is capable of consulting a user's password "history" and not allowing them to re-use old passwords. However, the functionality for actually storing the user's old passwords is enabled via the pam_unix module.

The first step is to make sure to create an empty /etc/security/opasswd file for storing old user passwords. If you forget to do this before enabling the history feature in the PAM configuration file, then all user password updates will fail because the pam_unix module will constantly be returning errors from the password history code due to the file being missing.

Treat your opasswd file like your /etc/shadow file because it will end up containing user password hashes (albeit for old user passwords that are no longer in use):

touch /etc/security/opasswd
chown root:root /etc/security/opasswd
chmod 600 /etc/security/opasswd



Reference: http://www.deer-run.com/~hal/sysadmin/pam_cracklib.html

Friday, January 7, 2011

Wednesday, January 5, 2011

How to build mrm.jar using Gradle


apply plugin: 'java'
apply plugin: 'idea'

sourceCompatibility = 1.5
// version = '1.0'
jar.baseName = 'mrm'
gems_common_lib='../apps/build/ext/components/bndl_gems/build/gems_common/build/libs'

buildDate = new Date()
changes = 'Removed the usage of gems_common'

defaultTasks 'clean', 'build'

sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'src/resources'
}
}
}

repositories {
mavenCentral()
}

dependencies {
compile files("${gems_common_lib}/gems_common.jar")
testCompile group: 'junit', name: 'junit', version: '4.+'
}

jar {
manifest {
attributes 'Manifest-Version': 1.0,
'Created-By': 'David Chang',
'Created-Date': buildDate,
'Change-Log': changes
}
}

How to build QuickBinder using Gradle



// build.gradle
apply plugin: 'java'
apply plugin: 'idea'

sourceCompatibility = 1.5
// version = '1.0'
jar.baseName = 'QuickBinder-ss'

// QuickBinder variables
qbVersion = 1.1
qbBuildDate = new Date()
qbChanges = 'Removed splash screen'

defaultTasks 'clean', 'build'

repositories {
mavenCentral()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
}

jar {
manifest {
attributes 'Manifest-Version': 1.0,
'Created-By': 'David Chang',
'Created-Date': qbBuildDate,
'QuickBinder-Version': qbVersion,
'QuickBinder-Change-Log': qbChanges,
'Main-Class': 'com.rci.edge.quickbinder.impl.QuickBinder'
}

from sourceSets.main.classes
exclude('com/rci/edge/quickbinder/logger/QuickSplashscreen*')
}