This file contains 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=/home/ubuntu/mysql_backup/mysql-credentials.cnf | |
if [ -f "$FILE" ]; then | |
echo "$FILE exists." | |
rm $FILE | |
else | |
echo "$FILE does not exist." | |
fi | |
credentialsFile=/home/ubuntu/mysql_backup/mysql-credentials.cnf |
This file contains 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
# Let us consider the following typical mysql backup script: | |
mysqldump --routines --no-data -h $mysqlHost -P $mysqlPort -u $mysqlUser -p$mysqlPassword $database | |
# It succeeds but stderr will get: | |
# Warning: Using a password on the command line interface can be insecure. | |
# You can fix this with the below hack: | |
credentialsFile=/mysql-credentials.cnf | |
echo "[client]" > $credentialsFile | |
echo "user=$mysqlUser" >> $credentialsFile | |
echo "password=$mysqlPassword" >> $credentialsFile |
This file contains 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 yaml | |
import gitlab | |
from prettytable import PrettyTable | |
############################# | |
# THIS SCRIPT WILL PRINT THE SHORT COMMIT_ID,AUTHOR,DATE,TITLE OF COMMIT FROM GITLAB API | |
############################## | |
########################################################################################### | |
# 1. Create the personal access token in the gitlab profile settings then user in th eprivate_token |
This file contains 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
Key Sublime Text 3.2.1 Build 3207 | |
----- BEGIN LICENSE ----- | |
Member J2TeaM | |
Single User License | |
EA7E-1011316 | |
D7DA350E 1B8B0760 972F8B60 F3E64036 | |
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD | |
FA0A2ABE 25F65BD8 D51458E5 3923CE80 | |
87428428 79079A01 AA69F319 A1AF29A4 | |
A684C2DC 0B1583D4 19CBD290 217618CD |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$init = <<-SHELL | |
yum update -y | |
# SELinux 無効 | |
setenforce 0 | |
sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config | |
# firewall 無効 | |
systemctl disable --now firewalld |
This file contains 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 | |
name=beta | |
disk=4096 | |
swap=1024 | |
mem=4096 | |
suite=precise | |
ip="192.168.199.199" | |
cpu=8 |
This file contains 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: autossh | |
# DESCRIPTION: This is an SSH-D proxy with auto-reconnect on disconnect | |
# AUTHOR: Hector Nguyen (hectornguyen at octopius dot com) | |
# VERSION: 1.0.0 | |
# ------------------------------------------------------------------------------ | |
VERSION="1.0.0" | |
GITHUB="https://github.com/hectornguyen/autossh" | |
AUTHOR="Hector Nguyen" |
This file contains 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 | |
# exit when the command fails | |
set -o errexit; | |
# exit when try to use undeclared var | |
set -o nounset; | |
accessKeyToSearch=${1?"Usage: bash $0 AccessKeyId"} |
This file contains 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
#use libvirt | |
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt' | |
VMCOUNT = (ENV['VMCOUNT'] || 1).to_i | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.require_version ">= 1.5.0" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "virtualbox" |
This file contains 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 | |
#title : updateSonarProps.sh | |
#description : | |
# This script parses the project's name and version from its package.json and automagically | |
# updates the version and package name in the SonarQube configuration properties file. | |
# It can be used as a pre step before running the sonar-scanner command | |
# It also creates a backup of the props file with suffix *.bak | |
#prerequisites : NodeJS based project with package.json, sonar*.properties file in the cwd | |
#author : Christian-André Giehl <christian@emailbrief.de> | |
#date : 20180220 |