- In Jenkins, Nodes > xxx > Monitoring > View Threads to find those threads which naming *svnkit*, kill them.
- Nodes > xxx > Monitoring > Execute the garbage collector
- Clean the workspace of related job
星期五, 9月 20, 2019
How to resolve "org.tmatesoft.svn.core.SVNException: svn: E175002: SSL peer shut down incorrectly"?
星期一, 9月 09, 2019
Linux nologin and recovery
- checkout someone's shell
- awk -F: '{print $7}' /etc/passwd
- change someone (root) to nologin
- sudo usermod -s `which nologin` root
- recovery
- sudo usermod -s /bin/bash root
星期五, 7月 26, 2019
SonarQube scan failed when .ts included
In a Jenkins job which invoke SonarQube, it failed with:
ERROR: throw err; ERROR: ^ ERROR: ERROR: Error: Cannot find module 'typescript'How to resolve this? Before SonarQube scanning, we need:
- npm install typescript
星期四, 6月 20, 2019
Elmah bootstrapper
After .NET Framework 4.x, include Elmah just need:
Then you can check error by visit http://<YourWebAP>/elmah from any remote
- *.csproj
- ...
- </ItemGroup>
- <ItemGroup>
- <PackageReference Include="elmah.bootstrapper" Version="1.0.1" />
- </ItemGroup>
- ...
- Elmah.Athz.config
- ?
Then you can check error by visit http://<YourWebAP>/elmah from any remote
SonarQube method-level complexity
After SonarQube 6.7, file-level complexity still calculated, but method-level complexity gone. The opinion of SonarQube team is Complexity is displayed as a Code Smell. If you still wish to investigate the complexity of your project in method-level, combine those filter:
- Type: Code Smell
- Severity: Critical
- Tag: brain-overload
星期五, 5月 17, 2019
Update old OpenSSH default DH key size
For Windows 2000, setupssh371-20031015.exe sholud be a good choice for SSH Server / Client. But when connecting to Jenkins as a SSH Publisher, Jenkins complained that DH key size 2047 not valid. How to fix it? Generate by yourself:
- cd "C:\Program Files\OpenSSH\bin"
- ssh-keygen -G moduli-2048.candidates -b 2048
- (wait)
- ssh-keygen -T moduli-2048 -f moduli-2048.candidates
- (wait)
- move moduli-2048 ..\etc\moduli
- del moduli-2048.candidate
星期二, 5月 14, 2019
New Selenium Node (Chrome / Firefox) on CentOS without GUI
- Assume Selenium Hub listen on docker host 172.17.0.1:4444
- docker (refer this)
- docker-compose (refer this)
- docker-compose.yml (updated from here)
- version: "3"
- services:
- chrome:
- image: selenium/node-chrome:3.141.59-neon
- volumes:
- - /dev/shm:/dev/shm
- environment:
- - HUB_HOST=172.17.0.1
- - HUB_PORT=4444
- - REMOTE_HOST=http://<Host_or_IP>:6666
- - NODE_MAX_INSTANCES=5
- ports:
- - "6666:5555"
- firefox:
- image: selenium/node-firefox:3.141.59-neon
- volumes:
- - /dev/shm:/dev/shm
- environment:
- - HUB_HOST=172.17.0.1
- - HUB_PORT=4444
- - REMOTE_HOST=http://<Host_or_IP>:7777
- - NODE_MAX_INSTANCES=5
- ports:
- - "7777:5555"
星期三, 4月 24, 2019
Quick Start: Selenium Grid
How can we create a Selenium Grid Environment quickly? If you have docker-compose already, just refer this, save as docker-compose.yml, and run "docker-compose up -d" to start it. That's all.
How to prove it worked? we need:
How to prove it worked? we need:
- selenese-runner.jar download from here
- check your docker host ip address like "ip addr | grep docker0"
- any workable side file
- docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp openjdk java -jar selenese-runner.jar --driver remote --remote-url http://<DOCKER_HOST_IP>:4444/wd/hub --remote-browser <BROWSER> <WORKABLE.side>
星期二, 4月 16, 2019
CentOS7, Firewalld and Docker
In the past, I always stop firewalld for Docker. But it's not secured. According to this, if we update firewalld version to 0.4.3.2-9 can fix this, or running these command:
- nmcli connection modify docker0 connection.zone trusted
- systemctl stop NetworkManager.service
- firewall-cmd --permanent --zone=trusted --change-interface=docker0
- systemctl start NetworkManager.service
- nmcli connection modify docker0 connection.zone trusted
- systemctl restart docker.service
星期四, 4月 11, 2019
Jenkins fake warning about Subversion
If a Jenkins job correspond to Subversion, when checking config, maybe you will see this warning:
- Unable to access the repository
- SEVERE hudson.scm.SubversionSCM$ModuleLocation$DescriptorImpl checkCredentialsId
- svn: E200015: Authentication cancelled
星期五, 3月 29, 2019
selenese runner can't nesting while end loop
Consider this code snippet:
- execute script | return 2; | i
- while | ${i} > 0 |
- execute script | return 3; | j
- while | ${j} > 0 |
- echo | i: ${i}, j: ${j} |
- execute script | return ${j} - 1; | j
- end | |
- execute script | return ${i} - 1; | i
- end | |
- i: 2, j: 3
- i: 2, j: 2
- i: 2, j: 1
- i: 1, j: 3
- i: 1, j: 2
- i: 1, j: 1
- i: 2, j: 3
- i: 2, j: 2
- i: 2, j: 1
- i: 1, j: 3
- execute script | return 2; | i
- do | |
- execute script | return 3; | j
- do | |
- echo | i: ${i}, j: ${j} |
- execute script | return ${j} - 1; | j
- repeat if | ${j} > 0 |
- execute script | return ${i} - 1; | i
- repeat if | ${i} > 0 |
[2019/03/30]
This bug was fixed at version 3.22.0, see here.
星期三, 2月 13, 2019
星期二, 1月 29, 2019
Build WebGoat in a temporary Docker Container
- git clone https://github.com/WebGoat/WebGoat
- cd WebGoat
- docker run -it --rm --name mymaven -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3-jdk-11 mvn clean install
星期六, 1月 19, 2019
星期五, 1月 11, 2019
Docker & Docker Compose on CentOS
- Docker
- sudo yum install yum-utils
- sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
- sudo yum install docker-ce
- sudo systemctl start docker
- (optional) sudo systemctl enable docker
- sudo usermod -aG docker `whoami`
- (logout, then login again)
- (optional) docker ps
- Docker Compose
- (docker installed)
- (check latest version of Docker Compose from here, ex: 1.23.2)
- sudo curl -L “https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- (optional) docker-compose --version
星期二, 1月 01, 2019
Java Restful WebServices
為了想在最少的準備之下開發 Java Restful WebServices,研究了以下的做法:
- 參考這篇與這篇所述,在 Docker 已安裝的前提下,藉由 Maven webapp plugin,不依賴任何 IDE,建立專案的目錄結構。需要在一個空的目錄下這命令(請自行替換適合的 groupId):
docker run -it --rm -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=com.acme -DartifactId=my-webapp - 將這群目錄、檔案的擁有權取回:
sudo chown -R `whoami`. my-webapp - 進入 my-webapp 子目錄,補上 src/main/java/com/acme/TestService.java,內容可參考這篇(如果用複製的話,要注意雙引號可能需要替換)。
- 續上,增加 servlet 與 servlet-mapping 補足 src/main/webapp/WEB-INF/web.xml 的內容,尤其要注意 param-value 與程式中所述的套件、所在路徑一致。
- 續上,增加三個 dependency 補足 pom.xml 的內容。若在意未來的路徑名稱,也可以增設 build/finalName。
- 再用 Maven 於 target 目錄產出 war 檔:
docker run -it --rm -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven mvn package
- 將 Tomcat 預設埠 8080 8443 都對應好:
docker run -d --name tomcat -p 8080:8080 -p 8443:8443 tomcat - 先確認瀏覽器訪問 8080 沒問題,再設法讓 Manager App 開起來,首先是修改 /usr/local/tomcat/conf/tomcat-users.xml 增加 manager-gui 角色的帳密;若要遠端訪問還有 /usr/local/tomcat/webapps/manager/META-INF/context.xml 要放寬 RemoteAddrValve。
- 登入 Manager App 之後,部署 war 上去,不論 http://localhost:8080/my-webapp 或 http://localhost:8080/my-webapp/rest/testservice 都應能得到正確內容。
- 準備 https 憑證與金鑰檔,放到 Docker Container 內,並參考這篇的說明修改 /usr/local/tomcat/conf/server.xml,對應的必要屬性至少有 certificateFile、certificateKeyFile 兩個,就可改由 https 8443 訪問取得結果。
訂閱:
文章 (Atom)