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 | |
wget -qP /tmp/ https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | |
cd /tmp | |
tar -xf /tmp/ffmpeg-release-amd64-static.tar.xz | |
cp -R /tmp/ffmpeg-*/ff* /usr/local/sbin/ | |
rm -rf /tmp/ffmpeg-* | |
curl -sL https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl | |
chmod a+rx /usr/local/bin/youtube-dl |
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 | |
encrypt(){ | |
echo -n "$1" | md5sum | awk {'print $1'} | |
# echo -n "$1" | openssl md5 | awk {'print $2'} | |
} | |
RAW="$1" | |
encrypt $RAW |
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 | |
timedatectl set-timezone Asia/Ho_Chi_Minh | |
yum install ntp -y | |
ntpdate pool.ntp.org |
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 | |
yum install -y yum-utils device-mapper-persistent-data lvm2 | |
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
yum install docker-ce docker-ce-cli containerd.io -y | |
systemctl start docker | |
systemctl enable docker | |
curl -sLk "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose |
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 | |
cat > /etc/yum.repos.d/mariadb.repo << EOF | |
[mariadb] | |
name = MariaDB | |
baseurl = http://yum.mariadb.org/10.3/centos73-amd64/ | |
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB | |
gpgcheck=1 | |
EOF |
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 | |
dur=`ffprobe -v error -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 "$1" | head -n 1` | |
## Chinh so phut o $parts, $t va 2 cau lenh cut | |
flag=`echo "$dur > 3600" | bc` | |
name=`echo $1 | tr '.' ' ' | awk {'print $1'}` | |
if [ $flag = "1" ] | |
then |
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 | |
SERVER=$1 | |
STATUS=$(curl -sL -o /dev/null -w "%{http_code}" $SERVER) | |
case $STATUS in | |
200) | |
echo "$SERVER is still running." | |
exit 0 | |
;; | |
*) | |
echo "$SERVER is not running." |
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 | |
compare(){ | |
file1="$1" | |
file2="$2" | |
count_m=0 | |
count_mn=0 | |
### So sanh phan zmlocalconfig | |
cat "$file1" "$file2" | grep -E "^zimbra.*"| awk {'print $1'} | sed 's/://' | sort -u | while read -r l; |
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 | |
apt-get update -y | |
apt-get install -y apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
apt-get update -y |
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 | |
yum install -y epel-release | |
yum install -y certbot | |
echo -e "Usage:\nGenerate: certbot certonly --webroot /web/root -d domain.com\nRenew: certbot renew --cert-name" |