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
用docker: https://hub.docker.com/r/sebp/elkx/, | |
docker-composer内容如下: | |
在kibana(localhost:5601)console里面运行'GET /indices/index/_search'的时候抛下面的错误 | |
1. action [indices:data/read/search] is unauthorized for user [kibana] | |
在kibana management->users里面,有下面错误: | |
1. Kibana: You do not have permission to manage users | |
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
在mac上刚起mysql docker, 然后安装一个mysql client, 通过 mysql -uroot -p --protocol=tcp连接的时候报错:"connection from ip '172.20.0.2' is not allowed". | |
折腾半天,搞不定。然后重启Mac, 好了! | |
人生就是这样,莫名其妙就坏了,莫名其妙就好了! |
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
csv = File.read("./your_csv.csv") | |
table=CSV.parse(csv, headers:true) | |
# require 'csv' |
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 said: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/lib/plugin/caching_sha2_password.so, 2): image not found | |
解决办法: | |
$ mysql -uroot | |
$ update mysql.user set plugin = 'mysql_native_password'; | |
Query OK, 1 row affected (0.08 sec) | |
Rows matched: 4 Changed: 1 Warnings: 0 | |
重启mysql, 问题解决,参考:https://taruchan.com/2018/06/22/cant-connect-to-mysql-from-sequel-pro/ |
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
利用docker搭建samba服务器步骤: | |
1. 先运行docker 创建samba服务器容器 | |
docker run -it --name samba -p 139:139 -p 445:445 -v $PWD/samba_shared:/shared -d dperson/samba -u 'dg;dg123' -u 'admin;admin_123' -s 'public;/shared/public' -s 'users;/shared/users;yes;no;yes;all;all;all' | |
或者用下面这种展开后的命令: | |
docker run -it --name samba -p 139:139 -p 445:445 -v $PWD/samba_shared:/shared -d dperson/samba \ | |
-u 'dg; password’ \ #创建用户dg, 密码password | |
-u 'admin; password’ \ #创建用户admin, 密码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
eq: "等于" | |
eq_any: "等于任意值" | |
eq_all: "等于所有值" | |
not_eq: "不等于" | |
not_eq_any: "不等于任意值" | |
not_eq_all: "不等于所有值" | |
matches: "符合" | |
matches_any: "符合任意条件" | |
matches_all: "符合所有条件" | |
does_not_match: "不符合" |
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
1. 添加gem gem 'pry' | |
2. 添加gem 'pry-doc', 这是查看源代码用的, $ 命令和?命令要用到 | |
3. gem 'pry-rails'这gem把默认的irb替换为pry |
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
Model: | |
class People < ActiveRecord | |
acts_as_taggable_on :genders,:features | |
end | |
index.html.erb | |
<%= search_form_for @q do |f| %> | |
<%= f.search_field :features_name_cont, class: "form-control", placeholder:type here" %> |
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
TextMate, | |
vim, | |
xvim, | |
Spectacle | |
SimHolders | |
Alfred | |
iFunBox | |
The unarchiver | |
evernote | |
CoreDataEditor |
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
#import <AppKit/AppKit.h> | |
@interface NSImage (DrawAttributedString) | |
+ (NSImage *)imageWithAttributedString:(NSAttributedString *)attributedString | |
backgroundColor:(NSColor *)backgroundColor; | |
+ (NSImage *)imageWithAttributedString:(NSAttributedString *)attributedString; | |
+ (NSImage *)imageWithString:(NSString *)string; | |
@end |
NewerOlder