【用户】create_user_with_sshkey.sh#!/bin/bash
#$ssh-keygen-trsa-b2048-Cyou_comment_here-ffilename
#createuserwithsshpublickey
#20140214
username=‘yourname‘
useradd${username}
id${username}
[-d/home/${username}/.ssh]||mkdir-p/home/${username}/.ssh
cat<&..
分类:
其他好文 时间:
2014-12-24 18:35:37
阅读次数:
165
【cdn节点状态简单查看】cdn_lookup.sh#!/bin/bash
#
#2014/11/4
action=$1
[-z$2]&&hostname="example.com"||hostname=$2
functionusage(){
cat<<_EOF
usage:$0[hh|vv|t1|t2]
hh:轮训CDN的IP访问指定域名获取header
vv:同上,显示详细内容
t1[hostname]:使..
分类:
其他好文 时间:
2014-12-24 18:35:01
阅读次数:
211
【sshd】setting_ssh_banner.sh#!/bin/bash
#
cat<<_SSHCONFIG>/etc/ssh/ssh.banner
[-]welcometothewonderland...
[^]
.____.____
/\\___‘\\/\\____‘\\\\\_\\\\\\\\\\\\/
\\\\\\/\\\\/\\\\\\\\\-/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\__/\\\\\\\\\_\..
分类:
其他好文 时间:
2014-12-24 18:34:33
阅读次数:
155
【初始化-系统时间】init_profile.sh#!/bin/bash
#
#2014/10/20
#profile,增加到最后
cat<<_PROFILE>>/etc/profile
aliasls=‘ls--color=tty‘
aliasll=‘ls-l--color=tty‘
aliasl.=‘ls-d.*--color=tty‘
aliasvi=‘vim‘
aliasrm=‘rm-i‘
aliascp=‘cp-i‘
aliasmv=‘mv-i..
分类:
其他好文 时间:
2014-12-24 18:34:19
阅读次数:
154
【haproxy初始化】haproxy_ctl.sh#!/bin/bash
#
#modifydirpathhere
d_haproxy_log=‘/data/log/haproxy‘
[-d${d_haproxy_log}]||mkdir-p${d_haproxy_log}
#modifydirpathhere
d_haproxy_conf=‘/data/ops/conf/haproxy‘
[-d${d_haproxy_conf}]||mkdir-p${d_haproxy_conf}
#modif..
分类:
其他好文 时间:
2014-12-24 18:34:15
阅读次数:
184
【初始化-sshd】init_sshd.sh#!/bin/bash
#
#2014/09/02
#1)禁用selinux
#modify/etc/sysconfig/selinux
#to:SELINUX=disabled
#andrebootlater.
cp-a/etc/selinux/config/etc/selinux/config.bak
echo‘SELINUX=disabled‘>/etc/selinux/config
#2)清空firewall
iptables-..
分类:
其他好文 时间:
2014-12-24 18:33:51
阅读次数:
161
【限速】limit_download.sh使用iptables做简单的限速策略。#!/bin/bash
#
#limitport80downloadspeed.
ACTION=$1
n_port=80
#n_limit*15/100KB,100Mbit/s=10MB/s=10*1000KB/s
n_limit=$2
[!-z$n_limit]||n_limit=3000
n_limit_burst=$3
[!-z$n_limit_burst]||n_limit_burst=30..
分类:
其他好文 时间:
2014-12-24 18:33:26
阅读次数:
154
【mysql断电重启后修复myisam表错误】fix_myisam_table.sh#!/bin/bash
#
#2014/10/13
fix_bin=‘/usr/bin/myisamchk‘
d_db_data=‘/data/mysql_data/3306‘
dt=`date+"%y%m%d"`
cd${d_db_data}
echo‘>>===========================‘
tail`hostname`.err-n200|grep$dt|grep"..
分类:
数据库 时间:
2014-12-24 18:32:47
阅读次数:
199
【mysql使用xtrabackup做全量增量备份】mysql_backup.sh#!/bin/bash
#
#2014/12/16
#v5.1
#incrementbackup,withtimestamp,compressed,withmaster&slave.
######################
s_port="$1"
s_action="$2"
s_slave="$3"
#####配置参数######
##
f_my_cnf="/data/svr/my..
分类:
数据库 时间:
2014-12-24 18:31:46
阅读次数:
165
【mysqldump备份指定数据库表】my_dump.sh#!/bin/bash
#
#2014/12/12
functiondump_db_table(){
locald_db_base=‘/data/svr/mysql‘
locals_datetime=$(date+%Y%m%d_%H%M%S)
locals_port=3306
locals_password=‘xxx‘
locals_db=$1
if[-z${s_port}];then
echo"Usage:$0database..
分类:
数据库 时间:
2014-12-24 18:30:37
阅读次数:
231