Skip to content

Instantly share code, notes, and snippets.

View esolitos's full-sized avatar

Marlon (Esolitos) Saglia esolitos

View GitHub Profile
@esolitos
esolitos / Drupal8Placeholders.md
Created August 30, 2018 19:42
Placeholder strategies in Drupal 8
@esolitos
esolitos / d7--twilio_poll--rule-export.json
Created August 3, 2018 11:27
Example: Drupal 7 Twilio Poll + Rules
{ "rules_sms_vote" : {
"LABEL" : "SMS Vote",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "twilio_poll", "twilio" ],
"ON" : { "twilio_sms_incoming" : [] },
"IF" : [ { "twilio_poll_rules_is_valid_sms_poll" : { "sms" : [ "sms" ] } } ],
"DO" : [
{ "twilio_poll_rules_load_poll_from_sms" : {
"USING" : { "string" : [ "sms" ] },
@esolitos
esolitos / test-ansible-role.sh
Last active June 29, 2018 14:37 — forked from samdoran/test-ansible-role.sh
Script for testing an Ansible role in containers
#!/bin/bash
# Test Ansile role inside container
#
# Inspired by the wonderful work of Jeff Geerling (@geerlingguy)
# https://gist.github.com/geerlingguy/73ef1e5ee45d8694570f334be385e181
# and @samdoran
# https://gist.github.com/samdoran/c3d392ee697881fa33a1d1a65814a07b
# Colors
RED='\033[0;31m'
[global]
daemonize = no
include=/usr/local/etc/php/7.1/php-fpm.d/*.conf
@esolitos
esolitos / 0.DRCMD.README.md
Last active May 4, 2022 14:27
Drush command "executor" on alias pattern. Built for Wodby aliases naming standard, but can work on other setups.

DrCmd - DrushComander

drush command runner for Wodby aliases

0. Install

Save the file in /usr/local/bin/ (or anywhere else as long as it is in your $PATH) and verify that it is executable.

a. Right click on "Raw" button (for drcmd) and copy the URL.

#!/bin/bash
BASE_DIR=/media/data/plex
DIR_MOVIES="$BASE_DIR/Movies"
DIR_SERIES="$BASE_DIR/TV.Series"
ACTIVE_TORRENTS="$(transmission-remote 195.154.136.195:4949 -l | tr -s ' ' | cut -d' ' -f11-)"
is_active_torrent()
{
<?php
$sshd_conf = file_get_contents('/etc/ssh/sshd_config')
?>
<h2>Before</h2>
<pre>
<?php var_dump($sshd_conf) ?>
</pre><?php
@esolitos
esolitos / dnsmasq.conf
Last active June 7, 2018 12:15
Local dnsmasq config
# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
domain-needed
bogus-priv
stop-dns-rebind
clear-on-reload
@esolitos
esolitos / splash.html
Created September 10, 2017 13:20
Just a generic splash page with some interesting twist. Source: https://codepen.io/daviddarnes/pen/RGbGVR
<html>
<head>
<title>Welcome | Esolitos Hosting</title>
<meta name="robots" content="noindex">
<style type="text/css" media="screen">
@import 'https://fonts.googleapis.com/css?family=Abel|Droid+Sans|Droid+Serif|Lato|Open+Sans|Roboto';
html, body {margin:0;padding:0;overflow:hidden;}
/* Example row */
@esolitos
esolitos / mysql-all-backup.sh
Created September 6, 2017 06:23
backup all databases
#!/bin/bash
USER="root"
PASSWORD=""
OUTDIR="`basename $1`"
if [ -z "$OUTDIR" ]; then
echo "Specify an output directory"
exit 1;
fi