加瓦的境界
jXee · 共 88 篇文章
how to proxy to k8s web console
### how to access k8s web console if it's still available Run the proxy: $ cd /c/tools/env-prod $ ls -l -rwxr-xr-x 1 John.Wang 1049089 85 May 14 14:45 prod.listAllPods.sh* -rw-r--r-- 1 John.Wang 1049089 6146 Oct 4 2017 prod_cluster_config $ kubectl --kubeconfig=prod_cluster_config --namespace=env-p…
2018-06-28T07:16:35Z · 开源软件 · 评论(0)
Call Stored Procedure with JPA 2.1
JPA 2.1 introduces APIs to call Stored Procedure. It has similar programming pattern as executing a common CRUD sql statement. @NamedStoredProcedureQuery: defines details of the stored proc to call @StoredProcedureParameter: defines IN/OUT parameters of the stored proc StoredProcedureQuery: Interfa…
2018-06-27T10:57:48Z · 编程语言 · 评论(0)
Postgresql vacuum analyze
There is no VACUUM statement in the SQL standard. Postgresql has command VACUUM to cleanup dead tuples in database tables. After deletion, a record still stays in the table, VACUUM makes sure the space is reclaimed and made available for re-use. Option ANALYZE would "Updates statistics used by the …
2018-05-15T10:07:53Z · 数据库 · 评论(0)
Send response and then process - async processing
If your request processing takes long time to run, client might be timed out before processing completed. One solution is to send back the response (method returns) and then process the request in a different thread. /* * This is the normal sync processing. Client might be timed out if * processing…
2017-10-12T09:35:57Z · 编程语言 · 评论(0)
java 8 time api test
public class ParseUtcDateTimeStringTest { @Test public void testUtcStringToDate() { // "Z" at the end of the date time string is for UTC String utcDateStr = "2017-08-28T02:03:41.080Z"; System.out.println("====== testUtcStringToDate: " + utcDateStr); // Parse the utc datetime string to java.time.Ins…
2017-08-29T05:40:34Z · 编程语言 · 评论(0)
Setup ApiKey in header with Swagger generated client code
@Value("${api.base.path}") private String basePath; @Value("${api.apikey.name}") private String apiKeyName; @Value("${api.apikey.value}") private String apiKeyValue; public Vehicle getVehicleBySwaggerClient(String vehicleId) { ApiClient api = new ApiClient(); api.setBasePath(basePath); // setup api…
2017-08-23T06:41:35Z · 编程语言 · 评论(0)
mapdata/ci/scripts/mapDownload.sh
#!/bin/bash ###################################################################### # Download map data files from xxx Maps website: # 1. download the fileDownloadable.xml which contains downloading info # 2. parse fileDownloadable.xml to get the filenames, urls and md5sum # 3. carry out the file do…
2017-06-02T12:17:09Z · 编程语言 · 评论(0)
Structure of project with Concourse CI included
mapdata | |- src |- ci |- scripts | |- mapDownload.sh |- tasks | |- downloadFiles.yml | |- pipeline.yml
2017-06-02T12:15:12Z · 编程语言 · 评论(0)
Externalize Application Config properties with JBoss 7.1
If you have configuration properties that need to be changed dynamically without restarting application server, you need to externalize the properties file in a folder and add this folder to the application servers class path. The second thing you need to do is to use a configuration util to period…
2017-06-02T12:09:40Z · 开源软件 · 评论(0)
mapdata/ci/tasks/downloadFiles.yml
platform: linux image_resource: type: docker-image source: {repository: ubuntu} inputs: - name: mapdata - name: version outputs: - name: mapload run: path: bash args: ["mapdata/ci/scripts/mapDownload.sh"]
2017-06-02T12:03:28Z · 编程语言 · 评论(0)
My first Concourse CI script - mapdata/ci/pipeline.yml
resource_types: - name: aws-cloudformation-stack type: docker-image source: repository: xxx/aws-cloudformation-stack-resource tag: latest resources: - name: mapdata type: git check_every: 10s source: uri: https://github.com/xxx/mapdata.git branch: master username: {{github-username}} password: {{gi…
2017-06-02T11:59:45Z · 编程语言 · 评论(0)
Simple tool to monitor jvm memory usage and garbage collection
JDK has built-in tool to monitor jvm memory usage: jstat This is a command line tool, which runs like: $ jstat -gc 17707 5000 where, -gc is the option, 17707 is process ID of the jvm process, 5000 is output frequency: every 5 seconds. Following is example output: $ jstat -gc 17707 5000 S0C S1C S0U …
2016-10-13T06:06:12Z · 操作系统 · 评论(0)
正确理解 output of linux command free
linux command free is used to show the RAM usage of the system. Below is an example output of the command: $ free -m total used free shared buffers cached Mem: 2000 1921 78 0 6 34 -/+ buffers/cache: 1881 119 Swap: 0 0 0 The "-m" switch outputs in megabyte. So the system: has total RAM of 2G. Used 1…
2016-10-04T08:46:34Z · 操作系统 · 评论(0)
为什么说软件编程是一碗青春饭?
常听人说,软件编程是碗青春饭,现在倒是信了。 主要原因是这个行业需要不断学习,知识与技能更新要求比较高,比较频繁。 在一两轮更新之后,老的开发人员要么走上了管理岗位,要么就失去了工作的热情。 本人是属于后者,对软件开发的热情逐渐燃尽了。为什么?因为我发现,这些所谓的技能更新,并没有革命性的意义,不过是根据个人喜好重新造轮子而已。 譬如现在流行的 RESTful,十几年前已经搞过了。只不过现在是旧瓶新酒,增加了几个annotation而已。这帮人SOA 已经搞腻歪了,于是要搞小型化的,美其名为“微服务”,可以scale horizontally。。。一堆理论,呵呵。 容器太麻烦了,只要个web…
2015-07-23T07:21:01Z · 非技术 · 评论(0)
unit test 是软件开发业界的强迫症
Unit tests helped me find bugs about 3 times in my whole career. --what a waste of time ... and energy, especially when you think about "continuous integration" and the bullshit unit tests get run again and again every day, every hour, every minute... What a waste of electricity! Easy mock, mockito…
2015-06-11T12:59:47Z · 非技术 · 评论(0)