Mischiefblog
I make apps for other people

Shell scripts that make my life easier

Posted by Chris Jones
On July 25th, 2012 at 15:53

Permalink | Trackback | Links In |

Comments Off on Shell scripts that make my life easier
Posted in General

Below, a series of shell scripts that make my life easier. Don’t expect any great revelations or virtuoso bash scripting.

paths.sh — included in ~/.bashrc with source ${HOME}/paths.sh

export M2_HOME=/opt/maven
export JAVA_HOME=/opt/java
export JDK_HOME=/opt/java
export ORACLE_HOME=${HOME}/oracle/product/11.1.0/client_1
export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
 
export PATH=$PATH:$M2_HOME/bin
export PATH=$JDK_HOME/bin:$PATH
export PATH=$ORACLE_HOME:$PATH
export PATH=${HOME}/bin:$PATH
export SQLPATH=.:${HOME}/oracle/scripts
 
alias mint='mvn install -U -DskipTests'
alias sqldeveloper='${HOME}/bin/sqldeveloper/sqldeveloper.sh'
alias eclipse='${HOME}/java/eclipse/eclipse'
alias idea='${HOME}/bin/idea.sh'

monitor.sh — for people running older versions of Ubuntu (< 12.04) and X who use dual screens
#!/bin/bash
sleep 2 && xrandr –output DVI-1 –auto –right-of DVI-0

jconsole — when you use different key stores in test and development environments, and you need to point Java to the other key store. This implementation depends on jmanage so YMMV. Protip: replace jconsole with jvisualvm for added joy.

#!/bin/sh

KEYSTORE=/opt/keys/jmanage-keystore.jks
TRUSTSTORE=/opt/keys/jmanage-truststore.jks
TRUSTSTORE_PASSWORD=s33kr1t
KEYSTORE_PASSWORD=s33krit
/opt/java/bin/jconsole -J-Djavax.net.ssl.keyStore=$KEYSTORE \
     -J-Djavax.net.ssl.keyStorePassword=$KEYSTORE_PASSWORD \
     -J-Djavax.net.ssl.trustStore=$TRUSTSTORE \
     -J-Djavax.net.ssl.trustStorePassword=$TRUSTSTORE_PASSWORD

windows.sh — your Windows box needs to be running RDP

#!/bin/sh
rdesktop -g 1600x1024 10.2.31.34

Comments are closed.