Linux 常用命令笔记-2
注意事项:
沟通项目需求:
1.项目背景和目的
哪个团队、项目Wiki?
数据库登陆:mysql -uroot -pabc@0326 -h127.0.0.1 -P4004 -A
set names utf8;
SELECT count(*) FROM `g_map` WHERE ((status = 1 or status = 3) and name like 'zhong中%');
SELECT count(*) FROM `g_map` WHERE ((status = 1 or status = 3) and name='中');
SELECT `id`, `area`, `product_type`, `airport`, `type`, `source`, `name`, `status`, `send_status`, `online_status`, `admin_user_id`, `create_time`, `update_time`, `validate_time`, `admin_user_en`, `admin_user_cn`, `is_admin`, `is_parent`, `dead_line`, `canonical_country_code` FROM `g_map` WHERE ((status = 1 or status = 3) and name like '中%') ORDER BY id DESC LIMIT 4;
1. 登陆服务器:
ssh -p 35000 -o StrictHostKeyChecking=no -o ServerAliveInterval=60 whywanghaiyang@gzrelay.sys.dayunmotuo.com
dssh hostname
sudo -iu username
2. 下载线上文件:
> 下载文件到跳板机器
dscp whywanghaiyang@hostname:/home/log.wf.2018121916 ./
python -m SimpleHTTPServer 8100
> 在跳板机上启动HTTP服务
python -m SimpleHTTPServer 8100
3. 查询文件中关键字条数
grep key log.info | wc -l9655
4. 查看机器启动时间:
date -d "$(awk -F. '{print $1}' /proc/uptime) second ago" +"%Y-%m-%d %H:%M:%S"
2. 查询进程:
ps -aux | grep nginx | grep -v apache // 抓去nginx关键子,过滤掉包含apache关键字的条目
kill -9 nginx //直杀进程
5.
ifind -b hostname
ifind -t clustername
irun -c 'egrep 703687549066689 /home/log/log.error' | egrep -v Warning
irun -c 'egrep 703687549066689 /home/log/log.log' | egrep -v Warning
3. Redis 查询Geofence-updater key
hget key_601 207601
hgetall key_601
hval key_601 207601
4.
netstat -lntup |grep geofen
export GOPATH=/home//app/namespace
export GOROOT=/usr/local/go
ps -ef |grep name
pwdx 37830
netsta -atl | grep 8081
nc -l ip:port > a.txt
5. 测试工具
wrk -t8 -c200 -d30s --latency "http://www.bing.com"
6. 配置Gitlab的SSH
ssh-keygen -t rsa -C 'xxx@xxx.com'
复制内容:~/.ssh/id_rsa.pub
git更新单个文件:
git fetch
git checkout origin/master -- path/to/file
g
groupadd hadoop
useradd -d /home/hadoop -m hadoop -g hadoop
passwd hadoop
find /home -name filename
8. 查Linux版本
cat /etc/issue
7. 端口占用
Linux如何查看端口
1、lsof -i:端口号 用于查看某一端口的占用情况
2. netstat -tunlp |grep 端口号
SELECT `id`, `area`, `product_type`, `airport`, `type`, `source`, `name`, `status`, `send_status`, `online_status`, `admin_user_id`, `create_time`, `update_time`, `validate_time`, `admin_user_en`, `admin_user_cn`, `is_admin`, `is_parent`, `dead_line`, `canonical_country_code` FROM `table_name` WHERE `id`=? LIMIT 1 []interface {}{246023}
UPDATE `table_name` SET `area` = ?, `product_type` = ?, `type` = ?, `source` = ?, `name` = ?, `status` = ?, `send_status` = ?, `online_status` = ?, `admin_user_en` = ?, `admin_user_cn` = ?, `dead_line` = ?, `update_time` = ? WHERE (id = ?) []interface {}{41, 106, 116, 1, "城0719_3eebbc244be40c876afefe87da271df9", 1, 2, 1, "wangyajuanjessy", "王雅娟", "2019-06-10 18:08:06", "2018-12-11 16:36:21", 246023}
DELETE FROM `table_anme` WHERE (map_id = ?) []interface {}{246023}
BEGIN TRANSACTION
BEGIN TRANSACTION
INSERT INTO `table_name` (`map_id`, `map_item`, `name`, `center`, `radius`, `fence_type`, `administrative`, `create_time`, `update_time`, `canonical_country_code`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{246023, "[\"111.509439,40.784006\",\"111.515619,40.774127\",\"111.589090,40.788685\",\"111.621363,40.757485\",\"111.644708,40.746561\",\"111.687280,40.740839\",\"111.733286,40.753324\",\"111.742899,40.785565\",\"111.776544,40.803759\",\"111.794397,40.832859\",\"111.844522,40.856753\",\"111.889154,40.913857\",\"111.891901,40.935647\",\"111.871301,40.936165\",\"111.789591,40.893098\",\"111.725733,40.894655\",\"111.685221,40.888426\",\"111.626856,40.881158\",\"111.611063,40.871293\",\"111.608316,40.853637\",\"111.571237,40.835457\"]", "poly-item-1", "", 0, 1, 0, "2018-12-11 16:36:21", "2018-12-11 16:36:21", ""}
COMMIT
SELECT `id`, `map_id`, `map_item`, `name`, `center`, `radius`, `fence_type`, `administrative`, `create_time`, `update_time`, `canonical_country_code` FROM `table_name` WHERE (map_id = ?) []interface {}{246023}
ROLL BACK
### 压力测试
siege -c20 -r2 -H "Cache-Control: no-cache" -H "Postman-Token: c6eda32d-1f30-775f-6796-95383011bacc" -H "Content-Type: application/x-www-form-urlencoded" -d 'coords=39.8845,116.3256,40.8845,117.3256&token=3CF4BA9BDC761BA0&logid=1234567' "http://100.69.93.36:7081/fenceservice/infence"
Elasticsearch
集群如何启动:
ZenDiscovery 多数选主算法
lucen 倒排索引
mainconfig.GetMainConfig().UPM.Url + "/user/get/info?"
url = url + GetUpmParams() + "&userName=" + userName + "&withDefaultGrant=1"
appid=1802
appkey=eea2596baa8eb356f4db54ce990681de
url=http://100.69.238.12:8000/sec/upmapi
http://100.69.238.102:8000/sec/upmapi/user/get/info?appId=1802&appKey=eea2596baa8eb356f4db54ce990681de&time=1545196498&sign=d5cf954721e2392d392d1b56899baef7&userName=nimei&withDefaultGrant=1
egrep -o '\btoken:\S*\b' geofence-updater.log.wf | sort |uniq -c
egrep -o 'role=[0-9]+' | sort | uniq -c
Linux 常用命令笔记-2的更多相关文章
- Linux 常用命令笔记
Linux 常用命令笔记 1. locate locate:用来定位文件的位置,如:locate a.txt 但是这个命令有延迟,也就是新建的文件不一定能搜索到,如果非要找到新建的文件可以使用 upd ...
- Linux常用命令 笔记
Linux常用命令 笔记 一.文件处理命令 1. ls命令:显示目录文件 -a 显示所有文件,包括隐藏文件.(all) ...
- Windows&Linux常用命令笔记
目录 linux windows Linux: 1.查找文件 find / -name filename.txt 根据名称查找/目录下的filename.txt文件. find . -name &qu ...
- Linux常用命令笔记一
笔记1:查看ubuntu是32位还是64位的方法及其版本号 查看ubuntu是64还是32的命令如下: uname -m 如果是i386到i686,那就是32位系统:如果是x86_64 ,那就是64系 ...
- Linux常用命令笔记总结(待补充)
问题实际场景:遇到告警磁盘利用率不足,检查根目录下各文件大小 Linux查看磁盘利用率 df –h 查找磁盘占用情况 find / -size +100M 从根目录往下找大于100M大小的文件 du ...
- Linux 常用命令笔记 (持续更新)
声明:本文是转载前辈的,地址:http://www.cnblogs.com/tovep/articles/2473147.html 在tomcat的bin目录下执行 ./shutdown.sh 为了查 ...
- linux 常用 命令 笔记二
wget 下载,得到网络上的内容 grep 文件搜索工具 EveryThing is a file in the linux system 安装 cowsay sudo apt-get install ...
- Linux常用命令笔记
~ 我的home目录/ 系统根目录进入home目录:cd \进入跟目录:cd /Maven编译:mvn clean deploy -U -Dmaven.test.skip=true dependenc ...
- 《精通Linux C编程》1.3Linux系统的常用命令-笔记
[toc] 1.3.1了解Shell Linux常用命令的运行环境就是Shell,它是一种命令解析器,在用户和操作系统之间提供了一个交互接口. 用户在命令行输入命令,然后Shell对该命令进行解析并将 ...
随机推荐
- 爬虫(四)requests模块1
引入 Requests 唯一的一个非转基因的 Python HTTP 库,人类可以安全享用. 警告:非专业使用其他 HTTP 库会导致危险的副作用,包括:安全缺陷症.冗余代码症.重新发明轮子症.啃文档 ...
- ES6/ES7/ES8常用特性和新特性
转自:https://www.jianshu.com/p/9da4aa1c9970
- oracle中delete、truncate、drop的区别 (转载)
一.delete 1.delete是DML,执行delete操作时,每次从表中删除一行,并且同时将该行的的删除操作记录在redo和undo表空间中以便进行回滚(rollback)和重做操作,但要注意表 ...
- 文科生打开python的大门
作为唯一的一名教育学院的学生,加入python课程,一定要声明我可不是并不是被迫选课的!虽然是文科生,但是是对编程这种东西很感兴趣的文科生.从站在python门口的张望,到现在悄悄把门打开,越来越感觉 ...
- 像调试java一样来调试Redis lua
高并发的系统中,redis的使用是非常频繁的,而lua脚本则更是锦上添花.因为lua脚本本身执行的时候是一个事务性的操作,不会掺杂其他外部的命令,所以很多关键的系统节点都会用redis+lua来实现一 ...
- 网页链接跳转qq聊天界面以及QQ群是什么实现的
网页可以唤起QQ群,这我们都知道可以做到,那如何唤起呢?下面就做一个简单的介绍,希望可以帮助到有需要的朋友 1.官方提供的几种加群的链接 官方的加群代码的获取前提是我们具有权限(也就是群主或管理权限) ...
- 第7天:Q Quant库(未完待续)
一.本文大纲: 1.Python内置函数计算期权的价格 2.numpy加速数值计算 3.SciPy进行仿真模拟 4.SciPy求解器计算隐含波动率 5.matplotlib绘图 二.案例 (看不懂,略 ...
- PPT母版制作
选择母版 首先,去iSlide官网下载iSlide,下载iSlide后,power point的菜单栏会自动出现iSilde图标(如下图). 打开iSlide这一栏,点击“图示库”,会弹出一个窗口,就 ...
- Android studio报Error:(26, 13)-v7:27.错误的解决方法
1.报错图片 2.上图我画了红圈很明显就提示报错方向就是项目文件:build.gradle 3.解决方法如下 添加此方法到项目构建.gradle文件中: repositories { maven ...
- 关于FFmpeg工具的使用总结
FFmpeg官网:http://ffmpeg.org/ 安装ffmpeg: http://www.cnblogs.com/freeweb/p/6897907.html 主要参数: -i 设定输入流 - ...