Skip to content

Instantly share code, notes, and snippets.

View delpinoconsulting's full-sized avatar

Pablo del Pino delpinoconsulting

View GitHub Profile
@delpinoconsulting
delpinoconsulting / awscli.txt
Created October 13, 2017 19:42
Installing AWSCLI on MacOSX
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
#!/bin/bash
# Install UniFi Controller. Check CentOS 7 (7.0.1406)
# Date: 28/02/2016
# Step 1. Add mongo-db repo
cat <<EOF > /etc/yum.repos.d/mongodb.repo
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap sw 0 0" >> /etc/fstab
@delpinoconsulting
delpinoconsulting / find.sh
Created July 29, 2019 16:55
Script to find files older than 6 hours
find $LOCATION -name $REQUIRED_FILES -type f -mmin +360 -delete
@delpinoconsulting
delpinoconsulting / awscli-copyimage.sh
Created July 29, 2019 17:03
A script to copy AMI to another account
aws ec2 modify-image-attribute --image-id ami-0abcdef1234567890 --launch-permission "Add=[{UserId=123456789012}]"
# Install and create certificates
certbot-auto certonly -d *.domain.com -d domain.com --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns
# Install Unison
sudo apt install unison
# Install Fsmonitor
sudo pip install fsmonitor
# /etc/systemd/system/unison@.service
# Starts unison with the .prf-config of your choice
# Create a unison .prf-config such as
# https://gist.github.com/thunfischbrot/3efbd4a87785615a61e4f5fd875f2699
# /root/.unison/10Documents.prf
# Create one config file for each folder, or add one per
# root folder and add subfolders via
# path = 10Documents
# path = 20Media
# To make this unison job load at machine startup use an init-script
# or systemd service such as
# https://gist.github.com/thunfischbrot/0b6a21a84f166c4fa74fc5df4a470b17
# local root to sync
@delpinoconsulting
delpinoconsulting / td-agent.txt
Created March 4, 2020 22:40
Install td-agent on beanstalk
1. Install from curl -L https://toolbelt.treasuredata.com/sh/install-amazon1-td-agent3.sh | sh
2. Run td-agent-gem install fluent-plugin-http
3. Replace `endpoint` with `url` on the `match` section
4. Profit!