This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| user="root" | |
| passwd="1992Sunwj@" | |
| db_name="$1" | |
| SQL="$2" | |
| mysql -u"$user" -p"$passwd" -D "$db_name" -B -e "$SQL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BEGIN{ | |
| printf "%-10s%-20s%-20s%-20s\n","User","Tatol","Success","Failed" | |
| } | |
| { | |
| TATOL[$6]+=$8 | |
| SUCCESS[$6]+=$14 | |
| FALL[$6]+=$18 | |
| } | |
| END{ | |
| for(u in SUCCESS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BEGIN{ | |
| printf "%-10s%-20s%-20s%-20s\n","User","Tatol","Success","Failed" | |
| } | |
| { | |
| TATOL[$6]+=$8 | |
| SUCCESS[$6]+=$14 | |
| FALL[$6]+=$18 | |
| } | |
| END{ | |
| for(u in SUCCESS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BEGIN{ | |
| printf "%-10s%-20s%-20s\n","User","Success_Records","Failed_Records" | |
| } | |
| { | |
| SUCCESS[$6]+=$14 | |
| FALL[$6]+=$18 | |
| } | |
| END{ | |
| for(u in SUCCESS) | |
| printf "%-10s%-20d%-20d\n",u,SUCCESS[u],FALL[u] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BEGIN{ | |
| printf "%-10s%-10s\n","User","Total Records" | |
| } | |
| { | |
| USER[$6]+=$8 | |
| } | |
| END{ | |
| for(u in USER) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 随机生成日志文件脚本 练习awk编程用 | |
| function create_random() | |
| { | |
| min=$1 | |
| max=$(($2-$min+1)) | |
| num=$(date +$s%N) | |
| echo $(($num%$max+$min)) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| #开发分支路径 | |
| DEV_DICTIONARY='/Users/sunwj/Documents/myjob/asiainfo/svn/coderep/' | |
| #uat分支路径 | |
| BRANCH_DICTIONARY='/Users/sunwj/Documents/myjob/asiainfo/svn/branch/' | |
| #获取 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import paramiko # 用于调用scp命令 | |
| from scp import SCPClient | |
| import sys | |
| # 将指定目录的图片文件上传到服务器指定目录 | |
| # remote_path远程服务器目录 | |
| # file_path本地文件夹路径 | |
| def upload_file(img_name, remote_path, file_path): | |
| host = "221.179.xxx.xxx" #服务器ip地址 | |
| port = 0000 # 端口号 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import paramiko # 用于调用scp命令 | |
| from scp import SCPClient | |
| import sys | |
| # 将指定目录的图片文件上传到服务器指定目录 | |
| # remote_path远程服务器目录 | |
| # file_path本地文件夹路径 | |
| def upload_file(file_name, remote_path, file_path): | |
| host = "221.179.xxx.xxx" #服务器ip地址 | |
| port = 0000 # 端口号 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # coding=utf-8 | |
| import pymysql | |
| def connectdb(): | |
| print('连接到mysql服务器...') | |
| # 打开数据库连接 | |
| # 用户名:root, 密码:1992Sunwj@,用户名和密码需要改成你自己的mysql用户名和密码,并且要创建数据库asiainfo,并在asiainfo数据库中创建好表Jobinfo |