自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(220)
  • 资源 (1)
  • 收藏
  • 关注

原创 资料整理【笔记和剪藏】

IndexTags@???????? 技术知识点【Projects】@???????? Clippers【Resource Category】@Reading List【Resource Category】@数据结构【Area】@运维【Area】@Golang【Area】@Python【Area】@操作系统【Area】@开发方法论【Area...

2021-07-05 17:01:02 177

原创 Goland 提示...cannot download,... is a GOROOT, not a GOPATH. For more details see: 'go help gopath'...

原因: 配置goroot和gopath时混乱,使得两者很相似;解决方法 移除 gopath内src/下的cmd文件夹。参考: https://www.jianshu.com/p/3fb4e58e4528https://stackoverflow.com/questions/42809990/go-get-cannot-download-home-azhukov-go-is-a-goroot-n...

2021-04-14 11:10:44 666

原创 Jenkins 区分目录执行任务

假设需要同一分支下不同分支发生变化时会触发不同的jenkins任务,可以配置:源码管理->Additional Behaviours->Polling ignores commits in certain paths项。比如:image.png该任务只会在develop分支上similar_jobs/目录下文件发生提交时会触发。...

2020-11-10 12:01:14 651

原创 Redis 批量删除指定前缀keys

redis-cli -h HOST -p 6379 --scan --pattern "site_point*" | xargs -L 2000 redis-cli -h HOST -p 6379 del以每批2000删除前缀为site_point的key值。

2020-10-05 15:23:49 1252

原创 kong 插件使用Redis遇到的问题

参考: https://juejin.im/post/6844904197662441486执行阶段限制:resty.redis 不能在 init_by_lua, set_by_lua, log_by_lua, and header_filter_by_lua 这些阶段执行。对应到kong,就是init_worker() header_filter() log() 等函数里不可用使用该redis...

2020-09-06 17:01:12 324

原创 PostgreSQL 锁表解决(转)

PostgreSQL 锁表解决: https://www.jianshu.com/p/976770e829d4

2020-08-31 23:12:26 267

原创 postgres 创建自增序列

建表时添加自增序列和主键CREATE TABLE users(id SERIAL primary key , "admin_id" int4, "acc_id" int4,);ALTER TABLE "public"."im_group_kick_out_record" OWNER TO "postgres";给已有表增加自增序列ALTER TABLE "pu...

2020-08-26 14:08:41 942

原创 MAcOS docker server连接本机数据库

参考:https://docs.docker.com/docker-for-mac/networking/设置DB_HOST为host.docker.internal 而不是localhost

2020-07-16 12:24:30 198

原创 sql ORDER BY the IN value list (IN 查询并排序Ruby举例)

参考 https://stackoverflow.com/questions/866465/order-by-the-in-value-list将结果按ids的顺序排序cn字段举例:ruby实现 ids = [635, 511, 580]order_ids = []ids.each_with_index{|id,index| order_ids << "(#{id}, #{...

2020-06-16 18:35:52 267

原创 MatePadPro远控MacBookPro生产力最大化尝试

目的: 1.【减重】作为程序员不每天负重背16寸Mac上下班通勤,如果一定要随时Coding可以背着相对轻多了的[MatePad](https://club.huawei.com/forum-4333-1.html) Pro; 2.【便携】通勤时背个pad即可随时看个pdf,或者没Mac在身边也能随时用pad作为生产力工具(手机太小,Mac太重); 3. 【生产力最大化...

2020-06-08 00:34:43 1599

原创 Iterm2 打开tab时自动给tab加颜色

效果:image.png比如zshrc加入然后重启iterm2if [[ -n "$ITERM_SESSION_ID" ]]; then tab-color() { echo -ne "\033]6;1;bg;red;brightness;$1\a" echo -ne "\033]6;1;bg;green;brightness;$2\a...

2020-05-22 17:27:03 1458 1

原创 Python Django 使用日常问题记录

django N+1 问题解决:https://my.oschina.net/oncereply/blog/268922django 只使用逻辑外键不物理外键: https://blog.csdn.net/Focus_on_linux/article/details/90521503Python console显示query log: python manage.py shell_plus -...

2020-05-11 14:24:58 155

原创 拆分cv views

https://simpleisbetterthancomplex.com/tutorial/2016/08/02/how-to-split-views-into-multiple-files.html

2020-05-06 12:22:43 163

原创 pg_dump 锁表问题

pg_dump不会锁表导致无法读或写,但是会阻塞DDL操作。https://blog.dbi-services.com/when-we-do-a-pg_dump-and-right-afterwards-truncate-a-table-which-is-in-the-dump-what-happens/ ...

2020-04-17 11:00:52 1275

原创 zsh git 别名一览表

http://blog.heyuhua.com/2017/08/zsh-git-%E6%8F%92%E4%BB%B6%E5%86%85%E7%BD%AE%E5%88%AB%E5%90%8D%E4%B8%80%E8%A7%88%E8%A1%A8/

2020-04-11 11:13:21 225

原创 VIM终极配置spf13

折腾来折腾去的搞vim配置,不如就用这个吧,开发配合vscode用。http://vim.spf13.com

2020-01-11 15:09:07 209

原创 数据库三范式

https://www.cnblogs.com/Spacecup/p/3864961.html

2020-01-09 11:03:01 95

原创 Tree 生成目录结构树

MAC install: brew install tree命令:# 当前项目文件数生成tree . # 只生成文件夹的目录结构tree . -d# 按1层输出tree . -L 1

2020-01-04 14:38:57 175

原创 Shell字符串拼接(连接、合并)

http://c.biancheng.net/view/1114.html

2019-12-24 11:53:30 3972

原创 Ruby ActiveRecord 增加primary key

https://thinkwhere.wordpress.com/2009/05/09/adding-a-primary-key-id-to-table-in-rails/def self.upadd_column :table_name, :id, :primary_keyenddef self.downremove_column :table_name, :ide...

2019-12-11 12:29:48 151

原创 Postgresql未使用索引问题

使用EXPLAIN命令查看慢查询时发现,有个int列在查询时未命中索引, 如图:name = 02019-10-07 at 1.47 PM.png而如果查询改为 name = 1:2019-10-07 at 1.46 PM.png这是因为该表中name为0的行数大于70%(或某个具体数值),索引查询会比seq scan顺序扫描要慢,Post...

2019-12-11 12:25:16 1994

原创 在线postgresql sql文件转换成Mysql sql文件【Online】

http://www.lightbox.ca/pg2mysql.php在线工具

2019-12-09 19:55:59 1870

原创 docker-compse 更改网桥

https://www.cnblogs.com/asheng2016/p/10532724.html坑: version 3 不能加gateway,改用了version 2;要想去掉已用的网段,不能直接改配置后docker-compse down再up,而应该先原配置 down后,再加networks,再up networks: - backendnetwo...

2019-12-03 01:06:52 237

原创 docker-compose up 偶尔很长时间挂起

https://github.com/docker/compose/issues/6552随机数不够用了?cat /proc/sys/kernel/random/entropy_availapt install -y havegedsystemctl status haveged.servicecat /proc/sys/kernel/random/entropy_a...

2019-12-03 00:47:31 1071

原创 Ruby yaml文件中使用环境变量ENV

项目代码需要连接多个数据库, 数据库配置使用了自定义的yaml文件,而如果需要在yaml文件中像在html中使用<%= %>的方式注入ruby代码,则需要使用ERB class来处理(如果是类似于database.yml这种gem自带的配置文件,是可以直接使用<%= %>的方式加入ruby代码的)使用方式如下(使用了自定义的config/master_da...

2019-12-02 12:02:18 1299

原创 ELK 常用命令

elastic search启动本地启动节点:bin/elasticsearch -E node.name=node1 -E cluster.name=geektime -E path.data=node1_data -E http.port=9200 -d启动两个node:bin/elasticsearch -E node.name=node2 -E cluster....

2019-11-26 18:41:56 189

原创 Docker 常用命令

Dockerfile 构建过程使用命令:# builddocker build -t imagename .# 例如: docker build -t hr_api:v1 .清缓存build docker build --no-cache -t imagename .# 进到容器内 docker run -it --rm imagename# rundock...

2019-11-26 18:41:38 79

原创 CentOS 7 install docker及docker-compose下载太慢问题解决

install Docker sudo yum install -y yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo yum instal...

2019-11-26 16:19:20 3513

原创 Nginx 自定义error_page不生效

2019-11-23 at 11.35 AM.png加上 proxy_intercept_errors on;.

2019-11-23 11:37:55 3814

原创 Nginx 匹配nginx 中间可变字符url

在线Nginx location 测试工具 https://nginx.viraptor.info/# 匹配中间字符可变url:# 例如:http://www.wondercv.com/cvs/11asdf331/editor # =>location ~ ^/cvs/(\w+)/editor$ {} ...

2019-11-20 14:53:00 1589

原创 git 已经被git追踪的文件 加到.gitignore不生效

已经被git追踪的文件 加到.gitignore 需要$ git rm -r --cached file_name在push到代码库后该文件就没有了

2019-11-15 15:25:23 260

原创 Ruby RestClient 常用请求(带json post, get)

GET res = RestClient::Request.execute( method: :get, url: ES_SEARCH_URL, timeout: 30, headers: {params: params} )POST with JSON body res =...

2019-11-06 11:06:08 1637

原创 Postgres 替换column内内容为随机字符

UPDATE usersSET email = md5(random()::text || random()::text) || '@gogogo.com'WHERE users.id > 100000 and users.id < 1000000 and email NOT LIKE '%*%';

2019-11-05 11:00:58 120

原创 Ruby ActiveRecord 回调

https://guides.rubyonrails.org/active_record_callbacks.html#available-callbacks3.1 Creating an Objectbefore_validationafter_validationbefore_savearound_savebefore_createaround_createa...

2019-11-02 22:21:04 146

原创 Aliyun PostgreSQL数据库搭建问题及解决办法整理

问:只读的数据库可否放不同vpc?答:需要vpc打通,最好放一个vpc( 同一个可用区)。问:购买时8核32G配置 是指?答:主备实例的配置下限。问:只读实例的大小可否比主备实例小?答:一般和主备实例一致,配置只读实例选项是在购买主备实例之后可看到的。问: 场景 Production data(VPC 1 ) 同步到 另一staging (VPC 2)如何实现?答: ...

2019-10-25 00:12:31 174

原创 Rails ActiveRecord连接多个数据库

参考:https://www.thegreatcodeadventure.com/managing-multiple-databases-in-a-single-rails-application/

2019-10-25 00:10:28 183

原创 Postgres 存储表情 编码问题

mysql存储emoji可以把编码设置为utf8mb4,但是postgresql设置为utf8mb4编码格式即可,默认支持。CREATE DATABASE xxx_database WITH OWNER postgres ENCODING 'UTF8'

2019-10-16 19:34:40 2876 1

原创 SSH 每次都需要输入密码

如果是因为本地有太多rsa文件导致则可以:ssh-add -K ~/.ssh/xxx_rsa替换成你自己的rsa文件执行一下。

2019-10-15 20:08:26 1645

原创 Rails to_json 和 JSON.pretty_generate(data)

to_json保存到文件中是一行,并且不利于阅读,而且html标签会转码:2019-10-15 at 5.20 PM.png2019-10-15 at 5.22 PM.pngJSON.pretty_generate(data).gsub(": null", ": \"\"")2019-10-15 at 5.20 PM.png ...

2019-10-15 17:22:56 238

原创 Rails5 development 本地开发开启cache 缓存

参考https://blog.bigbinary.com/2016/01/25/caching-in-development-environment-in-rails5.htmlrails 4配置config/environments/development.rb如下:config.action_controller.perform_caching = true可开启开发环...

2019-10-07 14:58:29 156

ADT-20.0.0.ZIP

嗯 ,不错 !熬到ADT20.0.0 android开发必备!

2012-07-18

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除