This file contains hidden or 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
| http://www.cnblogs.com/yumuxu/p/4246167.html | |
| //type:interface value:sturct | |
| func PrintStruct(t reflect.Type, v reflect.Value, pc int) { | |
| fmt.Println("") | |
| for i := 0; i < t.NumField(); i++ { | |
| fmt.Print(strings.Repeat(" ", pc), t.Field(i).Name, ":") | |
| value := v.Field(i) | |
| PrintVar(value.Interface(), pc+2) | |
| fmt.Println("") |
This file contains hidden or 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
| 从某一行开始,到结束进行输出 | |
| awk ‘/bbb/,0’ file |
This file contains hidden or 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
| https://blog.csdn.net/sean_8180/article/details/81075659 | |
| 1.更新资源 | |
| $ sudo apt-get update | |
| $ sudo apt-get upgrade | |
| $ sudo apt dist-upgrade | |
| 2.安装update-manager-core | |
| $ sudo apt-get install update-manager-core |
This file contains hidden or 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
| https://stackoverflow.com/questions/40266633/golang-insert-null-into-sql-instead-of-empty-string | |
| func NewNullString(s string) sql.NullString { | |
| if len(s) == 0 { | |
| return sql.NullString{} | |
| } | |
| return sql.NullString{ | |
| String: s, | |
| Valid: true, | |
| } |
This file contains hidden or 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
| 另附上 golang.org/x/xxx 包的手动安装方法: | |
| golang.org/x/xxx 这类包托管在 github.com/golang,从这里找到相应的包即可。比如 golang.org/x/crypto 包的安装,找到对应的地址为: https://github.com/golang/crypto ,运行以下命令: | |
| $ cd $GOPATH/src | |
| $ mkdir golang.org | |
| $ cd golang.org | |
| $ mkdir x | |
| $ cd x | |
| $ git clone https://github.com/golang/crypto.git | |
This file contains hidden or 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
| golang 从defer中打印错误,并且返回error错误到上一层 | |
| https://stackoverflow.com/questions/19934641/go-returning-from-defer | |
| https://play.golang.org/p/1IMWPWtTzt | |
| func getReport(filename string) (rep report, err error) { | |
| rep.data = make(map[string]float64) | |
| defer func() { | |
| if r := recover(); r != nil { |
This file contains hidden or 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
| #mysql的定时备份 | |
| time="$(date +"%Y-%m-%d")" | |
| mysqldump -uroot -pRpstir-123 --all-databases > ./mysql_14.104.$time.sql | |
| tar czvf mysql_14.104.$time.sql.tar.gz mysql_14.104.$time.sql | |
| scp mysql_14.104.$time.sql.tar.gz root@***:/home/backup/***/mysql/ | |
| ftp -i -n -v <<EOF | |
| open ***** | |
| user username password |
This file contains hidden or 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
| https://blog.csdn.net/36/article/details/81199861 | |
| Centos下使用rpm方式安装crontab服务 | |
| crontab服务依赖于mysql-libs5.1.x,与已安装的5.7版本冲突。在生产环境下,不可能把Mysql降级来满足版本,因此只能搜寻其它解决办法。 | |
| 偶然间在(https://blog.csdn.net/testcs_dn/article/details/48781553)发现《使用rpm命令从CentOS系统盘安装计划任务程序crontab》,虽然手上没有系统盘,但是网上应该有相关的RPM包。 | |
| 搜寻了下,在http://www.rpmfind.net/linux/rpm2html/search.php上找到了相关的rpm包。 | |
| #下载相关包 | |
| wget http://www.rpmfind.net/linux/centos/6.9/os/x86_64/Packages/cronie-1.4.4-16.el6_8.2.x86_64.rpm | |
| wget http://www.rpmfind.net/linux/centos/6.9/os/x86_64/Packages/crontabs-1.10-33.el6.noarch.rpm | |
| wget http://www.rpmfind.net/linux/centos/6.9/os/x86_64/Packages/cronie-anacron-1.4.4-16.el6_8.2.x86_64.rpm |
This file contains hidden or 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
| 找到 | |
| 系统盘:\用户\[用户名]\AppData\Roaming\Scooter Software\Beyond Compare 3 | |
| 目录中后,把里面的文件全删了就可以了 | |
This file contains hidden or 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
| aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` |