前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >sed修改grub文件

sed修改grub文件

原创
作者头像
用户1168904
修改2021-05-19 10:59:37
2.3K0
修改2021-05-19 10:59:37
举报
文章被收录于专栏:运维相关文档运维相关文档

#!/usr/bin/perl

#

# Nathanial Hendle

# http://retards.org/

#

# 2001-06-26 v1.0

#

# This perl script parses a MySQL slow_queries log file

# ignoring all queries less than $min_time and prints

# out how many times a query was greater than $min_time

# with the seconds it took each time to run. The queries

# are sorted by number of times it took; the most often

# query appearing at the bottom of the output.

#

# Usage: mysql_slow_log_parser logfile

#

# ------------------------

# SOMETHING TO THINK ABOUT (aka: how to read output)

# ------------------------

#

# Also, it does to regex substitutions to normalize

# the queries...

#

# $query_string =~ s/\d+/XXX/g;

# $query_string =~ s/([\'\"]).+?([\'\"])/$1XXX$2/g;

#

# These replace numbers with XXX and strings found in

# quotes with XXX so that the same select statement

# with different WHERE clauses will be considered

# as the same query.

#

# so these...

#

# SELECT * FROM offices WHERE office_id = 3;

# SELECT * FROM offices WHERE office_id = 19;

#

# become...

#

# SELECT * FROM offices WHERE office_id = XXX;

#

#

# And these...

#

# SELECT * FROM photos WHERE camera_model LIKE 'Nikon%';

# SELECT * FROM photos WHERE camera_model LIKE '%Olympus';

#

# become...

#

# SELECT * FROM photos WHERE camera_model LIKE 'XXX';

#

#

# ---------------------

# THIS MAY BE IMPORTANT (aka: Probably Not)

# ---------------------

#

# *SO* if you use numbers in your table names, or column

# names, you might get some oddities, but I doubt it.

# I mean, how different should the following queries be

# considered?

#

# SELECT car1 FROM autos_10;

# SELECT car54 FROM autos_11;

#

# I don't think so.

#

sed修改grub文件,一句话脚本,简单实用

sed -i '/vmlinuz-2.6.32-358/s@rd_NO_DM.*@rd_NO_DM acpi_pad.disable=1@' /etc/grub.conf

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 MySQL
腾讯云数据库 MySQL(TencentDB for MySQL)为用户提供安全可靠,性能卓越、易于维护的企业级云数据库服务。其具备6大企业级特性,包括企业级定制内核、企业级高可用、企业级高可靠、企业级安全、企业级扩展以及企业级智能运维。通过使用腾讯云数据库 MySQL,可实现分钟级别的数据库部署、弹性扩展以及全自动化的运维管理,不仅经济实惠,而且稳定可靠,易于运维。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com