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
SELECT | |
CONCAT(FORMAT(DAT/POWER(1024,pw1),2),' ',SUBSTR(units,pw1*2+1,2)) DATSIZE, | |
CONCAT(FORMAT(NDX/POWER(1024,pw2),2),' ',SUBSTR(units,pw2*2+1,2)) NDXSIZE, | |
CONCAT(FORMAT(TBL/POWER(1024,pw3),2),' ',SUBSTR(units,pw3*2+1,2)) TBLSIZE | |
FROM | |
( | |
SELECT DAT,NDX,TBL,IF(px>4,4,px) pw1,IF(py>4,4,py) pw2,IF(pz>4,4,pz) pw3 | |
FROM | |
( | |
SELECT data_length DAT,index_length NDX,data_length+index_length TBL, |
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
drop table if exists optlog1; | |
CREATE TABLE `optlog1` ( | |
`object` varchar(255) DEFAULT NULL, | |
`objectId` int(11) DEFAULT NULL, | |
`action` varchar(255) DEFAULT NULL, | |
`log` varchar(255) DEFAULT NULL, | |
`cabinet` varchar(255) DEFAULT NULL, | |
`org` int(11) DEFAULT NULL, | |
`uid` varchar(255) DEFAULT NULL, |
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
show table status from hi_db_schema where name = 'optlog1'; |
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 | |
# from http://unix.stackexchange.com/questions/18209/detect-init-system-using-the-shell | |
if [[ `/sbin/init --version` =~ upstart ]]; then echo using upstart; | |
elif [[ `systemctl` =~ -\.mount ]]; then echo using systemd; | |
elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then echo using sysv-init; | |
else echo cannot tell; fi |
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 | |
aflag=no | |
bflag=no | |
flist="" | |
set -- $(getopt abf "$@") | |
while [ $# -gt 0 ] | |
do | |
case "$1" in | |
-a) echo 1;; | |
-b) echo 2;; |
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 bash | |
# | |
# @version : 0.0.1 | |
# | |
##################### | |
# Global Configuration | |
set -o pipefail | |
set -o errexit |
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
# check whether git is installed | |
command -v git >/dev/null 2>&1 || { echo >&2 "git is required but it's not installed. Aborting."; exit 1; } | |
# check node | |
check_node=$(which node); | |
if [[ -z $check_node ]]; | |
then | |
# install_node | |
else | |
echo 'Node Already Installed'; |
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 bash | |
# This file is to setup nginx for php application | |
# @Version : 0.0.1 | |
# @Usage : ./setup.sh [appname] [server_name] [port] [fpm_port] | |
# @Example : ./setup.sh oa_attr attr.meikecheng.com 80 9023 | |
# | |
set -o pipefail | |
set -o errexit | |
# set -o xtrace |
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 bash | |
# This file is to setup nginx for php application | |
# | |
# @Version : 0.0.1 | |
# @Usage : tpl.sh template | |
# can not be used to render bash script, use sed instead | |
# | |
set -o pipefail | |
set -o errexit | |
# set -o xtrace |
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 bash | |
# | |
# help function | |
# | |
# @version : 0.0.1 | |
# | |
# | |
############################################# | |
function help () { | |
echo -e "\033[1m${1}\033[0m" 1>&2 |