http://www.cyberciti.biz/tips/reboot-or-halt-linux-system-in-emergency.html Linux kernel includes magic system request keys. It was originally developed for kernel hackers. However, you can use this hack to reboot, shutdown or halt computer safely (r…
Linux下常用的关机/重启命令一般包括: shutdown.reboot.halt.poweroff等,当然了我们可以使用init 运行等级runlevel 0即halt来关机,或使用init 运行等级runlevel 6即reboot来执行重启. 当然了这些关机或重启的方式也有一些细微差别. 首先明确一下linux/redhat系的runlevel运行级别和debian系的runlevel是有所不同的. redhat系的runlevel定义如下: runlevel 0: halt 系统停机状…
reboot ,shutdown,halt区别 重启   reboot  和 shutdown -r now  效果是一样的都是重启 区别在于reboot 是重启时,删除所有的进程,为不是平稳的终止他们 shutdown 是安全的关闭或者重启,在关机前系统会给用户提示,也可以设置关机时间 half是最简单的关机命令, half 参数,-f  强制关机 -i  关机前关掉所有的网卡 -p  关机调用poweroff reboot 使用reboot命令可以快速地关闭系统,但如果还有其它用户在该系统上…
init 首先看看LINUX系统几种运行级别# 0 - 停机(千万别把initdefault设置为0,否则系统永远无法启动)# 1 - 单用户模式# 2 - 多用户,没有 NFS# 3 - 完全多用户模式(标准的运行级)# 4 – 系统保留的# 5 - X11 (x window)# 6 - 重新启动 (千万不要把initdefault 设置为6,否则将一直在重启 ) #init 0 切换到运行级别0动作为运行如下两个脚本: [root@limt rc0.d]# pwd /etc/rc.d/rc…
source: http://linoxide.com/linux-shell-script/shell-script-check-linux-system-health/ This article introduces a shell script to perform linux system health check.This script collects system information and status like hostname, kernel version, uptim…
本文是笔者最近遇到的一个故障的处理过程,解决方案是Rebuild RPM 的DB,后面内容其实是REDHAT官方的solutions,不过我遇到的现象和解决方案都与官方有点出入,故一直帖出来: 我遇到的故障现象: [root@migrationLin6 ~]# rpm -qa error: rpmdbNextIterator: skipping h# 514 Header V3 RSA/SHA256 Signature, key ID fd431d51: BAD error: rpmdbNext…
写在前面:本文是对OSCon09的<Linux System and Performance Monitoring>一文的学习笔记,主要内容是总结了其中的要点,以及加上了笔者自己的一些理解.通过总结,一方面是为了加深笔者自己的理解,另一方面也是希望能对有需要的朋友有所帮助. 做为一名服务器开发工程师,经常会有分析系统性能,解决系统性能瓶颈的需求.通常我们所说的性能问题,不外乎就是CPU/Memory/IO/Network这四个方面,这四个方面每个都有各自独特之处,同时也都是相互关联的.下面就分…
The frequently used operation in Linux system    2017-04-08 12:48:09  1. mount the hard disk:  #: fdisk -l     %% use this operation to check how many and what disk it found in the computer. #: mkdir yiDongYingPan   %% mkdir a new file as the locatio…
转自:http://blog.csdn.net/ysbj123/article/details/51233618 当运行GNU链接器gld(ld)时若使用了"-M"选项,或者使用nm命令,则会在标准输出设备(通常是屏幕)上打印出链接映像(link map)信息,即是指由链接程序产生的目标程序内存地址映像信息.其中列出了程序段装入到内存中的位置信息.具体来讲有如下信息: 目标文件及符号信息映射到内存中的位置. 公共符号如何放置. 链接中包含的所有文件成员及其引用的符号. 通常我们会把发送…
一.下载MySql 浏览器打开 https://www.mysql.com/downloads/mysql/#downloads 下载 我下载的版本是Red Hat 5 版本的 https://www.mysql.com/downloads/mirror.php?id=407552 上传至服务器,或在服务器上直接 wget 下载方式下载. (我在服务器上存放在目录/opt/tools 下) 二.解压tar文件 执行命令:tar -xvf MySQL-5.5.23-1.rhel5.x86_64.t…
2014-06-11 Check the Linux system log find the errorr: Jun  9 11:18:49 hostname avahi-daemon[3640]: Invalid query packet. Jun  9 11:19:29 hostnam  elast message repeated 7 times Jun  9 11:22:06 hostnam  eavahi-daemon[3640]: Invalid query packet. Jun…
Linux System linux 是一个功能强大的操作系统,同时它是一个自由软件,是免费的.源代码开放的,编制它的目的是建立不受任何商品化软件版权制约的.全世界都能自由使用的UNIX兼容产品.各种使用 Linux 作为内核的 GNU 操作系统正被广泛地使用著:虽然这些系统通常被称作为“Linux”,但是它们应该更精确地被称为 GNU/Linux 系统 .…
目录 .文件系统及访问权限 . Linux Syslog . Linux日志审计 . 帐号安全管理 . 基础物理安全 . 系统编译环境安全 . 系统病毒.后门.rootkit安全 . 系统端口.服务安全 . 系统内核安全 . 基于系统日志审计的入侵检测 . 构建日志收集系统过程中面临的技术挑战 1.文件系统及访问权限 Linux为每个文件都分配了一个文件所有者,称为"文件属主",并赋予文件主惟一的注册名 . 对文件的控制取决于文件主或超级用户root(linux系统中的root用户有无…
https://major.io/2010/12/07/tap-into-your-linux-system-with-systemtap/ December 7, 2010 By Major Hayden 4 Comments One of the most interesting topics I’ve seen so far during my RHCA training at Rackspace this week isSystemTap. In short, SystemTap all…
快捷键: open a new terminal: ctrl+alt+T; close current terminal: ctrl+shift+W; switch windows: alt+tab switch workspace: ctrl+alt+arrow key; install deb package: sudo dpkg -i package.deb; dpkg 是Debian package install rpm package: sudo alien -i package.r…
在检查Linux的日志文件时,发现大量 avahi-daemon[3733]: Invalid query packet错误(不同服务器对应的数字有所不同) Aug  3 07:00:01 hostname auditd[3143]: Audit daemon rotating log files Aug  3 08:02:39 hostname avahi-daemon[3733]: Invalid query packet. Aug  3 08:03:19 hostname last mes…
目录 . 为什么要构建日志系统 . 通用日志系统的总体架构 . 日志系统的元数据来源:data source . 日志系统的子安全域日志收集系统:client Agent . 日志系统的中心日志整合系统:log server . 日志系统的后端存储系统:log DB . 日志系统搭建学习 1. 为什么要构建日志系统 log是管理员每日需要查看的文件记录.里面记载了大量系统正常和不正常的运行信息,这些信息对管理员分析系统的状况.监视系统的活动.发现系统入侵行为是一个相当重要的部分对于安全研究员来说…
Sysvinit 的小结 Sysvinit 的优点是概念简单.Service 开发人员只需要编写启动和停止脚本,概念非常清楚:将 service 添加/删除到某个 runlevel 时,只需要执行一些创建/删除软连接文件的基本操作:这些都不需要学习额外的知识或特殊的定义语法(UpStart 和 Systemd 都需要用户学习新的定义系统初始化行为的语言). 其次,sysvinit 的另一个重要优点是确定的执行顺序:脚本严格按照启动数字的大小顺序执行,一个执行完毕再执行下一个,这非常有益于错误排查…
1. The Stat Family #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int stat(const char *path, struct stat *buf); int fstat(int fd, struct stat *buf); int lstat(const char *path, struct stat *buf); struct stat{      dev_t…
link: http://www.tutorialspoint.com/unix_system_calls/execve.htm NAME execve - execute program SYNOPSIS #include <unistd.h> int execve(const char *filename, char *const argv[], char *const envp[]); DESCRIPTION execve() executes the program pointed t…
这一章的标题是 "信号" ,所以本文将对信号的各个方面进行介绍,由于Linux中的信号机制远比想象的要复杂,所以,本文不会讲的很全面... 信号机制是进程之间相互传递消息的一种方法,信号全称为软中断信号,也有人称作软中断.从它的命名可以看出,它的实质和使用很象中断.所以,信号可以说是进程控制的一部分. 一.信号的基本概念 本节先介绍信号的一些基本概念,然后给出一些基本的信号类型和信号对应的事件.基本概念对于理解和使用信号,对于理解信号机制都特别重要.下面就来看看什么是信号. 1.基本概…
system(3) - Linux man page Name system - execute a shell command Synopsis #include <stdlib.h> int system(const char *command); Description system() executes a command specified in command by calling /bin/sh -c command, and returns after the command…
1. 内核提供三种不同的方式来记录时间 Wall time (or real time):actual time and date in the real world Process time:the time that a process spends executing on a processor 包括用户时间user time 和 系统时间system time Monotonic time:use the system's uptime (time since boot) for th…
1. 进程调度 the process scheduler is the component of a kernel that selects which process to run next. 进程调度器需要使 处理器使用率最大化,并且提供 使多个进程并发执行的虚拟   Deciding which processes run, when, and for how long is the process scheduler's fundamental responsibility.   时间…
1. Scatter/Gather I/O a single system call  to  read or write data between single data stream and multiple buffers This type of I/O is so named because the data is scattered into or gathered from the given vector of buffers Scatter/Gather I/O 相比于 C标准…
1.每个Linux进程都有一个最大打开文件数,默认情况下,最大值是1024 文件描述符不仅可以引用普通文件,也可以引用套接字socket,目录,管道(everything is a file) 默认情况下,子进程会获得其父进程文件表的完整拷贝   2.打开文件 open系统调用必须包含 O_RDONLY,O_WRONLY,O_RDWR 三种存取模式之一 注意 O_NONBLOCK模式 ) ) 3.读文件 read系统调用会有以下结果: (1)返回值与请求数len相同,所有len字节都存储在buf…
转: https://my.oschina.net/renhc/blog/54582 先看一下问题 简单封装了一下system()函数:   int pox_system(const char *cmd_line) { return system(cmd_line); }   函数调用: int ret = 0; ret = pox_system("gzip -c /var/opt/I00005.xml > /var/opt/I00005.z"); if(0 != ret) {…
Linux install LibreOffice: install LibreOffice: install command: sudo apt install ./XXX.deb PS: don't forget the './' for the path. git clone http://XX dictionary_path git clone to specific dictionary. jupyter with kernel: here, and 为Jupyter notebook…
system 功能:system()函数调用"/bin/sh -c command"执行特定的命令,阻塞当前进程直到command命令执行完毕 原型 int system(const char *command); 返回值: 如果无法启动shell运行命令,system将返回127:出现不能执行system调用的其他错误时返回-.如果systenm能够顺利执行,返回那个命令的退出码 system函数执行时,内部会调用fork,execve,waitpid等函数. #include &l…
catalog . Linux弱口令攻击向量 . Linux登录验证步骤 . PAM . 弱口令风险基线检查 1. Linux弱口令攻击向量 0x1: SSH密码暴力破解 hydra -l root -P /root/passwdCracker/password.lst -t -vV -e ns 112.124.51.10 ssh 对于Linux系统来说,从外部破解系统密码的途径只有SSH这一条路,攻击者必须借助网络进行密码猜解尝试 0x2: Linux SSH空口令帐号 . 通过Bash指令:…