原创 Intellij IDEA配置Maven 使用本地Nexus

  打開Intellij,點擊左上角從下來菜單裏進入Preferences。配置maven地址     上圖中settings.xml配置如下: <?xml version="1.0" encoding="UTF-8"?> <sett

原创 Keycloak 導入多個領域文件 import multiple realms

官方文檔 https://www.keycloak.org/docs/7.0/server_admin/#admin-console-export-import If more than one realm file needs to b

原创 mac 安裝 配置 maven

  下載的網址https://maven.apache.org/download.cgi   $ curl -O https://www-eu.apache.org/dist/maven/maven-3/3.6.2/binaries/ap

原创 rails hirefire-resource gem

  https://help.hirefire.io/article/54-job-queue-ruby-rack https://github.com/hirefire/hirefire-resource   This library

原创 Rails Rspec 單元測試 驗證接口 返回格式 所有字段

如何在單元測試中測試接口返回的字段? 如果我們有一個api的entity爲 employment.rb # frozen_string_literal: true module API::Entities::BorrowerEnti

原创 mac安裝 jupyter notebook

  https://jupyter.org/install.html  安裝:pip install jupyterlab 啓動: jupyter notebook 如果想用來測試http請求,需要安裝requests pip insta

原创 OpenSSL Cipher 加密解密 Ruby on Rails

最近在做OpenSSL::Cipher.new的優化: application_controller.rb def decrypter(data) key = ENV['ENCRYPTION_KEY'] iv = E

原创 如何用serverless創建aws-lambda

  https://serverless.com/framework/docs/providers/aws/guide/quick-start/ 安裝serverless $npm install -g serverless $mkdir

原创 python操作postgreSQL數據庫

Recommended solution: https://docs.aws.amazon.com/lambda/latest/dg/vpc-rds.html Coded a python script (as attached) for

原创 grafana設置 cloudwatch 監控 aws efs

  Using AWS CloudWatch in Grafana https://grafana.com/docs/features/datasources/cloudwatch/ http://IP:3000/datasources 

原创 安裝Prometheus和Grafana

(一) 安裝prometheus install $ wget https://github.com/prometheus/prometheus/releases/download/v2.4.3/prometheus-2.4.3.linu

原创 java導出csv

在java中如何導出csv文件   public void doGet(HttpServletRequest request, HttpServletResponse response) { response.setConten

原创 一致性哈希原理及應用淺析

背景現實場景單個節點的容量達到上限,無法繼續單點增加內存,如何解決?單個節點支撐的QPS達到上限,如何解決?初步方案   增加N個緩存節點,爲了保證緩存數據的均勻,一般情況會採用對key值hash,然後取模的方式,然後根據結果,確認數據落

原创 java阻塞隊列

JDK7提供了7個阻塞隊列。分別是ArrayBlockingQueue :一個由數組結構組成的有界阻塞隊列。LinkedBlockingQueue :一個由鏈表結構組成的有界阻塞隊列。PriorityBlockingQueue :一個支持

原创 memcached內存分類機制

內存分配機制mc內存分配機制簡介memcached默認情況下采用了名爲Slab Allocator的機制分配、管理內存,Slab Allocator的基本原理是按照預先規定的大小,將分配的內存分割成特定長度的塊,以完全解決內存碎片問題。先