rblog

Online again

My blog is yet again up and running after about two days of downtime. The issue has been related to my ISP having moved my domain to another server. This caused http://hellem.org to reply with another ip than http://www.hellem.org. In addition the database server had been moved so I had to update the configuration files to the blog.

But, now back again!

Summarize disk usage of all files of a given type

Needed to know how much disk space all *.ear-files was consuming in a directory on one of our Linux-servers


find . -type f -name "*.ear" -exec ls -l {} \; | awk '{print $5}' > sum.txt
awk '{ sum += $1 } END { print sum }' sum.txt 

Then I used Google to make the number human readable, https://www.google.no/search?q=9606676582+bytes+to+gb

X11 Forwarding and su/sudo

Ever been in the situation where you log on to a server as one user having X11 enabled, but then need to sudo to another one – and voila, your X11-sesison is long gone…

Solution provided here http://brandonhutchinson.com/wiki/X11_Forwarding_and_su/sudo

I did as root


cd ~
mv .Xauthority .Xauthority_old
ln -s ~diagnostics/.Xauthorithy .Xautorithy


and it all worked fine.

Norwegian date format for JIRA

Navigate to Administration -> General Configuration -> Advanced


jira.date.picker.java.format	        dd.MM.yy		
jira.date.picker.javascript.format	%d.%m.%y		
jira.date.time.picker.java.format	dd.MM.yy h:mm a		
jira.date.time.picker.javascript.format	%d.%m.%y %l:%M %p

Firewall verification using a script

Needed to verify a lot of ports that should be opened making it possible to connect to three hosts. Had to do some surfing, and as always by the help of Google I managed to create a bash-script solving the issue for me.


#!/bin/bash
 
###### Set variables ########
# IP of WAS-server 4,5,6
PREIP=10.10.31.
POSTIP="4;5;6"
# Use Notepad++ and see http://ccapeng.blogspot.no/2008/06/notepad-replace-pattern-with-line-break.html to create the below listings
CSIV2_SSL="10113;10036;10046;10056;10066;10076;10086;10096"
ORB_LISTENER="10014;10024;10034;10044;10054;10064;10074"
BOOTSTRAP="10111;10032;10042;10052;10062;10072;10082"
 
###### DO THE MAGIC ######
echo "Testing from `hostname`"
echo "***********************"
# Use of IFS, see http://stackoverflow.com/questions/918886/split-string-based-on-delimiter-in-bash
OIFS=$IFS
IFS=';' read -ra IPARR <<< "$POSTIP"
for ip  in "${IPARR[@]}";
do
    MACHINE=$PREIP$ip
    echo ""
    echo "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤"
    echo "Testing connectivity against ip $MACHINE"
    echo "¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤"
    echo ""
    echo "Checking CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS"
    IFS=';' read -ra CSIV2ARR <<< "$CSIV2_SSL"
    for port in "${CSIV2ARR[@]}";
    do
        # Ignore errors, instead print below
        exec 3>/dev/tcp/${MACHINE}/$port 2>/dev/null
        if [ $? -eq 1 ]
        then
            #Only report errors, ret.value = 1 (success = 0)
                echo "Telnet connections not possible on port $port"
        fi
    done
    
    #...as above, for the rest of the ports needed to be checked, 
    #...copy the above statements and change the source variable.
    #...a bit dirty, but hey, solving a one time issue...who cares :-)

done
# Set IFS back to old value
IFS=$OIFS

Handy SQL

Created this SQL-statement used for one of our JIRA-instances. Needed to get rid of a lot of open sub-tasks where the parent task had been cancelled. The statement also shows usage of inner join and self-join.

 U PDATE jiraissue ji1, jiraissue ji2
INNER JOIN issuelink il
SET ji1.resolution = 9, ji1.issuestatus = 6
WHERE ji1.resolution  IS NULL
AND ji1.id = il.destination
AND ji1.issuestatus = 1
AND il.source = ji2.id
AND ji2.resolution = 9;

48 hours of downtime

My blog has been unavailable for more than 48 hours due to the host server having had some DNS-issues. A call to my hosting company http://www.onnet.no/ and voila, fixed in a few minutes.

Install IBM Universial Test Client on WAS

With Rational Application Developer installed you will find the needed file at
<RAD_INSTALLATION_FOLDER\plugins\com.ibm.ws.ast.st.utc_*
where the star indicates the version of UTC. There you will then find the IBMUTC.ear file which you then can install on your instance of WebSphere Application Server (or Tomcat or whatever application server).

Application will then be available at http://yourhost:yourport/UTC/

Hjem