Skip to content

Instantly share code, notes, and snippets.

View lecoueyl's full-sized avatar
🕶️
‌‌

Léonard Lecouey lecoueyl

🕶️
‌‌
View GitHub Profile
#!/bin/sh -e
#
# Install node_exporter for linux-amd64
# Usage: curl -sSL https://gist.githubusercontent.com/lecoueyl/ebc747f91f386db14c6b5cb71f007fd5/raw/node-exporter-installer.sh | sudo sh
#
#
# Source: https://github.com/ClouDesire/node-exporter-installer
EXPORTER_VERSION=0.17.0
RELEASE=node_exporter-${EXPORTER_VERSION}.linux-amd64
@lecoueyl
lecoueyl / wp-backup.sh
Last active March 13, 2018 06:23
Bash script to backup a wordpress folder and database then transfert it to google storage (optional)
#!/usr/bin/env bash
# Archive a wordpress folder with is database
# Usage: ./wp-backup.sh -s '/my/wordpress/folder' -d $HOME -g 'my-google-space-bucket'
#
#
# Source: https://gist.githubusercontent.com/lecoueyl/0cf49d38fa0b0205f51ca9db75b1f548/raw
set -o pipefail
set -o nounset
@lecoueyl
lecoueyl / deploy.sh
Last active November 24, 2017 04:57
Single remote server automation deployment
#!/usr/bin/env bash
# Single remote server automation deployment
set -o pipefail
set -o nounset
# Options
################################################################################
@lecoueyl
lecoueyl / .bash_alias
Created November 21, 2017 06:23
Bash alias
alias webcode="curl -o /dev/null --silent --head --write-out '%{http_code}\n'"
@lecoueyl
lecoueyl / aws_hosts_completion
Created July 4, 2017 05:32
AWS ec2 instances hostname ssh completion
#
# Autocomplete a ssh command with AWS instances hostname
# Put this file in /etc/bash_completion.d/ (Ubuntu)
#
# File containing ec2 instances hostname
HOSTS=/tmp/aws_hosts_list
_ssh_hosts()
{
@lecoueyl
lecoueyl / rbenv-install-system-wide.sh
Created January 5, 2017 01:17
rbenv-install-system-wide.sh
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
git clone https://github.com/rbenv/ruby-build.git /usr/local/rbenv/plugins/ruby-build
# Add rbenv to the path:
echo '# rbenv setup - only add RBENV PATH variables if no single user install found' > /etc/profile.d/rbenv.sh
echo 'if [[ ! -d "${HOME}/.rbenv" ]]; then' >> /etc/profile.d/rbenv.sh
echo ' export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
echo ' export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
echo ' eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh