惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
SecWiki News
SecWiki News
Project Zero
Project Zero
C
Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Scott Helme
Scott Helme
A
Arctic Wolf
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
The Hacker News
The Hacker News
T
Tenable Blog
雷峰网
雷峰网
有赞技术团队
有赞技术团队
V
V2EX
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threat Research - Cisco Blogs
T
Threatpost
AWS News Blog
AWS News Blog
L
LINUX DO - 热门话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
SegmentFault 最新的问题
月光博客
月光博客
Spread Privacy
Spread Privacy
S
Secure Thoughts
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
Forbes - Security
Forbes - Security
T
The Exploit Database - CXSecurity.com
G
GRAHAM CLULEY
The Last Watchdog
The Last Watchdog
Y
Y Combinator Blog
I
Intezer
博客园 - 【当耐特】
B
Blog RSS Feed
Attack and Defense Labs
Attack and Defense Labs
I
InfoQ
博客园 - 叶小钗
Cyberwarzone
Cyberwarzone
V2EX - 技术
V2EX - 技术
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
H
Help Net Security
C
CERT Recently Published Vulnerability Notes

博客园 - lykyl的自留地

树莓派编译安装opencv3 (2019.1.6更新) centos6 安装EPEL "检索COM类工厂中 CLSID为 {00024500-0000-0000-C000-000000000046}的组件时失败,原因是出现以下错误: 80070005" 问题的解决 centos6.x 安装pylucene (20161027改) - lykyl的自留地 趣味python编程之经典俄罗斯方块 python编码规范 改进uwsgi启动脚本,使其支持多个独立配置文件 在CentOS 6.5上安装python2.7 "System.Security.Cryptography.CryptographicException: 拒绝访问" 问题的解决方法 利用SHELL脚本实现文件完整性检测程序(1.2版更新) 获取linux服务器基本信息脚本 DELPHI实现关闭指定进程,自身防杀 基于python编写的天气抓取程序 vim使用心得(持续更新) NFS服务基本配置及使用 利用shell脚本实现计划任务功能 V1.2 利用shell脚本实现计划任务功能 rsync简明手册 linux bash script简明手册(持续更新)
linux使用心得(持续更新)
lykyl的自留地 · 2013-08-22 · via 博客园 - lykyl的自留地

! 查看发行版本信息

lsb_release -a

uname -a

以下方法只适合redhat和centos

cat /etc/redhat-release

rpm -q redhat-release

rpm -q centos-release

! 关闭SHELL铃声

vi /etc/inputrc

将set bell-style none的注释取消

!日期时间修改

修改日期

date -s MM/dd/YYYY

修改时间

date -s HH:mm:ss

! 日期时间格式化输出

date +[格式化输出符]

例如:

date +%H:%M:%S

17:18:24

ntpdate cn.pool.ntp.org;hwclock --systohc

! smbmount

使用 mount替代,格式为cifs

mount -t cifs -o username=xxx.password=xxx //hostname/dir /mnt/dir

也可以建立别名

alias smbmount='mount -t cifs'

! 终端中文设置

yum -y groupinstall chinese-support

vi /etc/sysconfig/i18n

LANG="zh_CN.UTF-8"

LC_MESSAGES="en_US.UTF-8"

SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"

SYSFONT="latarcyrheb-sun16"

再在PUTTY中将窗口-转换-假定接收数据的字符集设为UTF-8

!设置DNS的IP

/etc/resolv.conf

nameserver xxx.xxx.xxx.xxx

!设置网络主机名,以及是否允许使用网络

/etc/sysconfig/network

NETWORKING=yes

HOSTNAME=xxx

!设置具体网卡

/etc/sysconfig/network-scripts/ifcfg-eth<0起始的数字>

DEVICE=eth0

BOOTPROTO=static|dhcp

BROADCAST=

IPADDR=

NETMASK=

GATEWAY=

HWADDR=

ONBOOT=yes

MTU=1500

TYPE=Ethernet

!记录主机名与IP对应关系

/etc/hosts

! 软raid5默认需要spare盘,用--force 参数可以屏蔽掉这个功能

When creating a RAID5 array, mdadm will automatically create a degraded

   array   with   an   extra spare drive.   This is because building the spare

   into a degraded array is in general faster than resyncing the parity on

   a   non-degraded, but not clean, array.   This feature can be over-ridden

   with the --force option.

!/etc/passwd字段定义

LoginName:Password:Uid:Gid:UserInfo:Home:Shell

!/etc/shadow字段定义

LoginName:Passwd:LastChg:Min:Max:Warn:Inactive:Expire:Flag

!/etc/group字段定义

GroupName:Password:Gid:UserList(split by ',')

!/etc/gshadow字段定义

GroupName:Password:UserList(split by ',')

!强制踢掉在线用户

通过用户名踢

pkill -u <name>

通过TTY踢

pkill -kill -t <tty name>

!egrep不允许使用\{\}

!declare命令将变量转成环境变量,供子进程调用。进程中的环境变量修改,只影响自身与子进程。

!SELINUX开启时ZendGuardLoader能在PHP命令行环境加载,但无法在APACHE中加载的解决办法

execstack --clear-execstack /usr/lib64/php/modules/ZendGuardLoader.so

!复制虚拟机启动后网卡报“Device eth0 does not seem to be present,delaying initialization”
编辑 /etc/sysconfig/network-scripts/ifcfg-eth0,将其中的MAC地址改成新虚拟机网卡的MAC地址。
rm -f /etc/udev/rules.d/70-persistent-net.rules
重启系统。

! 脱离终端后台运行shell

nohup ./test.sh &

!ubuntu删除多余的旧内核

查找已经安装的内核

dpkg --get-selections |grep linux-image

根据情况删除旧内核

sudo apt-get remove <内核完整名称>

! 获取路径里文件名与目录名的方法

basename <路径>     #获取路径里的文件名

dirname <路径>     #获取路径里的目录名,不包含最后的/

!ubuntu处理DOS回车

sudo apt-get install tofrodos

fromdos <待转换为UNIX回车的文件>

todos <待转换为DOS回车的文件>

! ubuntu安装HG

sudo add-apt-repository ppa:tortoisehg-ppa/releases
sudo add-apt-repository ppa:mercurial-ppa/releases
sudo apt-get update
sudo apt-get install mercurial python-nautilus tortoisehg