Jun 18, 2014

[git] how to change remote repository url

We have some development servers. We build source on the development on these servers. When I executed 'git fetch', git required another guy's password.

git fetch
#Password for 'https://another.guy@git.com':


Of course, I don't know his password. So I decided to change remote repository url. I got found the answer here.


git remote -v
#origin https://another.guy@git.com/scm/xxx.git (fetch)
#origin https://another.guy@git.com/scm/xxx.git (push)

git remote set-url origin https://git.com/scm/xxx.git

git remote -v
#origin https://git.com/scm/xxx.git (fetch)
#origin https://git.com/scm/xxx.git (push)

git fetch
#Username for 'https://git.com/': my.user
#Password for 'https://my.user@git.com':


---
git remote set-url origin https://git.com/scm/xxx.git
git remote -v
#origin https://git.com/scm/xxx.git (fetch)
#origin https://another.guy@git.com/scm/xxx.git (push)

git remote set-url --push origin https://git.com/scm/xxx.git
git remote -v
#origin https://git.com/scm/xxx.git (fetch)
#origin https://git.com/scm/xxx.git (push)

Jun 15, 2014

[git] how to remove remote tag

If you just started to use maven release plug in, you would get some problems with release plug in like failed on prepare due to not exist snapshot version, or failed on prepare because of existing tag. I would like to share how to remove git tag from remote.
It's easy. Just run the following commands. That's it!

git tag -d myapp-0.0.1
git push origin :refs/tags/myapp-0.0.1


Apr 29, 2014

[memo] How to add/delete jvm options for glassfish

I need to modify jvm options of glassfish(2.1). I asked Google and found the following URLs.
http://docs.oracle.com/cd/E19879-01/820-4332/create-jvm-options-1/index.html
http://docs.oracle.com/cd/E19879-01/820-4332/delete-jvm-options-1/index.html

Here is my example.


Current glassfish has NewRatio and SurvivorRatio. So I deleted them and add new options like below.
-XX:NewRatio=1
-XX:SurvivorRatio=4
-Xms1024m
-XX:CMSInitiatingOccupancyFraction=70

Apr 17, 2014

Feb 27, 2014

[memo] How to cut tcpdump file in Linux

# /usr/sbin/tcpslice -t my.tcp.dump
my.tcp.dump       114y02m27d10h20m28s861544u      114y02m27d10h20m37s097574u
# /usr/sbin/tcpslice -w sliced.my.tcp.dump 14y02m27d10h20m35s +10 my.tcp.dump

+10 means 10 seconds. So sliced.my.tcp.dump has tcp dump of 14-02-27 10:20:35 - 45

Feb 18, 2014

[memo] Delete files older than xxx days on Linux

find /opt/myapp/log/ -mtime +120 -type f -exec rm {} \;

http://www.howtogeek.com/howto/ubuntu/delete-files-older-than-x-days-on-linux/

Jan 7, 2014

Dec 24, 2013

[memo] Eclipse proxy configuration

Eclipse 4.2
Window -> Preferences -> search network
Set your Host and Post for HTTP and HTTPS. Do not set SOCKS

Nov 19, 2013

[memo] Maven release:perform DO NOT deploy

As you know web application is not supposed to be uploaded maven repository. I tried to not deploy on the release. Finall I found the answer here.
It took much time.

Nov 17, 2013

[memo] Print file names that contain word and exclude extension.

### command
find ${TARGET_DIR}/*.xml -type f | xargs grep -l ${SEARCH_WORD} | awk '{ num = split($0, array, "/"); print array[num];}' | awk '{ num = split($0, array, "."); print array[1];}'

Nov 15, 2013

Jenkins Git Plugin fails with NullPointerException

When I ran Jenkins job to build project, I got the following error message.


I found the answer from here.

1. Uninstall git client plugin
2. Restart, it would be automatically executed
3. Install git plugin, not git client. Git client is installed automatically too.
4. Confirm git is available and name it "default" on Manage Jenkins > Configure System

Enjoy!

Nov 14, 2013

[memo] this parser does not support specification null version null digester

java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:448)
at org.apache.commons.digester.Digester.getFactory(Digester.java:534)

Update your xercesImpl.jar!!! old xercesImpl.jar can not handle setXIncludeAware method.
2.9.1 helps you.

Thank you Coding in Color!!!


Jul 24, 2013

Continuous Delivery Using Jenkins

Let me introduce our Jenkins jobs. If Jenkins was not exist, we would suffer from HARD HARD build and deploy jobs.

First of all, we made our server list file. Because this is very often used by Jenkins deploy and restart jobs.
Add your Jenkins user key to my_name/.ssh/authorized_key on each server.
-Jenkins Server List Configure Job-


Next step, we build our project and make backup too.
-Jenkins Build Job-
Build our project by running maven.
  clean release:clean release:prepare package -P prd

And make backup directory.


And run deploy job. Don't forget set post-build Actions. We set Build other projects(Jenkins Restart Job)
-Jenkins Deploy Job-


-Jenkins Restart Job-


Sometimes we need to revert our service. We use this job. Don't forget to set Build other projects(Jenkins Deploy Job) that it will execute Jenkins Restart Job.
-Jenkins Roll Back Job-

Jul 22, 2013

[memo] jmagick 6.4.0 configure problem

I had to install jmagick 6.4.0. And I tried to install as the following.



Jmagick dose not care "--with-java-home=/opt/java/". It just uses "/usr/bin/java javac javah jar".
So you need to link them to /usr/bin

#ln -s /opt/java/bin/java /usr/bin/java


[memo] svc: warning: unable to control file does not exist.

I solved this problem here.

The key is the following command.
# svscanboot &