Category: Work/Geek
Online again
September 4th, 2012My 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
August 28th, 2012Needed to know how much disk space all *.ear-files was consuming in a directory on one of our Linux-servers
Code:
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
FB - 500 server error
August 8th, 2012X11 Forwarding and su/sudo
July 10th, 2012Ever 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
Code:
cd ~ | |
mv .Xauthority .Xauthority_old | |
ln -s ~diagnostics/.Xauthorithy .Xautorithy |
and it all worked fine.
Norwegian date format for JIRA
July 2nd, 2012Navigate to Administration -> General Configuration -> Advanced
Code:
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
June 22nd, 2012Needed 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.
Code:
#!/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 |
WebSphere: Containment paths, configuration IDs and object names
June 18th, 2012...the difference between containment paths, configuration IDs and object names in WebSphere?s scripting interface wsadmin...
All very well explained in this blog post blog.xebia.com/../websphere-scripting-with-wsadmin-containment-paths-configuration-ids-and-object-names
Handy SQL
May 14th, 2012Created 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.
Code:
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
April 30th, 2012My 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
April 23rd, 2012With 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/
