
Liunx
bestscw
这个作者很懒,什么都没留下…
展开
-
Linux 上的常用文件传输方式介绍与比较
Linux 上的常用文件传输方式介绍与比较[url]http://www.ibm.com/developerworks/cn/linux/l-cn-filetransfer/index.html[/url]原创 2011-05-12 14:59:04 · 89 阅读 · 0 评论 -
技术杂记
统计redis连接数echo 'client list' | /apps/svr/redis/bin/redis-cli -h 127.0.0.1 -p 6379 |awk '{print $1}' | awk -F '[=,:]' '{print $2}' | sort -n | uniq -c |sort -nr nginx日志分割脚本#!/bin/bash# Th...原创 2017-04-07 15:17:42 · 161 阅读 · 0 评论 -
mysql数据库压力测试
sysbench --debug=off --test=oltp --mysql-host=127.0.0.1 --mysql-user=root --mysql-password='root3306' --oltp-table-size=500000 --mysql-db=test --oltp-table-name=sbtest --num-threads=50 --max-requests...原创 2016-12-22 11:16:10 · 175 阅读 · 0 评论 -
ffmpeg安装过程
yum install -y automake autoconf libtool gcc gcc-c++ wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gztar -xzvf yasm-1.3.0.tar.gzcd yasm-1.3.0./configuremakemake instal...原创 2017-01-04 14:49:43 · 203 阅读 · 0 评论 -
大数据导出与导入
mysqldump导出csv格式 mysqldump -h127.0.0.1 -uroot -proot3306 -t -T /tmp/ dbname tablename --fields-enclosed-by=\" --fields-terminated-by=, 删除文件第一行sed -i '1d' baseinfo_by5m_20160901_end.sql ...原创 2017-01-11 16:15:01 · 222 阅读 · 0 评论 -
liunx服务器监控脚本(监控nginx,php-fpm,mysql)
#!/bin/baship=$(ifconfig eth0 | awk -F'addr:|Bcast' '/Bcast/{print $2}')num=`ps aux | grep php-fpm | grep -v grep | wc -l`if [ $num -eq 0 ];then php alarm.php "php-fpm is not running...原创 2017-05-19 15:03:49 · 229 阅读 · 0 评论 -
跟pdf相关的一些工具
1.pdf转图片yum -y install ImageMagickyum install ImageMagick-develpecl install imagick安装imageMagick和imagick php扩展写道function pdf2png($PDF,$Path){ if(!extension_loaded('imagick')){ return fals...原创 2017-07-18 17:39:21 · 171 阅读 · 0 评论 -
rsync用法几例
rsync -av --exclude=/root/suncw/swoole /root/suncw /data/backup/1/ 本地备份 把/root/suncw目录备份到/data/backup/1/rsync -av root@192.168.1.226:/data/backup/1/ /root/suncw 把远程服务器目录/data/backup/1中的目录和文件备份到本地...原创 2017-08-07 15:49:03 · 269 阅读 · 0 评论 -
dstat用法实例
dstat是一个全能系统信息统计工具 /usr/bin/dstat -d -D xvda,xvdb,xvdc,xvdd,xvde 实时显示磁盘的读写状况/usr/bin/dstat --tcp --proc-count -lcmdsnpgt 显示系统负载、cpu、内存、磁盘、交换、网络、进程、页面、时间、tcp等信息 ...原创 2017-08-15 15:52:41 · 288 阅读 · 0 评论 -
shell分析日志导入mysql
# !/bin/sh# 1463922300,http://aliv.weipai.cn,电信,上海,82793933,155,153,82793300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,633,0,0,0,0,0,0,0,0,0,0,0,0,1,0MYSQL_HOST='127.0.0.1'MYSQL_USER='root'MYSQL_PASSW...原创 2017-01-19 17:07:57 · 280 阅读 · 0 评论 -
解决amr格式不能在微信播放的问题
/usr/local/bin/ffmpeg -i 1.amr 1.mp3原创 2016-10-18 16:39:27 · 2327 阅读 · 0 评论 -
xunsearch使用
写道util/Indexer.php --source=mysql://root:root3306@127.0.0.1/blog/blog --clean demo <?phpini_set('include_path','/usr/local/xunsearch/sdk/php');require 'lib/XS.php';$xs = new XS('demo');...原创 2016-10-18 15:59:10 · 219 阅读 · 0 评论 -
Beanstalkd内存队列使用
pheanstalk_worker.php<?php// Hopefully you're using Composer autoloading.// 定义 BASE_PATHset_time_limit(0);ini_set('memory_limit', '1024M');define('BASE_PATH', __DIR__);// Auto...原创 2016-10-18 15:50:20 · 220 阅读 · 0 评论 -
[转]多服务器文件同步分发处理
两机文件同步OL第一台机子生成KEY 首先做内部SHH指向: [root@sulwan ~]# vi /etc/hosts 写如如下东西 192.168.0.112 sulwanA 192.168.0.113 sulwanB 生成密锁: [root@sulwan ~]# ssh-keygen -t rsa...原创 2011-06-02 13:06:03 · 185 阅读 · 0 评论 -
PHP-FPM on highload tips
When you running a highload website with PHP-FPM via FastCGI, the following tips may be useful to you : ) 1. Compile PHP's modules as less as possible, the simple the best (fast); 2. Increas PHP FastC...原创 2013-03-06 16:19:17 · 109 阅读 · 0 评论 -
检测cdn文件是否同步完成工具(单文件)
#!/bin/shURL=$1result=`curl -o /dev/null -s -m 10 --connect-timeout 10 -w %{http_code} $URL`test=`echo $result`if [[ "$test" = "200" ]];then echo 'cdn sync ok'else ...2012-11-20 16:04:02 · 175 阅读 · 0 评论 -
同步数据库自动化脚本
写道#!/bin/shread -p "Please keyin your ssh host:" -t 30 host_ipread -p "Please keyin your ssh user:" -t 30 usernameread -p "Please keyin your ssh pass:" -t 30 passwordread -p "Please keyin your sync...原创 2013-02-27 11:45:05 · 295 阅读 · 0 评论 -
sed命令用法
sed命令用法在匹配指定行插入新行 sed "/Lulu/i\i am new line" sed_result.log > sed_newline.logsed脚本文件执行附加文本 ./append.sed grade.log > sed_result.log显示匹配到的行sed -n '/J/p' grade.log显示全部内容 sed ...原创 2013-03-01 11:58:37 · 123 阅读 · 0 评论 -
sftp使用知识点
sftp如何连接特定端口sftp -oPort=6003 user@host sftp如何批量下载文件mget dir/*2014-05-29 17:54:01 · 176 阅读 · 0 评论 -
安装php扩展ssh实现服务器间文件拷贝
1. download the libssh2 package from http://libssh2.org, command as following: tar vxzf libssh2-1.4.2.tar.gzcd libssh2-1.4.2./configuremakemake install2. download the php-ssh2 package ...原创 2015-03-19 13:34:44 · 151 阅读 · 0 评论 -
redis cluster启动脚本
# !/bin/shrm -fr /usr/local/cluster/7000/appendonly.aof /usr/local/cluster/7000/nodes-6379.confrm -fr /usr/local/cluster/7001/appendonly.aof /usr/local/cluster/7001/nodes-6379.confrm -fr /usr...2016-04-15 14:08:11 · 168 阅读 · 0 评论 -
awk处理访问日志
统计http状态码cat www.log | awk '{a[$9]++} END{for(i in a)print i,"\t",a[i]}' > out.dat 访问IP分布cat access.log | awk '{a[$1]++} END{for(i in a)print i,"\t",a[i]}' > out.dat 统计Linux下最...原创 2016-04-19 10:52:07 · 274 阅读 · 0 评论 -
几种网站架构图
1.mysql数据库主从架构 2.秒杀 3.mysql水平分片原创 2017-02-03 09:33:20 · 974 阅读 · 0 评论