上一页 1 2 3 4 5 6 7 8 ··· 15 下一页
摘要: 视频教程 Elasticsearch(7.8.1)沥血之作(包含仿百度搜索案例) https://www.bilibili.com/video/BV1y5411j7su?p=5 视频资料提取地址: 链接:https://pan.baidu.com/s/1qvdGvhMX3tGLLVSaHSWg0w 阅读全文
posted @ 2021-09-13 01:20 HaimaBlog 阅读(63) 评论(0) 推荐(0) 编辑
摘要: ubuntu系统 kibana: https://mirrors.huaweicloud.com/kibana/?C=N&O=D 找到6.2.4的下载连接 方法一: 下载tar包,解压即可: 下载的文件 kibana-6.2.4-linux-x86_64.tar.gz 解压到/usr/local/目 阅读全文
posted @ 2021-09-13 00:23 HaimaBlog 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 参考: https://www.cnblogs.com/wf0117/p/9080726.html 1.读取csv 文件中读取:一次读入全部(设置headers使 CSV#shift() 以CSV::Row对象返回而不是数组;使 require 'csv' CSV#read() 返回 CSV::Ta 阅读全文
posted @ 2021-09-07 21:31 HaimaBlog 阅读(502) 评论(0) 推荐(0) 编辑
摘要: 用shell处理文件的时候我们常常需要去掉或者加上换行符,name问题就来了怎么才能快速的替换呢? 我们有这样一个文件[root@hxy working]# cat 1 GD200A16C013493,GD200A16C013494,GD200A16C013495,GD200A16C013497 我 阅读全文
posted @ 2021-09-04 23:19 HaimaBlog 阅读(2978) 评论(0) 推荐(0) 编辑
摘要: 控制器 def index #传给前端展示层当前的id @id = 6 end # http://127.0.0.1:3000/admin/category_statistics/export_table?id=6 def export_table puts "@params > #{params} 阅读全文
posted @ 2021-09-03 15:35 HaimaBlog 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 参考: https://blog.csdn.net/xing102172/article/details/9163607 For example: h={'a'=>2, 'c'=>1, 'b'=>3} sort 方法: key升序: h.sort { |a, b| a[0]<=>b[0] } [[" 阅读全文
posted @ 2021-08-28 01:37 HaimaBlog 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 卢菲菲最强大脑记忆训练法全套教程 https://www.bilibili.com/video/BV19f4y1z77Q?from=search&seid=14857115335605998951 花了3000 买的卢菲菲老师的记忆课程,冒死分享出来 需要的收藏 可能会被下架 .模 模块02:奇思妙 阅读全文
posted @ 2021-08-21 22:42 HaimaBlog 阅读(5912) 评论(0) 推荐(0) 编辑
摘要: 参考: https://www.jianshu.com/p/aef65d0c03a4 阅读全文
posted @ 2021-08-19 21:19 HaimaBlog 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 参考下面的连接 使用Rails构建JSON-API https://chorder.net/2018/07/31/%E4%BD%BF%E7%94%A8Rails%E6%9E%84%E5%BB%BAJSON-API/ 安装jwt组件 Gemfile里添加 # jwt gem 'jwt' 执行命令: b 阅读全文
posted @ 2021-08-19 14:42 HaimaBlog 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 在Linux环境下,查看文件内容时,很多时候需要查看指定关键字的前后几行,如查看日志文件时,如果日志文件太大,想直接在Linux 终端中查看,可以grep ‘partten’ filename 进行过滤,如果想查看匹配行的前后几行,可通过在grep后面添加参数来实现,具体如下: grep -A 5 阅读全文
posted @ 2021-08-19 14:15 HaimaBlog 阅读(854) 评论(0) 推荐(0) 编辑
摘要: 效果 代码 <!DOCTYPE HTML> <html lang="zh-cn"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=d 阅读全文
posted @ 2021-08-15 17:16 HaimaBlog 阅读(2285) 评论(0) 推荐(0) 编辑
摘要: 安装: yum install jq -y 文档: https://stedolan.github.io/jq/manual/ 更多: https://blog.csdn.net/Cheat1173010256/article/details/118230562 数据源 333.json [{ "n 阅读全文
posted @ 2021-08-13 01:26 HaimaBlog 阅读(3085) 评论(1) 推荐(0) 编辑
摘要: 单个获取 编写角本pingip.sh #!/bin/sh ADDR=qq.com TMPSTR=`ping ${ADDR} -c 1 | sed '1{s/[^(]*(//;s/).*//;q}'` echo ${TMPSTR} echo ${TMPSTR} >> 666.txt 执行结果 haim 阅读全文
posted @ 2021-08-12 19:23 HaimaBlog 阅读(2049) 评论(0) 推荐(0) 编辑
摘要: 例子一: golang 数组分割 需求:给定一个数组和一个正整数,要求把数组分割成多个正整数大小的数组,如果不够分,则最后一个数组分到剩余的所有元素。 package main import ( "fmt" ) func main() { //demo01() //demo02() demo03() 阅读全文
posted @ 2021-08-12 07:26 HaimaBlog 阅读(8057) 评论(0) 推荐(0) 编辑
摘要: 场景: 将下面的数据里category里的分类统计计数 数据源 es_ip10000.json {"_index":"order","_type":"service","_id":"107.151.83.180:22","_score":1,"_source":{"ip":"107.151.83.1 阅读全文
posted @ 2021-08-09 15:21 HaimaBlog 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 介绍: awk是一个非常强大的文本分析工具。 相对于grep查找,sed编辑,awk在其对数据分析并生成报告时,显得尤为强大。 简单来说awk主是把文件逐行的读入,==(空格,制表符)==为默认分隔符,将每行切片,切开的部分再进行各种分析处理。 解释 awk -F 'pattern + action 阅读全文
posted @ 2021-08-09 14:10 HaimaBlog 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 控制器文件 app/controllers/api/v1/order_controller.rb def create # 从本地读取 log_dir = File.expand_path(File.join(Rails.root.to_s,'/log/ip04.log')) puts "log_d 阅读全文
posted @ 2021-08-07 10:36 HaimaBlog 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 参考文章: https://blog.csdn.net/weixin_42224577/article/details/108107554 在虚拟机中设置好添加共享文件后,普通用户并不能访问mnt文件里的hgfs文件 切换成root后可以看到共享的文件 改权限不行,改用户拥有者也不行 haima@h 阅读全文
posted @ 2021-08-06 18:24 HaimaBlog 阅读(1226) 评论(0) 推荐(0) 编辑
摘要: 文档地址: https://freed.gitee.io/rails-guides/active_record_querying.html 创建 ## 记录日志 Log.create(logtype: 2, email: current_user.email, user_id: current_us 阅读全文
posted @ 2021-08-05 22:45 HaimaBlog 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 使用Elasticsearch在Rails中进行全文本搜索 参考: https://blog.csdn.net/cunjie3951/article/details/106921108 阅读全文
posted @ 2021-07-31 12:51 HaimaBlog 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 按protocol聚合 { "_source": "protocol", "size": 1, "aggs": { "agg_protocols": { "terms": { "field": "protocol.raw", "size": 1000 } } } } 指定地区,按port聚合 { " 阅读全文
posted @ 2021-07-27 00:31 HaimaBlog 阅读(555) 评论(0) 推荐(0) 编辑
摘要: elasticsearch 6.2.4和elasticsearch-head测试环境搭建 使用docker-compose方式 一 背景说明 对于新手来说搭建一个elasticsearch的测试环境稍微费力,而且没必须要去下载那么多安装包,比如java node npm等,所以我决定做成docker 阅读全文
posted @ 2021-07-23 07:00 HaimaBlog 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 创建迁移文件 rails g migration add_product_images_index 编写迁移文件 db/migrate/20170119093958_add_product_images_index.rb class AddProductImagesIndex < ActiveRec 阅读全文
posted @ 2021-07-20 07:53 HaimaBlog 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Ruby on Rails是一个功能强大的WEB开发框架,在这里我们将会学到一些经常用到的Ruby on Rails内置方法,帮助大家熟练掌握其应用技巧。 Ruby on Rails自动生成文档技巧大讲堂 Ruby代码管理经验分享 Ruby创建构造器技巧分享 Ruby异常处理结构特点介绍 Ruby数 阅读全文
posted @ 2021-07-19 07:53 HaimaBlog 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Gemfile文件里添加 gem 'bulk_insert' #批量插入 命令行执行安装依赖 bundle install 数据源 ["1.180.3.187", 161, 2601] ["1.180.3.178", 161, 2601, 44222, 44333] 批量插入 def test3(p 阅读全文
posted @ 2021-07-12 01:36 HaimaBlog 阅读(206) 评论(0) 推荐(0) 编辑
摘要: json_object={ "ip"=> "127.0.0.1", "ports"=> '80,135', "data"=>{"port"=>22,"item"=>["22","open","tcp","","ssh"]} } puts "json_object:#{ json_object.to_ 阅读全文
posted @ 2021-07-11 10:08 HaimaBlog 阅读(74) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/cpbk/p/10617508.html 阅读全文
posted @ 2021-06-30 08:22 HaimaBlog 阅读(23) 评论(0) 推荐(0) 编辑
摘要: Linux查看文件指定行数内容 1、tail date.log 输出文件末尾的内容,默认10行 tail -20 date.log 输出最后20行的内容 tail -n -20 date.log 输出倒数第20行到文件末尾的内容 tail -n +20 date.log 输出第20行到文件末尾的内容 阅读全文
posted @ 2021-06-29 17:38 HaimaBlog 阅读(3404) 评论(0) 推荐(0) 编辑
摘要: csv读写 封装成工具包 package utils import ( "encoding/csv" "fmt" "log" "os" "path" "time" ) func ReadCsv(filePath string) (data [][]string, err error) { f, er 阅读全文
posted @ 2021-06-29 15:16 HaimaBlog 阅读(1306) 评论(0) 推荐(0) 编辑
摘要: 资料来源:技术胖 jspang.com 下载linux学习路径:https://newimg.jspang.com/linux-image01.png Linux备忘手册: 百度网盘 链接:https://pan.baidu.com/s/1CO_yd8TYFPhw77G8vETzeA 提取码:kh1 阅读全文
posted @ 2021-06-15 08:06 HaimaBlog 阅读(277) 评论(0) 推荐(0) 编辑
摘要: gorm 关系一对一,一对多,多对多查询 gorm v2版本 Belongs To mysql表 CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(64) NOT NULL DEFAULT '', ` 阅读全文
posted @ 2021-06-12 22:53 HaimaBlog 阅读(3713) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash HOST="127.0.0.1" PORT="3306" USERNAME="root" PASSWORD="123456" DBNAME="fofapro" #定时修改 update_sql=" update enterprise_ip_tasks set state = 阅读全文
posted @ 2021-06-12 22:34 HaimaBlog 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 创建控制器 --no-assets 我们不需要生成资源文件 haima@haima-PC:/media/haima/34E401CC64DD0E28/site/go/src/ruby/rails_demo$ rails g controller api/v1/order --no-assets cr 阅读全文
posted @ 2021-06-07 00:38 HaimaBlog 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 添加字段 控制台上执行下面的命令 rails g migration addColumnToBlackIps send_time:datetime 会生成文件db/migrate/20210529131328_add_column_to_black_ips.rb class AddColumnToB 阅读全文
posted @ 2021-05-29 21:20 HaimaBlog 阅读(387) 评论(0) 推荐(0) 编辑
摘要: start.sh #!/bin/bash nohup rails s Puma -d >> run_log.log 2>&1 & stop.sh #!/bin/bash ps -ef |grep puma |awk '{print $2}'|xargs kill -9 阅读全文
posted @ 2021-05-29 18:59 HaimaBlog 阅读(64) 评论(0) 推荐(0) 编辑
摘要: https://sysin.org/article/vmware-workstation-16-slic/ 阅读全文
posted @ 2021-05-26 23:38 HaimaBlog 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 下载ruby 下载地址: ruby各版本下载地址 https://rubyinstaller.org/downloads/ 2.3.3版本 https://www.cr173.com/soft/14252.html 下载后安装 这里以2.7.3为例 双击安装后 回车 回车 C:\Users\Admi 阅读全文
posted @ 2021-05-25 18:08 HaimaBlog 阅读(461) 评论(0) 推荐(0) 编辑
摘要: https://blog.51cto.com/abian/1337989 阅读全文
posted @ 2021-05-19 12:22 HaimaBlog 阅读(26) 评论(0) 推荐(0) 编辑
摘要: github地址 https://github.com/rest-client/rest-client gemfile里添加 gem 'rest-client', '~> 2.0' 执行 bundle install 代码里 # 要请求接口地址 # 上传文件的key名字 # file 文件的绝对路径 阅读全文
posted @ 2021-05-16 14:56 HaimaBlog 阅读(73) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/chentianwei/p/9227594.html 阅读全文
posted @ 2021-05-15 19:24 HaimaBlog 阅读(30) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 15 下一页