Skip to content

Instantly share code, notes, and snippets.

@nadar
nadar / cloudflare-block-wp.md
Last active March 17, 2024 16:16
Cloudflare WAF Block Wordpress Requests

The main purpose of this site is to block out requests which target on Wordpress Sites, BUT WE DONT USER WORDPRESS!

(http.request.uri contains "wp-login") or 
(http.request.uri contains "xmlrpc.php") or 
(http.request.uri contains "shell.php") or 
(http.request.uri contains "repeater.php") or 
(http.request.uri contains "wp-admin") or 
(http.request.uri contains "ccx") or 
(http.request.uri contains "wp-content") or 
@nadar
nadar / mailjet_sections_bulk_delete.php
Created September 12, 2022 08:23
Mailjet Sections Cleanup
<?php
$username = 'API_KEY';
$password = 'API_KEY_SECRET';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.mailjet.com/v3/REST/template?EditMode=3&OwnerType=apikey&limit=200');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password);
@nadar
nadar / date-to-strftime.md
Last active September 7, 2023 08:16
PHP 8.1 strftime to date

PHP 8.1 Migrate table from strftime to date

strftime date example
%d d 09
%m m 02
%Y Y 2022
%B F January
%b M Jan
%a D Son
@nadar
nadar / example.json
Created November 24, 2021 12:29
example.json
[
{"name":"John"},
{"name":"Jane"}
]
@nadar
nadar / remote.jsx
Last active November 24, 2021 13:49
remote.jsx
var flyo = {
fn: function() { alert("hoi") },
xml: "https://www.w3schools.com/xml/note.xml",
getData: function() {
var rawxml = app.doScript("do shell script \"curl 'remoteCode'\"".replace("remoteCode", this.xml), ScriptLanguage.APPLESCRIPT_LANGUAGE);
return new XML(rawxml);
}
}
@nadar
nadar / assumption.php
Created November 4, 2019 10:08
assumption.php
<?php
class MyAction extends BaseAction
{
public function route(): string
{
return '/call-this-server';
}
public function run(array $params): \Heartbeat\RPA\ActionResponse
@nadar
nadar / activedataprovider.php
Last active July 30, 2019 09:57
activedataprovider.php
<?php
class SearchModel extends \yii\base\Model
{
public $suchen;
public function rules()
{
return [['suchen'], 'string'];
}
@nadar
nadar / gist:0dbc0d84df486b83fb4b9b4ee3f2deeb
Created December 19, 2018 13:48
Amazone ELB Webserver https information
apache:
SetEnvIf x-forwarded-proto https HTTPS=on
@nadar
nadar / Dynamic Detach After Find Event.php
Last active August 13, 2017 11:35
Dynamic Detach After Find Event
<?php
// Model
class MyText extends \yii\db\ActiveRecord
{
public $unserialize = true;
public function behaviors()
{
$behaviors = []
@nadar
nadar / Windows 10 Linux Subsystem Setup.md
Last active August 4, 2017 11:53
Windows 10 Linux Subsystem and GitHub Setup

Aug, 2017 => https://insights.ubuntu.com/2017/08/03/upgrading-your-ubuntu-on-windows-install-to-the-app-version/

How to setup a Windows 10 Computer with Linux Subsystem, GitHub, Apache2 and PHP.

  1. Install the Linux Subsytem
  2. Installing Apache & PHP (sudo apt-get install apache2 libapache2-mod-php7.0 php7.0 php7.0-mysql mysql-server) a. PhpMyAdmin https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-16-04
  3. Install Eclipse an create a Folder on the C: Partion Root winwww which your eclipse Workspace is located.
  4. Create Symlink from Subsystem to NTFS Partition a. cd /var/www/html