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/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew install carthage | |
cd MacPass | |
carthage bootstrap --platform macOS | |
xcodebuild -scheme MacPass -target MacPass -configuration Release CODE_SIGNING_REQUIRED=NO NO_SPARKLE=NO_SPARKLE |
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
# Referrence: https://gist.github.com/paladini/972d987cc5be189740737a5973eea4a3 | |
# Setup redis-cli without the whole Redis Server on AWS EC2 | |
sudo yum install gcc -y | |
wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli | |
redis-cli -h 192.268.34.32 |
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
// Function creation && Process Array in Sequence | |
const stopRDSMySQL = async ({DBInstanceIdentifier}) => { | |
try { | |
const rds = new AWS.RDS(); | |
const {DBInstances} = await rds.describeDBInstances({DBInstanceIdentifier}).promise(); | |
const listOfStoppedDBInstances = []; | |
if(!_.isEmpty(DBInstances)) { | |
for(const DBInstance of DBInstances) { | |
const {DBInstanceStatus, DBInstanceIdentifier} = DBInstance; | |
if(DBInstanceStatus === 'available') { |
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
# Clone new Project | |
mkdir -p project_folder | |
cd project_folder | |
git init | |
git clone https://user@passwordInUrlEncode@codeCommitGitHttpsURL | |
git fetch | |
# Edit current project | |
cd project_folder |
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
# Take snapshot of current volume | |
# Modify volume and Increase Size | |
# Access into Server that is using this EBS | |
df -h | |
sudo growpart /dev/xvdh 1 | |
sudo resize2fs /dev/xvdh1 |
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
## Using Dnsmasq for local development on OS X ## | |
## DNS & DHCP ## | |
# Installation | |
# Update your homebrew installation | |
brew up | |
# Install dnsmasq | |
brew install dnsmasq | |
# Configuration |
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
Problem: | |
``` | |
sudo pip install boto3 | |
The directory '/Users/tankhuu/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. | |
The directory '/Users/tankhuu/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. | |
Collecting boto3 | |
Downloading boto3-1.4.7-py2.py3-none-any.whl (128kB) | |
100% |████████████████████████████████| 133kB 837kB/s | |
Collecting s3transfer<0.2.0,>=0.1.10 (from boto3) | |
Downloading s3transfer-0.1.11-py2.py3-none-any.whl (54kB) |
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
PUT _snapshot/s3_repo | |
{ | |
"type": "s3", | |
"settings": { | |
"bucket": "bucket_name", | |
"base_path": "elasticsearch/snapshots" | |
} | |
} | |
GET /_snapshot/s3_repo |
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
# VARIABLES # | |
swapSize=4G | |
# EXECUTE # | |
# Check swap | |
sudo swapon -s | |
# Create swapfile | |
sudo fallocate -l $swapSize /swapfile | |
sudo chmod 600 /swapfile | |
ls -lh /swapfile |
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 | |
cat << EOF > ~/setup-aws-scripts-mon.sh | |
#!/usr/bin/env bash | |
# VARIABLES # | |
AWSAccessKeyId=\$1 | |
AWSSecretKey=\$2 | |
CRON_DIR=/var/spool/cron/crontabs | |
# EXECUTE # |