Copy Code code as follows:
#/bin/bash
# History
After #把以下代码直接粘贴到/etc/profile
user_ip= ' who-u am I 2>/dev/null| awk ' {print $NF} ' |sed-e ' s/[()]//g '
Histdir=/var/log/.hist
If [-Z $USER _ip]
Then
User_ip= ' hostname '
Fi
if [!-D
The first idea, with iptables the external network SSH packet drop off;The second idea, with Tcpwrapper to sshd allow write death;The third idea, revise sshd_config, only listens intranet request.
Due to some unclear reasons, the iptables approach
Recently in the debugging server iptables, oneself made a timed turn off iptables, but at night home rarely open a computer, so can not go to start iptables, of course, you may say, why not cancel timed shutdown iptables, I can only say that
The recent local virtual machine space is always backed up to fill, in order to lazy don't want to log up every day to clear, just write this automatic cleanup script.
System: CentOS 5.x
Script content:
Cat make_room.sh
Copy Code code as
Company colleagues today to find me help modify the filename, I see, well, hundreds of files to rename, file name format is _01.png _02.png so in turn, colleagues asked the front of the "_" to remove, fortunately, the request is simple, did not let
Sometimes you need to compare files consistently in your work, and you can do it with the following script (simpler): share it, hoping to help friends with the same needs
Copy Code code as follows:
#!/bin/bash
#对比服务器上文件是否一样
# Richard
The company's recent server testing, the need to constantly adjust the system time, one or two is ok half, a little more points, on a variety of entanglements, the author of these several sets of the author is going crazy. Eldest brother: All speed
Copy Code code as follows:
useradd.sh
#!/bin/bashFor name in Tom Joy John Mark JamesDo Useradd $nameecho "Redhat" | passwd--stdin $nameDone
OK, after the execution, the new user will be automatically created Tom, Joy, John, Mark, James,
1. A streamlined script for automating the deployment of systems, with the main function of cleaning up all directory logs
2. According to the given log directory, delete time combined with crontab to clean the log, clean up after completion, after
My operating system is centos6.4.
Operating system: Rhel 6.2 x86_64
Download and install the Putty software package, I downloaded the putty-0.62-1.el6.rf.x86_64.rpmDownload the address below: HTTP://RPM.PBONE.NET/INDEX.PHP3
1. Remote Host IP
Recently the World Cup has come, has been busy between work and the World Cup, there is no time to manage my blog, today can only be the whole simple small shell to everyone. The company asked to delete one months before the backup file, so that the
Recently in the debugging server iptables, oneself made a timed turn off iptables, but at night home rarely open a computer, so can not go to start iptables, of course, you may say, why not cancel timed shutdown iptables, I can only say that
Copy Code code as follows:
#!/bin/bash
Echo-e ' Date +%y%m%d%h%m '
Echo-e "Pid\t\tswap\t\tproc_name"
# Take out all directories in the/proc directory (the process name is the number is the process, others, such as sys,net, etc. store
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service