-
Create a file to store our credentials:
sudo vim /etc/postfix/sasl_passwd
-
Add something like this:
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 | |
# This script run at 00:00 | |
# The data logs path | |
#日志存放 | |
logs_path="/data/logs/nginx/" | |
#日志备份 | |
backup_path="/data/backup/logs/nginx/" | |
#年份 | |
year=$(date -d "yesterday" +"%Y") |
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 | |
set -e | |
if [ $# -eq 0 ]; then | |
echo "USAGE: $0 plugin1 plugin2 ..." | |
exit 1 | |
fi | |
plugin_dir=/var/lib/jenkins/plugins |
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 | |
set -o errexit | |
echo "Removing exited docker containers..." | |
docker ps -a -f status=exited -q | xargs -r docker rm -v | |
echo "Removing dangling images..." | |
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi |
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
Json中含有 特殊字符 | |
String values encode as JSON strings coerced to valid UTF-8, replacing invalid bytes with the Unicode replacement rune. The angle brackets "<" and ">" are escaped to "\u003c" and "\u003e" to keep some browsers from misinterpreting JSON output as HTML. Ampersand "&" is also escaped to "\u0026" for the same reason. This escaping can be disabled using an Encoder with DisableHTMLEscaping. | |
方法1: | |
data := json.RawMessage(`"key": "http://www.baidu.com?a=c&b=d&e=d"`) | |
bytes, err := data.MarshalJSON() | |
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
package main | |
import ( | |
"fmt" | |
"regexp" | |
) | |
var myExp = regexp.MustCompile(`(?P<first>\d+)\.(\d+).(?P<second>\d+)`) | |
func main() { |
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 | |
## backup use ssh | |
# bash backup_data.sh /data/tmp/wx.csv wx chuxing@s1:/data/boomer/ | |
source=$1 | |
zip=$2 | |
remote=$3 |
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 | |
# __________ | |
# /''T''|[___|___] | |
# Sundyli | |
# [---T--L-OlllllllO-] | |
# ooOO2016-08-25 11:47ooOO | |
# ()_)"""()_)/"**")_) 什么时候才能有辆悍马呢? | |
# _| _ _ / '| /~~ _ _ _ _ .| _ _ _ _ | |
# _|</(_)(_)(_).|.| (|/(_|| | |(_|||.(_(_)| | | | |
# / __ _| |
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
package gomarker | |
type service func() result | |
func invokeService(ctx content.Content, s service) chan result { | |
c := make(chan result) | |
go func() { | |
c1 := make(chan result) | |
go func() { | |
c1 <- s() |
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 --login | |
## install zookeeper from url | |
#env | |
id=$1 | |
hosts=("server.1=lp2:2888:3888" "server.2=lp3:2888:3888" "server.3=lp4:2888:3888") | |
version=3.4.10 | |
dir="/data/local" |
OlderNewer