Skip to content

Instantly share code, notes, and snippets.

View adrianodias8's full-sized avatar

Adriano Dias adrianodias8

  • Brussels
View GitHub Profile
@adrianodias8
adrianodias8 / settings.local.php
Created March 9, 2022 16:15 — forked from davidjguru/settings.local.php
Drupal 8 Redis settings.local.php
<?php
/**
* Set redis configuration.
*/
/** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */
if (extension_loaded('redis')) {
// Set Redis as the default backend for any cache bin not otherwise specified.
// $settings['cache']['default'] = 'cache.backend.redis';
@adrianodias8
adrianodias8 / query_with_bindings.php
Created January 21, 2022 11:05
Laravel Print query with bindings
<?php
dd(vsprintf(str_replace('?', '%s', $query->toSql()), collect($query->getBindings())->map(function ($binding) {
return is_numeric($binding) ? $binding : "'{$binding}'";
})->toArray()));
Locate directory GoBuster
- gobuster dir -u http://10.10.239.220:3333 -w /usr/share/wordlists/dirbuster/directory-list-1.0.txt
Compromise server with burp
- upload file with burp browser
- send request to intruder + in positions select sniper attack add § to file extension
- in payloads add list of file extensions to test + disable payload encoding (at least for this playground)
Serch for SUID (set owner userId upon execution)
- find / -user root -perm -4000 -exec ls -ldb {} \;
@adrianodias8
adrianodias8 / cnt_description_pathauto_alias_alter.php
Created March 4, 2021 15:31
cnt_description_pathauto_alias_alter
<?php
/**
* Implements hook_pathauto_pattern_alter().
*/
function cnt_description_pathauto_alias_alter(&$alias, array &$context) {
if ($context['module'] == 'node' && ($context['bundle'] == 'cnt_description')) {
$exploded_alias = explode('/',substr($alias, 1));
$exploded_alias[0] = preg_replace([
'/policy/',
# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true
auto_reload: true
cache: false
@adrianodias8
adrianodias8 / gist:9125e94862e93ff61a72140ef9ad01b1
Created August 6, 2020 17:31
UserSubscriptionsController update()
public function update(Univers $univers, User $user) {
Gate::authorize('user-subscriptions-edit', [$user, $univers]);
$validatedData = $this->validateUpdateRequest();
$subscriptionValid = (int)Code::getCodeByName('Valid', 'code_short', 'Subscription Status')->code_id;
$subscriptionInvalid = (int)Code::getCodeByName('Not Valid', 'code_short', 'Subscription Status')->code_id;
$formatHTML = (int)Code::getCodeByName('HTML', 'code_short', 'SV format')->code_id;
$frequencyOnDemand = (int)Code::getCodeByName('On Demand', 'code_short', 'SV frequency')->code_id;
// $validSubscriptions = $user->subscriptions()->where(['seus_unsubscription_date' => null, 'seus_status' => $subscriptionValid])->get();
// $services = $this->getServices($univers, null, $validSubscriptions);
diff --git a/cas.tokens.inc b/cas.tokens.inc
index 97aea2b..b0eb797 100644
--- a/cas.tokens.inc
+++ b/cas.tokens.inc
@@ -29,6 +29,10 @@ function cas_token_info() {
'name' => t('Login URL'),
'description' => t('The CAS login URL.'),
],
+ 'login-url-absolute' => [
+ 'name' => t('Login URL (absolute)'),
@adrianodias8
adrianodias8 / turbo.sh
Created July 2, 2020 00:06
projects turbo v1
#!/bin/bash
# This is the turbo mode for my dev enviroment.
# This creates ~/ramdisk dir mounts a tmpfs partion for current project location.
# Props to Stavros Kounis for idea.
# ===== Functions START =====
func_hello()
{
@adrianodias8
adrianodias8 / gist:0e739b087d2302cdefcfb7ea7ab60143
Created June 18, 2020 08:54
Trace message_digest_ui install clean error.
In EntityType.php line 922:
[LogicException]
Missing bundle entity, entity type flag, entity id email_node.
Exception trace:
at /home/adriano/Documents/_DEV/futuriumd8/web/core/lib/Drupal/Core/Entity/EntityType.php:922
Drupal\Core\Entity\EntityType->getBundleConfigDependency() at /home/adriano/Documents/_DEV/futuriumd8/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php:306
Drupal\Core\Entity\EntityDisplayBase->calculateDependencies() at /home/adriano/Documents/_DEV/futuriumd8/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:318
@api @javascript @notifications @this
Feature: Notificatios
As an group manager I should be notified of new content
Background:
Given the cache has been cleared
Given I am logged in as a user with the administrator role
Given a group of type "fut_open"
| label | Broadband networks |
| fut_short_name | Group Name |