Skip to content

Instantly share code, notes, and snippets.

https://stackoverflow.com/questions/4116681/how-to-load-system-properties-file-in-spring
brew cask install homebrew/cask-versions/java6
<?xml version="1.0" encoding="utf-8"?>
<items><item valid="no"><title>Error in workflow 'gist'</title><subtitle>HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /gists (Caused by NewConnectionError('&lt;urllib3.connection.VerifiedHTTPSConnection object at 0x10aec5210&gt;: Failed to establish a new connection: [Errno 61] Connection refused',))</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items>
curl -s -S 'https://registry.hub.docker.com/v2/repositories/library/centos/tags/' | jq '."results"[]["name"]' |sort
39807a98d2d702479af25f8f7f9ba8c6671a9cdd
@mittyok
mittyok / ChangeLogLevel.java
Created April 22, 2019 10:07 — forked from nkcoder/ChangeLogLevel.java
change log level at runtime (logback and slf4j)
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
/**
* change log level at runtime
* Created by nkcoder on 10/8/16.
func init() {
rand.Seed(time.Now().UnixNano())
}
func retry(attempts int, sleep time.Duration, f func() error) error {
if err := f(); err != nil {
if s, ok := err.(stop); ok {
// Return the original error for later checking
return s.error
}
apiVersion: v1
data:
Corefile: |
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream
fallthrough in-addr.arpa ip6.arpa
## 只是总结,并未验证对应的版本准确性,仅供参考
sysvinit, upstart, systemd:
centos5使用sysvinit,centos6开始使用upstart,同时可用sysvinit,centos7开始使用systemd
ubuntu: 6.10及以前使用sysvinit,14.10及以前使用upstart,同样可使用sysvinit,15.04开始预设使用systemd,但是开机时可以选择systemd或者upstart,两者不可共存
@mittyok
mittyok / confirm.go
Created August 27, 2018 08:52 — forked from albrow/confirm.go
Go (golang): How to ask for user confirmation via command line
import (
"fmt"
"log"
"os"
"sort"
)
// askForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and
// then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as
// confirmations. If the input is not recognized, it will ask again. The function does not return