Skip to content

Instantly share code, notes, and snippets.

View esolitos's full-sized avatar

Marlon (Esolitos) Saglia esolitos

View GitHub Profile
@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'
@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 / mysql_maxtables.sh
Last active May 24, 2018 08:30
Test the creation
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $(basename $0) NUM_TABLES"
echo "(Test with 2500 or more tables and up to get real reference)"
exit 1;
fi
if [ $(id -u) -ne 0 ]; then
echo "Please run this command as root or via sudo"
exit 1;

Keybase proof

I hereby claim:

  • I am esolitos on github.
  • I am esolitos (https://keybase.io/esolitos) on keybase.
  • I have a public key ASAV7r2_3TBlg4Z7zLhvnQLTboUNBtqTdhXyuXqms99L7Ao

To claim this, I am signing this object:

[global]
daemonize = no
include=/usr/local/etc/php/7.1/php-fpm.d/*.conf
#!/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 / 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
#!/bin/sh
branchname="hotfix/SA-CONTRIB-2017-068"
cd $1;
for repos in $(ls); do
echo;
echo "########## Starting with with $repos";
if [ $(grep -c 'core = 7.x' $repos/web/modules/update/update.info) -eq 1 ]; then
cd $repos;
if [ $(git status | grep -c 'nothing to commit') -ne 1 ]; then