Skip to content

Instantly share code, notes, and snippets.

@davidjguru
davidjguru / Get Drupal basic info by Drush
Last active March 5, 2019 14:02
Inspecting Drupal with Drush
## Got to the Project Folder (usually in /var/www/html within Apache) and launch:
echo -e "\n\nSize in disk for this Drupal: " && du -sh ./ && echo -e "\n\nBasic General Report about Drupal: \n\n" && drush status && echo -e "\n\nGeneral Package Installed Report: \n\n" && drush pm-list && echo -e "\n\nOnly Enabled Modules in Drupal: \n\n" && drush pm-list --status="enabled" && echo -e "\n\nAnd now, only Disabled Modules in this Drupal now: \n\n" && drush8 pm-list --status="disabled" && echo -e "\n\nGet a list about Enabled Modules in this Drupal but out of the core: \n\n" && drush8 pm-list --type=module --status=enabled --no-core
@danisla
danisla / terraform-install.sh
Last active July 15, 2024 13:36
Terraform latest version install script
#!/bin/bash
function terraform-install() {
[[ -f ${HOME}/bin/terraform ]] && echo "`${HOME}/bin/terraform version` already installed at ${HOME}/bin/terraform" && return 0
LATEST_URL=$(curl -sL https://releases.hashicorp.com/terraform/index.json | jq -r '.versions[].builds[].url' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | egrep -v 'rc|beta' | egrep 'linux.*amd64' |tail -1)
curl ${LATEST_URL} > /tmp/terraform.zip
mkdir -p ${HOME}/bin
(cd ${HOME}/bin && unzip /tmp/terraform.zip)
if [[ -z $(grep 'export PATH=${HOME}/bin:${PATH}' ~/.bashrc) ]]; then
echo 'export PATH=${HOME}/bin:${PATH}' >> ~/.bashrc
@eoldavix
eoldavix / galera_stretch.md
Last active July 28, 2017 09:23
Clúster MariaDB con Galera en Debian 9 Stretch

Clúster MariaDB con Galera en Debian 9 Stretch from scratch

Todos los pasos a continuación se realizan como usuario root

Suponiendo dos servidores con IP's 10.1.0.1 (galera1) y 10.1.0.2 (galera2), la instalación de un cluster MariaDB es bien sencilla.

  • Instalamos mariadb-server en nuestros nodos: apt install mariadb-server
  • Paramos el servicio mariadb.service en todos los nodos: systemctl stop mariadb.service
@so0k
so0k / kubectl.md
Last active February 4, 2025 17:16
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@rafaeltuelho
rafaeltuelho / openshift-cheatsheet.md
Last active December 5, 2025 14:24
My Openshift Cheatsheet

My Openshift Cheatsheet

List all non openshift/kube namespaces

requires jq CLI

oc get namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and (true)) | .metadata.name ]'

Project Quotes, Limits and Templates

@Tab3r
Tab3r / installwildfly9Ubuntu1404.sh
Last active November 11, 2021 14:53
Install wildfly 9.x in Ubuntu 14.04 LTS
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
# General utils
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install unzip
sudo apt-get -y install software-properties-common python-software-properties
@chales
chales / db-connect-test.php
Last active March 29, 2025 09:10
Script for a quick PHP MySQL DB connection test.
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/
---
- hosts: alpine_install
user: root
tasks:
# - name: create a complete empty file
# command: /usr/bin/touch /test/test.conf
- name: create a new file with lineinfile
@atufkas
atufkas / migrate_mysq4to5.sh
Last active March 5, 2025 09:51
Converting MySQL4 database dump syntax to MySQL5
#
# MIGRATE MySQL4 DATABASES TO MySQL5 - Steps for dumping and converting
#
# Uses mysqldump and patches output to be compatible with MySQL 5.5+ (? - no sure
# at which specific release of MySQL 5 the old style syntax support ended).
#
# Conversion is most likely incomplete. This script provides replacement routines
# based on what I stumbled upon when migrating a couple of databases.
#
# Use on own risk, always try with test databases first. No warranty at all!