sed -i -E 's/^SELINUX=(.*)/SELINUX=disabled/g' /etc/sysconfig/selinux
setenforce 0
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 epel-release yum-utils -y | |
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y | |
yum-config-manager --enable remi-php72 | |
yum install php-cli php-fpm php-mysql php-json php-opcache php-mbstring php-xml php-gd php-curl -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 | |
apt-get remove apparmor -y | |
wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb -P /tmp/ | |
dpkg -i /tmp/percona-release_latest.generic_all.deb | |
apt-get update | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get install percona-xtradb-cluster-57 -y -q |
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 | |
if [ $# -ge 2 ] | |
then | |
dom=`basename $1 .txt` | |
mkdir -p /tmp/$dom/ | |
CERT="/tmp/$dom/$dom.crt" | |
KEY="/tmp/$dom/$dom.key" | |
else | |
echo -e "Usage: $0 tenten.vn.txt <alpha,ov,dv,ev>\nNote: The extention file must be .txt - Example: tenten.vn.txt" | |
exit 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
#!/bin/bash | |
### | |
# | |
# 1. Gateway | |
# 2. Subnet mask | |
# 3. IP1 | |
# ... | |
# n. IPn |
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 | |
echo "Hello world!" |
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 smtplib | |
import os | |
import sys | |
import urllib | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
from email.header import Header | |
# Get argurment | |
data, recipient, subject = sys.argv[1:4] |
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 | |
BACKUP_DIR="/opt/backup" | |
mkdir -p ${BACKUP_DIR} | |
## Get all databases on system | |
USER="root" | |
PASSWORD="" | |
DBS=`mysql -u ${USER} -p${PASSWORD} -sNe "SHOW DATABASES;" | grep -Ev "information_schema|performance_schema|mysql|test"` | |
for DB in ${DBS} |
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 boto3 | |
from datetime import datetime, timedelta | |
# Requeriment | |
## python2.7, boto3 (pip install boto3) | |
## ~/.aws/credentials - Contain your credentail (API, Secret) | |
## ~/.aws/config - Contain your config (Region,...) | |
## More details: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html | |
# Upload a file into Bucket |
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 | |
FILE=$1 | |
if [ -e $FILE ] | |
then | |
cat $FILE | while read -r l | |
do | |
text=`echo $l | sed "s/(//g; s/'//g; s/)//; s/;//g; s/)//g; s/,//g"` | |
USER=$(echo $text | awk '{print $1}') |