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
| <?php | |
| function progress($done, $total) { | |
| static $width; | |
| static $block = 0; | |
| if (! isset($width)) { | |
| $width = (int) exec('tput cols'); | |
| } |
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 | |
| # https://docs.docker.com/install/linux/docker-ce/centos/ | |
| # uninstall docker ce | |
| sudo yum remove -y docker-ce | |
| # delete all images, containers, and volumes | |
| #sudo rm -rf /var/lib/do | |
| # uninstall old versions |
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 | |
| mkdir -p /data/mysql /data/redis | |
| # mysql | |
| docker run --name mysql -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -v /data/mysql:/var/lib/mysql -d --restart unless-stopped mysql:5.7 --general-log=1 --general_log_file=general.log | |
| # redis | |
| docker run --name redis -p 6379:6379 -v /data/redis:/data -d --restart unless-stopped redis:4.0-alpine redis-server --appendonly yes |
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 | |
| mkdir -p /srv/goaccess/{data,html} | |
| curl -o /srv/goaccess/data/goaccess.conf.default https://raw.githubusercontent.com/allinurl/goaccess/master/config/goaccess.conf | |
| cp /srv/goaccess/data/goaccess.conf.default /srv/goaccess/data/goaccess.conf | |
| docker run --restart=always -d -p 7890:7890 \ | |
| -v "/srv/goaccess/data:/srv/data" \ |
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 | |
| mkdir -p /srv/goaccess/{data,html} | |
| curl -o /srv/goaccess/data/goaccess.conf.default https://raw.githubusercontent.com/allinurl/goaccess/master/config/goaccess.conf | |
| cp /srv/goaccess/data/goaccess.conf.default /srv/goaccess/data/goaccess.conf | |
| docker run --restart=always -d -p 7890:7890 \ | |
| -v "/srv/goaccess/data:/srv/data" \ |
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 | |
| mkdir -p /srv/goaccess/{data,html} | |
| curl -o /srv/goaccess/data/goaccess.conf.default https://raw.githubusercontent.com/allinurl/goaccess/master/config/goaccess.conf | |
| cp /srv/goaccess/data/goaccess.conf.default /srv/goaccess/data/goaccess.conf | |
| docker run --restart=always -d -p 7890:7890 \ | |
| -v "/srv/goaccess/data:/srv/data" \ |
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 | |
| mkdir -p /srv/goaccess/{data,html} | |
| curl -o /srv/goaccess/data/goaccess.conf.default https://raw.githubusercontent.com/allinurl/goaccess/master/config/goaccess.conf | |
| cp /srv/goaccess/data/goaccess.conf.default /srv/goaccess/data/goaccess.conf | |
| docker run --restart=always -d -p 7890:7890 \ | |
| -v "/srv/goaccess/data:/srv/data" \ |
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
| -- https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_unix-timestamp | |
| SELECT UNIX_TIMESTAMP('2015-11-13 10:20:19'); | |
| -- -> 1447431619 | |
| -- https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_from-unixtime | |
| SELECT FROM_UNIXTIME(1447430881, '%Y-%m-%d %H:%i:%s'); | |
| -- -> '2015-11-13 10:08:01' |
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
| # uniq line | |
| awk '!seen[$0]++ {print $0}' file | |
| # additional line | |
| awk 'FNR==NR{a[$0];next}!($0 in a)' old new |
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 | |
| # https://help.github.com/en/articles/linking-to-releases | |
| # https://stackoverflow.com/questions/24987542/is-there-a-link-to-github-for-downloading-a-file-in-the-latest-release-of-a-repo | |
| # https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8 | |
| curl -s https://api.github.com/repos/owner/name/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep asset-name | wget -qi - |