DOWNLOAD FILES AND TRANSCODING THEN MAILING THEM ALL AUTOMATICALLY

#! /bin/bash #version 2.1 #auther simon@codewalker.me LF=/var/log/statement/daily/statement.log #current work directory CW=’/path/to/work/space’ YESTERDAY=`date +%Y%m%d -d ‘yesterday’` if [ $1 ]; then YESTERDAY=$1 fi download () { if [ -f “Statement/zip/$YESTERDAY.Statement.zip” ]; then echo “Already sending $YESTERDAY.statement” | tee -a $LF read -n1 -p “Do you want force to send mail [Y|N]? ” current_input case $current_input in […]

DOWNLOAD FILES AND TRANSCODING THEN MAILING THEM ALL AUTOMATICALLY

#! /bin/bash #version 2.0 #auther simon@codewalker.me LF=/var/log/statement/daily/statement.log YESTERDAY=`date +%Y%m%d -d ‘yesterday’` if [ $1 ]; then YESTERDAY=$1 fi download () { if [ -f “Statement/zip/$YESTERDAY.Statement.zip” ]; then echo “Already sending $YESTERDAY.statement” | tee -a $LF read -n1 -p “Do you want force to send mail [Y|N]? ” current_input case $current_input in Y|y) echo “Downloading ${YESTERDAY}_zhye-yh-cqg.zip […]

Download files and transcoding then mailing them ALL automatically

simon said 懒是第一生产力 #! /bin/bash YESTERDAY=`date +%Y%m%d -d ‘yesterday’` LF=/path/to/filename.log download () { echo ‘Downloading files…’ | tee -a $LF curl “http://www.download.com/name.file” } makedirs() { echo “Making dirs utf8.$YESTERDAY GBK.$YESTERDAY” | tee -a $LF if [ ! -x “Statement/utf8/$YESTERDAY”]; then mkdir -p “Statement/utf8/$YESTERDAY” fi if [ ! -x “Statement/zip/”]; then mkdir -p “Statement/zip/” fi if […]

How to enable IPv6 on Centos 6.X

Step 1. Check IPv6 module is enable for Kernel lsmod | grep ipv6 step 2.Enable IT. 2.1 ##notice may file name is different## Editing the file /etc/modprobe.d/disable_ipv6.conf Change options ipv6 disable=0 to options ipv6 disable=1 2.2 Editing the file /etc/sysconfig/network Change NETWORKING_IPV6=no to NETWORKING_IPV6=yes step 3 rebooting your server step 4 configure kernel parameters to […]

Remove old backups automatically over 86400 mins

Remove old backups automatically over 86400 mins when disk used over 90% & send mail to named E-mail. SERVER_NAME=`hostname` vvv=`df -h|awk -F ‘ ‘ ‘{print $5}’|tail -n1` len=${#vvv} newLen=$(( len – 1 )) num=${vvv:0:newLen} if [[ num -gt 90 ]]; then find /path/to/dir -name ‘*tar.gz’ -cmin +86400 -exec rm {} \; find /path/to/another/dir -name ‘*tar.gz’ […]

how to interconversion between timestamps and date time on MacOS X

#0 Get current timestamps Put those lines in your .zshrc or bashrc alias showmeCurrentTimestamp=”date +%s” Then you need execute one command below source ~/.zshrc|| source ~/.bashrc #1 Timestamps to date Save this script in anywhere you want and then make a soft link to ‘/usr/local/bin’ just like “ln -s source dst” #!/bin/bash #auth:codewalker #mail:simon.xie@codewalker.me if […]

recoverLoacalDB

Because I’m lazy #/************************************************************************* #> File Name: recoverLoacalDB_hellomoney.sh #> Author: Simon #> Mail: simon.xie@codewalker.me #> Created Time: Fri May 20 10:29:51 2016 #************************************************************************/ #!/bin/bash read -p “Input Password for remote Database: ” remoteDBP read -p “Input Password for local Database: ” localDBP REMOTEDB_NAME= REMOTEIP= LOCALDB_NAME= LOCALIP= exportHellomoney(){ echo “Downloading… wait a second…” mysqldump -h $REMOTEIP […]

vsftp translation error 500 issue illegal ports

For some reason couldn’t connect to vsftp from “out side”. Today something happened on new software and my workmate must go back to office. That’s a bad idea. But finally, I just solved and figured out why it’s happened. Just because of iptables problems. In .conf file of vsftpd. There’re some configuration lines must be […]

HOWTO SVN shows ERROR UUID does not match

SVN server shows me an error after Chinese New Year. Description : Repository UUID ‘f8fe39fa-cc5c-426a-9b6e-de096234f0a1’ doesn’t match expected UUID ‘f3dc4da7-9f31-4e67-aa99-e69c329e4832’ Suggestion : The operation could not be completed. To fix that issue you need to do those steps below. #1 To check current UUID of you svn repo. svnlook uuid /path/to/your/svn/repo It will show you […]