Wednesday, April 16, 2014

Maven Legacy Dependancies

Have your jar file handy and do the below as your convenient
dependency>
    groupid>com.company.jar

artifactid>legasyJar
    version>3.0
    scope>system
    systempath>${basedir}/lib/legasyJar.jar
    optional>true

or else first install the jar in local repository using the below maven command
mvn install:install-file -Dfile=legasyJar.jar -DgroupId=com.microsoft.sqlserver 
-DartifactId=legasyJar -Dversion=3.0 -Dpackaging=jar
Then add it to your project as dependancy
dependency>
  groupid>com.company.jar
artifactid>legasyJar
  version>3.0

Thursday, August 22, 2013

Groovy Maven Plugin

    <build>
        <plugins>
            <plugin>
                <groupid>org.codehaus.gmaven</groupid>
                <artifactid>gmaven-plugin</artifactid>
                <version>1.4</version>
                <configuration>
                    <providerselection>2.0</providerselection>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generateStubs</goal>
                            <goal>compile</goal>
                            <goal>generateTestStubs</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Friday, May 17, 2013

Grails-2.1.3 Criteria Sorting

Grails Criteria Sorting

DESC all Caps is not working in Grails-2.1.3 Criteria


import com.company.User

User.withCriteria{
  eq ('username', 'dev')
  order('username', 'DESC') //use Lower case instead
}.each{println it.name}

println "========================================================="
String hql = """
FROM User as u
WHERE u.username =:name
ORDER BY d.username DESC
"""
def list = User.executeQuery(hql, [name: 'dev'])

list.each{
 println  it.name
}

Friday, April 5, 2013

Ubuntu Task Manager

apt-get install htop


sudo apt-get install mailutils

 htop -b -n1 | mail -s 'Process snapshot' psramkumar@gmail.com

Wednesday, March 27, 2013

Setup Email Server in Ubuntu


  • Install ssmtp Install ssmtpsudo apt-get install ssmtp
    Install mail Util sudo apt-get install mailutils
  • Edit the ssmtp config file : gksu gedit /etc/ssmtp/ssmtp.conf
  • Enter this in the file:
    root=username@gmail.com
    mailhub=smtp.gmail.com:465
    rewriteDomain=gmail.com
    AuthUser=username
    AuthPass=password
    FromLineOverride=YES
    UseTLS=YES
  • Enter the email address of the person who will receive your email:
    ssmtp recepient_name@gmail.com
  • Now enter this:
    To: recipient_name@gmail.com
    From: username@gmail.com
    Subject: Sent from a terminal!

    Your content goes here. Lorem ipsum dolor sit amet, consectetur adipisicing.
  • To send the emailCtrl + D

You can also save the text mentioned in Point 5 into a text file and send it using:
ssmtp recipient_name@gmail.com < filename.txt
"mater" | mail -s 'Process snapshot' psramkumar@gmail.com

Start synergy on boot in Ubuntu?


For newer version of Ubuntu that use lightdm.
I have successfully done the following for running the synergy client for the login screen, andafter I login. It is much simpler than the other answers, IMHO.
edit /etc/lightdm/lightdm.conf as root.
sudo vi /etc/lightdm/lightdm.conf
add the following line to the bottom of the file.
greeter-setup-script=/usr/bin/synergyc 
restart lightdm. (it is better to do this from a terminal or ssh session)
sudo /etc/init.d/lightdm restart
it works good in 12.10 for me