Kubernetes

From Monolith to Microservices The Legacy Monolith: In time, the new features and improvements added to code complexity, making development more challenging - loading, compiling, and building times increase with every new update. A monolith has a rather expensive taste in hardware. Since the entire monolith application runs as a single process, the scaling of individual features of the monolith is almost impossible. During upgrades, patches or migrations of the monolith application downtime is inevitable and maintenance windows have to be planned well in advance as disruptions in service are expected to impact clients.

standard-library

Built-in Functions 1 append(s S, x ...E) S // core type of S is []E 1 2 3 s0 := []int{0, 0} s1 := append(s0, 3, 5, 7) // append multiple elements s2 is []int{0, 0, 3, 5, 7} s2 := append(s1, s0...) // append a slice s3 is []int{0, 0, 3, 5, 7, 0, 0} 1 2 copy(dst, src []T) int copy(dst []byte, src string) int 1 2 3 4 5 6 var a = [.

PowerShell

Duplicate the tab and keep the same working directory edit the following profile: 1 $Home\Documents\WindowsPowerShell\profile.ps1 1 2 3 4 5 6 7 8 9 function prompt { $loc = $executionContext.SessionState.Path.CurrentLocation; $out = "PS $loc$('>' * ($nestedPromptLevel + 1)) "; if ($loc.Provider.Name -eq "FileSystem") { $out += "$([char]27)]9;9;`"$($loc.ProviderPath)`"$([char]27)\" } return $out } Use alias to change location edit the following profile: 1 $Home\Documents\WindowsPowerShell\profile.ps1 1 2 3 4 5 Function CDBlogPost {Set-Location -Path D:\documents\personal\blog\content\post} Function CDCodePersonal {Set-Location -Path D:\code\personal} Set-Alias -Name blogpost -Value CDBlogPost Set-Alias -Name code.

Elasticsearch Tutorial

Getting Started Installing and Running Elasticsearch Install Elasticsearch 1 sudo pacman -S elasticsearch 1 systemctl start elasticsearch.service 1 curl http://127.0.0.1:9200 Install Kibana 1 sudo pacman -S kibana 1 sudo vim /etc/kibana/kibana.yml 1 2 3 server.port: 5601 server.host: "localhost" elasticsearch.hosts: ["http://localhost:9200"] 1 systemctl start kibana.service To launch the Kibana web interface, point your browser to port 5601. For example, http://127.0.0.1:5601. Installing Sense Sense is a Kibana app that provides an interactive console for submitting requests to Elasticsearch directly from your browser.

elk stack

Install Elasticsearch 1 sudo pacman -S elasticsearch 1 systemctl start elasticsearch.service 1 curl http://127.0.0.1:9200 Install Kibana 1 sudo pacman -S kibana 1 sudo vim /etc/kibana/kibana.yml 1 2 3 server.port: 5601 server.host: "localhost" elasticsearch.hosts: ["http://localhost:9200"] 1 systemctl start kibana.service To launch the Kibana web interface, point your browser to port 5601. For example, http://127.0.0.1:5601. Install Beats Install Filebeat Install Metricbeat 1 sudo pacman -S metricbeat 1 sudo vim /etc/metricbeat/metricbeat.yml 1 setup.dashboards.enabled: true From the Metricbeat install directory, enable the system module

Awesome Open Source Applications

Python Internet ArchiveBox - (Repo, Home, Docs) Self-hosted web archive, for creating local, browsable backups of content from the web. Imports HTML, JS, PDFs, video, subtitles, git repositories, and more, from Pocket, Pinboard, browser history, etc. (organization, linux, windows, docker) CTFd - (Repo, Home, Docs) CTFd is a Capture The Flag framework focusing on ease of use and customizability. It comes with everything you need to run a CTF and it’s easy to customize with plugins and themes.

Docker

CLI Cheat Sheet General 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # Get help with Docker. Can also use –help on all subcommands docker --help docker COMMAND --help # Show the Docker version information docker version # Start the docker daemon docker -d # Display system-wide information docker info # Get real time events from the server docker events [OPTIONS] # Remove all unused data, images, containers, networks, volumes docker system prune Images Docker images are a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

real world microservices

Decouple by domain-driven design Microservices should be designed around business capabilities, not horizontal layers such as data access or messaging. Microservices should also have loose coupling and high functional cohesion. Microservices are loosely coupled if you can change one service without requiring other services to be updated at the same time. A microservice is cohesive if it has a single, well-defined purpose, such as managing user accounts or processing payment.

Junction

A junction which is the equivalent of a symlink in NTFS. A directory serves as an alias to another directory on windows. For example, if the directory D:\WIN specified C:\WINNT\SYSTEM32 as its target, then an application accessing D:\WIN\DRIVERS would in reality be accessing C:\WINNT\SYSTEM32\DRIVERS. Examples To determine if a file is a junction, specify the file name: 1 junction c:\test To list junctions beneath a directory, include the –s switch:

Building Java Projects with Maven

Install Maven Maven is downloadable as a zip file at https://maven.apache.org/download.cgi. Once you have downloaded the zip file, unzip it to your computer. Then add the bin folder to your path. 1 $ mvn -v Define a simple Maven build Maven projects are defined with an XML file named pom.xml. Create a file named pom.xml at the root of the project (i.e. put it next to the src folder) and give it the following contents:

Debugging JavaScript in Chrome DevTools

Get Started Step 2: Get familiar with the Sources panel UI The Sources panel is where you debug JavaScript. Open DevTools by pressing Command+Option+I (Mac) or Control+Shift+I (Windows, Linux). This shortcut opens the Consolepanel. Step 3: Pause the code with a breakpoint Step 4: Step through the code Step 5: Set a line-of-code breakpoint Step 6: Check variable values

Getting Started with Scala

Create A Scala Project With sbt In The Command Line Installation Java 8 JDK javac -version install sbt Create a project 1 2 $ mkdir practice && cd practice $ sbt new scala/hello-world.g8 # pull template from GitHub 1 2 3 4 5 6 7 8 - hello-world - project (sbt uses this to install manage plugins and dependencies) - build.properties - src - main - scala (All of your scala code goes here) -Main.

Gin

Given you want to do web development, my recommendation is python/Django, absolutely. Go is a nice language, but it is a “systems” language. It’s great for building databases, command line applications, kubernetes stuff, etc. Notice you are.comparing Go (a programming language) with Django (a framework). You don’t have the equivalent of django in Go, so you will have to mix and match a lot of libraries, build all the glue between them, etc.

Java Read it later

https://github.com/microsoft/spring-todo-app/blob/master/src/main/java/com/microsoft/springframework/samples/controller/TodoListController.java https://www.codenong.com/cs107065462/ https://www.cnblogs.com/liangblog/p/4635592.html https://zhuanlan.zhihu.com/p/55962347 https://www.baeldung.com/liquibase-refactor-schema-of-java-app https://csyezheng.github.io/post/back-end/spring/ https://spring.io/guides/tutorials/rest/ https://github.com/spring-projects/spring-boot/tree/master/spring-boot-project https://github.com/spring-projects?q=sample&type=&language= https://github.com/spring-projects/spring-boot/blob/v2.1.1.RELEASE/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/web/SampleController.java https://www.google.com/search?newwindow=1&sxsrf=ALeKk02pHkR5LV5bavUu5Tu7Prkpim2NEw%3A1597684884128&source=hp&ei=lLw6X4_qBc7c9QOzyZBo&q=mybatis+pagination&oq=mybatis+pagena&gs_lcp=CgZwc3ktYWIQAxgAMggIABAWEAoQHjIICAAQFhAKEB46BwgjEOoCECc6BAgjECc6BwgAEBQQhwI6AggAOgoILhDHARCjAhAKOgIILjoECAAQCjoFCAAQywE6BAgAEA06BggAEA0QHlCXP1jXlAFg1akBaABwAHgAgAHpCYgB4DmSAQk0LTcuMi4xLjKYAQCgAQGqAQdnd3Mtd2l6sAEK&sclient=psy-ab https://stackoverflow.com/questions/17511313/how-to-do-pagination-with-mybatis 待看 Apache CXF – JAX-RS Apache CXF – JAXRS Services Configuration Spring Boot CXF JAX-WS Starter cloud-enterprise-granny cloud-service-dq-api-rs apache / cxf A RESTful Web Service Project in Java JAX-RS with Spring and Apache CXF JAX-RS (JSR-311) JAX-RS: Understanding the Basics SpringBoot整合CXF,实

JavaScript

A Tour of JavaScript Lexical grammar The Text of a JavaScript Program JavaScript is a case-sensitive language. JavaScript ignores spaces that appear between tokens in programs. For the most part, JavaScript also ignores line breaks. 1 2 3 4 5 let a a = 3 console.log(a) JavaScript interprets this code like this: 1 let a; a = 3; console.log(a); Comments 1 2 3 4 5 6 // This is a

Python datetime

datetime 8.1. datetime The datetime module, the focus of the implementation is on efficient attribute extraction for output formatting and manipulation. There are two kinds of date and time objects: “naive” and “aware”. An aware object has sufficient knowledge of applicable algorithmic and political time adjustments, such as time zone and daylight saving time information, to locate itself relative to other aware objects. An aware object is used to represent a specific moment in time.

Scala By Example

Introduction Scala smoothly integrates object-oriented and functional programming. Abstract types and mixin composition unify concepts from object and module systems. Pattern matching over class hierarchies unifies functional and object-oriented data access. It greatly simplifies the processing of XML trees. A flexible syntax and type system enables the construction of advanced libraries and new domain specific languages. Starting with simple expressions and functions, and working up through objects and classes, lists and streams, mutable state, pattern matching to more complete examples that show interesting programming techniques.

The Go Tutorial

How About Go Language? Well-written Go programs tend to be straightforward and sometimes a bit repetitive. There’s no inheritance, no aspect-oriented programming, no function overloading, and certainly no operator overloading. There’s no pattern matching, no named parameters, no exceptions. Setting Up Go Environment Installing Go Archlinux 1 $ sudo pacman -S go Mac 1 $ brew install golang Windows 1 $ winget install -e --id GoLang.Go Verify installed Go: 1 $ go version The Go Workspace