- Use
@ConfigurationProperties
and always get state from the bean. - The
Environment
can change at runtime and Spring Cloud does this for you usingRefreshEvent
. - Changes are propagated to beans in Spring Cloud in 2 ways (
@ConfigurationProperties
and@RefreshScope
). - If you care about the state of
@ConfigurationProperties
being consistent on concurrent access, put it or the consumer@Bean
in@RefreshScope
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twisted.internet import reactor, defer, endpoints, task, stdio | |
from twisted.conch.client import default, options, direct | |
from twisted.conch.error import ConchError | |
from twisted.conch.ssh import session, forwarding, channel | |
from twisted.conch.ssh import connection, common | |
from twisted.python import log, usage | |
import signal | |
import tty | |
import struct | |
import fcntl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Collecting all physical interfaces's name and mac addresse | |
declare -A NAME_TO_MAC | |
set -e | |
for f in /sys/class/net/*; do | |
if [ -L $f ]; then | |
name=`readlink $f` | |
if echo $name | grep -v 'devices/virtual' > /dev/null; then | |
eval $(ifconfig `basename $f` | head -n 1 | awk '{print "NAME_TO_MAC[\"",$1,"\"]=",$5}' | tr -d ' ') | |
fi | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR="$PWD" | |
GIT="/usr/bin/git" | |
echo "Generating tags in $DIR" | |
FILE_LIST=cscope.files | |
TAG_FILE=tags | |
if ! [ -d .git ]; then | |
echo "create Git repository" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html, | |
<style type="text/css"> | |
#e { | |
position:absolute; | |
top:0; | |
right:0; | |
bottom:0; | |
left:0; | |
font-size:16px; | |
} |