Skip to content

Instantly share code, notes, and snippets.

View esolitos's full-sized avatar

Marlon (Esolitos) Saglia esolitos

View GitHub Profile
#!/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
@esolitos
esolitos / luksFunctions.sh
Created August 12, 2017 10:48
Useful functions to (un)lock and (un)mount a Lucks device (a USB in this example)
#!/bin/sh
# Open and close secure key
secureUSBOpen () {
luksDev="$1"
luksName="$2"
mountPoint="/media/USB/${luksName}"
# Check if we have the right args
if [ $# -ne 2 ]; then
@esolitos
esolitos / drupal-auto-module-up.sh
Created August 2, 2017 09:48
Automatically updates a list of modules, asks for confirmation, and commits code changes. (has to be run from DRUPAL_ROOT)
#!/bin/bash
DRUSH=$(which drush)
GIT=$(which git)
if [ -z $DRUSH -o -z $GIT ]; then
echo "Missing drush!"
exit -1
fi
@esolitos
esolitos / wodby-s3-curate.py
Last active November 12, 2018 10:35
UNMAINTAINED - See `ramsalt/cron-scripts`
import os, sys, subprocess, re
from datetime import datetime, timedelta
if __name__ == '__main__':
now_date = datetime.today()
date_7days_ago = now_date - timedelta(days=7)
date_4weeks_ago = now_date - timedelta(weeks=4)
bucket_name = 'INSERT_AWS_S3_BUCKET_NAME_HERE'
@esolitos
esolitos / 0. README.md
Last active July 24, 2017 11:57
Find Drupal modules that are not installed, but on the filesystem and do some actions on it.

Find non-useful Drupal modules

This is a collection of scripts will find modules (non core) that are in the codebase which are not installed and report their path. It will skip submodules (using the "project" key in the module info).

@esolitos
esolitos / .bash_functions
Created July 22, 2017 11:28
MacOS X: Automatically swap php-fpm versions from brew
#!/bin/sh
#
# Swaps between php-fpm versions.
# This function assumes php binaries inslatted with brew
#
# @parameter Semplified php version number
# (eg. PHP 5.6 is simply 56, PHP7.0 is 70 and so on...)
#
php-fpm.swap-to() {
@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;
# Schema for the views plugins.
views.filter.project_size_range_select:
type: views_filter
label: 'Foobar numeric'
views.filter_value.project_size_range_select:
type: views.filter_value.numeric
label: 'Foobar Numeric'

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:

@esolitos
esolitos / checkDNS.sh
Last active May 11, 2017 11:57
This will check the A record both for the provided NameServer and for the domain's own NameServer.
#!/bin/sh
#
# This will check the A record both for the provided NameServer
# and for the domain's specified NS
#
if [ "$1" = "--help" -o "$1" = "-h" ]; then
echo "\nUsage:"
echo "$0 \$NS_IP domain1.tld domain2.tld ..."
echo "Example: $0 8.8.8.8 google.com example.com\n"