原创 Linux下創建shell腳本文件

touch 位置/文件名2.編寫腳本內容(注:第一行一定要寫這句:#!/bin/sh  一般是用這個(Bourne Again Shell))3.chmod o+x /etc/init.d/redis.sh(變爲執行文件)  

原创 安裝LAMP

LAMP(linux,apache,mysql/MariaDB,Perl/PHP,Python) yum install -y httpd httpd-devel phpphp-devel php-mysql   http://www.ce

原创 linux系統一些加固

1除root用戶  其他的都限制使用su命令的權限在/etc/pam.d/su下加入:auth required pam_wheel.so2 超時設置/etc/profile 裏面TMOUT=18003 定時修改密碼·  /etc/shad

原创 Saltstack部署

1、簡介SaltStack是一個服務器基礎架構集中化管理平臺,具備配置管理、遠程執行、監控等功能,一般可以理解爲簡化版的puppet和加強版的func。SaltStack基於Python語言實現,結合輕量級消息隊列(ZeroMQ)與Pyth

原创 linux sed

例子: 一.將linuxfocus 替換爲 LinuxFocus :cat text.file | sed 's/linuxfocus/LinuxFocus/' > newtext.file 二.  sed -i 's/原字符串/新字

原创 刪除rman歸檔日誌

22.2.235su - oraclerman target /delete archivelog until time 'sysdate-3';(剩餘三天)yes

原创 linux上安裝配置vsftpd

 http://www.cnblogs.com/itech/archive/2012/09/16/2687378.html查看是否安裝vsftp rpm -qa | grep vsftpd 如果出現vsftpd-2.0.5-21.el5,說

原创 SUSE11開啓Xmanager

SUSE11開啓Xmanager1、   修改/etc/sysconfig/displaymanager#vi /etc/sysconfig/displaymanagerDISPLAYMANAGER_REMOTE_ACCESS="yes"D

原创 有關rsync的一些語句

*/1 * * * * rsync -zvrtopg --delete -progress -e 'ssh -p 22' [email protected]:/opt/rsynctest/ /opt/rstest/備機配置:rsync -a

原创 用腳本修改文件的內容

 sed -i 's#修改前#修改後#' 文件名例如: sed -i 's#99999#180#' /etc/login.defs 往某個文件具體的某一行插入內容例如往a.txt的第15行插入內容"abc"sed -i "15i abc"

原创 客戶端DNS配置

客戶端DNS配置   特別說明:爲了實現當DNS服務器變更後,客戶端能即時響應,需要關閉客戶端操作系統DNS緩存服務(1)RedHat 、centOS、oracle linux  需要在網卡上綁定DNS1=172.28.8.196  DNS

原创 securecrt同時向多個tab窗口發送相同的命令

作爲管理N臺服務器,而又要執行相同命令又不想用腳本來執行,只有利用工具來執行,可以利用SecureCRT的 Chat Windows選項Send chat to all tabs來同時在服務器上執行相同的命令,記錄下方法,希望提供給有需要朋

原创 linux 黑白名單

linux設置黑白名單vi /etc/hosts.allow   /etc/hosts.denysshd:210.13.218.*:allowsshd:210.13.218.*:deny修改完後要service xinetd restart

原创 shell 查出文件並複製到另一個文件夾

找出所有大於100M的文件並展示出來find / -size +100M -exec ls -lh {} \;找出特定文件內大於200字節的文件並備份到另一個文件夾裏去find /opt/test -type f  -size +200c

原创 用samba和Microsoft Sync Toy從linux備份日誌文件到windows

利用samba使linux系統日誌備份到windows系統,以便查看與分析。一.linux作爲服務器,  安裝samba,yum  -y install samba samba-client samba-swatvi  /etc/samba