java – Download WAR from snapshot-repository and deploy to local JBoss using mvn – Stack Overflow

Ideally you would want to set up Jenkins to deploy to your testing server as part of your CI build.

Alternatively, if you want to manually run a script on the server you are deploying to, you could set up a specific pom.xml to perform this task. First setup the dependency plugin to download your war:

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-dependency-plugin</artifactId>

<version>2.3</version>

<executions>

<execution>

<phase>package</phase>

<goals>

<goal>copy</goal>

</goals>

<configuration>

<artifactItems>

<artifactItem>

<groupId>my-group</groupId>

<artifactId>my-web-archive</artifactId>

<version>my-vesion</version>

<type>war</type>

<destFileName>my-web-archive.war</destFileName>

</artifactItem>

</artifactItems>

<outputDirectory>${project.build.directory}</outputDirectory>

</configuration>

</execution>

</executions>

</plugin>

Substituting the group ID, artifact ID and version for the respective properties of your WAR file. Next configure the JBoss plugin to deploy the downloaded WAR:

<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>jboss-maven-plugin</artifactId>

<version>1.5.0</version>

<configuration>

<jbossHome>/opt/jboss-6</jbossHome>

<serverName>all</serverName>

<fileName>${project.build.directory}/my-web-archive.war</fileName>

</configuration>

</plugin>

You should then be able to download the artifact from your internal repository and deploy it in the locally running JBoss container with the following command:

mvn package jboss:hard-deploy

via java – Download WAR from snapshot-repository and deploy to local JBoss using mvn – Stack Overflow.

linux – Bash: Display each sub-directory size in a list format using 1 line command? – Super User

du -h –max-depth=1

Output

oliver@home:/usr$ sudo du -h --max-depth=1
24M ./include
20M ./sbin
228M ./local
4.0K ./src
520M ./lib
8.0K ./games
1.3G ./share
255M ./bin
2.4G .

Alternative

If –max-depth=1 is a bit too long for your taste, you can also try using:

du -h -s *

This uses -s (–summarize) and will only print the size of the folder itself by default. By passing all elements in the current working directory (*), it produces similar output as –max-depth=1 would:

Output

oliver@cloud:/usr$ sudo du -h -s *
255M bin
8.0K games
24M include
520M lib
0 lib64
228M local
20M sbin
1.3G share
4.0K src

The difference is subtle. The former approach will display the total size of the current working directory and the total size of all folders that are contained in it… but only up to a depth of 1.

The latter approach will calculate the total size of all passed items individually. Thus, it includes the symlink lib64 in the output, but excludes the hidden items (whose name start with a dot). It also lacks the total size for the current working directory, as that was not passed as an argument.

via linux – Bash: Display each sub-directory size in a list format using 1 line command? – Super User.

How to Find Out What’s Keeping Your Computer from Going to Sleep

So your computer is set to go to sleep after a half hour of inactivity, but the darn thing never actually goes to sleep. Want to figure out what’s keeping it awake? Here’s a quick command for Windows and OS X that’ll let you know.

A lot of things can keep your computer from going to sleep, like downloading a file, opening a file on the network, or even a disconnected printer with an open job. Luckily, both Windows and OS X have an easy method for finding out what the problem is.

For Windows: Go to Start > Programs > Accessories, right-click on Command Prompt, and open it as an administrator. Then type:

powercfg -requests

It’ll let you know if anything is keeping the computer awake. In the screenshot above, for example, it told me that I had a file open in PotPlayer that was preventing my computer from sleeping (since the file resided on the network).

For Mac: go to /Applications/Utilities, open up the Terminal, and type:

pmset -g assertions

It’ll tell you if a device is preventing sleep, and what process that is. Unfortunately, this one seems a little more finicky—some people are having problems where it only tells you that your computer’s being kept awake, but it doesn’t say by what. If you get stuck in that situation, check out Apple’s Help page on the subject. It lists a lot of common possibilities. Hit the link below to read more about each method.

via How to Find Out What’s Keeping Your Computer from Going to Sleep.

email – What is the difference between ports 465 and 587? – Stack Overflow

Ports 465 and 587 are intended for email client to email server communication (sending email).

Port 465 is for smtps – SSL encryption is started automatically before any SMTP level communication.

Port 587 is for msa – it is almost like standard SMTP port. SSL encryption may be started by STARTTLS command at SMTP level if server supports it and your ISP does not modify/filter server’s EHLO reply (reported 2014 Nov).

MSA should accept email after authentication (e.g. after SMTP AUTH). It helps to stop outgoing spam when netmasters of DUL ranges can block outgoing connections to SMTP port.

via email – What is the difference between ports 465 and 587? – Stack Overflow.