Skip to content

Instantly share code, notes, and snippets.

View shanept's full-sized avatar

Shane Thompson shanept

View GitHub Profile
setTimeout(function() {}, 1000);
var snmp = require ("./git/node-net-snmp/lib/");
var target = '127.0.0.1';
var version = snmp.Version3;
var oids = ['1.3.6.1.2.1.1.1.0'];
var session = snmp.createSession (target, {
@shanept
shanept / Makefile
Created January 31, 2017 18:01
Arduino Uno makefile
############################################################################
# TARGET: Target build directory
# INSTALL_DIR: Arduino IDE installation directory
# PORT: Arduino board port
#
# Retrieve the following data from:
# $(INSTALL_DIR)/hardware/arduino/avr/boards.txt
#
# UPLOAD_SPEED, UPLOAD_PROTOCOL, BUILD_MCU, BUILD_F_CPU, VARIANT
############################################################################
@shanept
shanept / captcha.js
Created June 11, 2018 05:13
hackers.gg captcha challenge
/*
// Only use this one to get SVG codes from the captcha image, and populate the below codes list
(function() {
var paths = document.querySelectorAll("path:not([fill='none'])");
var code = "";
for (var p in paths) {
if (!paths.hasOwnProperty(p)) continue;
var idx = paths[p].getAttribute('d');
idx = idx.replace(/[^A-Z]+/g, '');
@shanept
shanept / backup.ps1
Last active June 17, 2019 01:04
SQL Server backup script
# Set these variables to the desired values
$SqlServer="SqlHost" # Server Hostname
$InstanceName="DbInst" # Database Instance
$Username="MyUser" # Username with backup permissions
$Database="EpicDB" # Name of database to backup
$LocalDir="C:\DB" # Local directory to use whilst creating backup
$Location="\\storage\EpicDB" # Location to move backup file to. Can be UNC or file path
#############################################
# Don't touch anything beyond this point... #
<?php
// Get the following into a theme or plugin, and WordPress will behave as if DISALLOW_FILE_EDITS is set to false instead of true.
// Hooks WP capability system to override the do_not_allow signal.
function __wpide_override_fsmethod( $caps, $cap, $user_id, $args ) {
if ( in_array( $cap, array( 'edit_themes', 'edit_files', 'edit_plugins' ) ) ) {
array_pop( $caps );
$caps[] = $cap;
}
(function() {
var formats = ytplayer.config.args.raw_player_response.streamingData.adaptiveFormats;
formats.sort(function(a, b) {
if (a.width > b.width) return -1;
if (a.width < b.width) return +1;
return 0;
});
window.open(formats[0].url);
@shanept
shanept / gist:f63d22cd653728f87bea
Created July 25, 2014 07:45
XMLRPC Brute Force Exploit
<?php
// This code is released into the public domain.
// I will not be held responsible for what this code does.
// I release myself of all legal responsibilites to this code.
/** These links helped in figuring this all out :)
* wp_xmlrpc_server::login
* https://core.trac.wordpress.org/browser/tags/3.9.1/src/wp-includes/class-wp-xmlrpc-server.php#L182
*
* Support Forum link
@shanept
shanept / vimeo-dash.js
Last active June 4, 2023 05:32
Vimeo DASH stream downloader
/***
* This will create 2 separate files:
* - Vimeo Rip.mp4 - The video file
* - Vimeo Rip.mp4a - The associated audio
*
* This is by Vimeo's design. These files simply need to be merged.
* The following ffmpeg command may be used:
*
* ffmpeg -i ".\Vimeo Rip.mp4" -i ".\Vimeo Rip.mp4a" -c copy output.mp4
*/
@shanept
shanept / vimeo.js
Last active June 4, 2023 08:52
Get Vimeo URLs
(function(){
// Quick check to make sure we are in a vimeo document
if (window.location.host !== 'player.vimeo.com') {
console.error('Not in a vimeo player document. Try again...');
return;
}
if (!window.playerConfig) {
// Vimeo URLs are stored in a script tag after the player element in the body
var s = document.getElementById("player").nextElementSibling;
@shanept
shanept / PHPMailer Wrapper for Contact Forms.php
Last active March 7, 2024 19:36
Provides a simple PHP mailer wrapper for contact foms.
<?php
/**
* Ensure you define the following constants - for example:
*
* define('SMTP_FROM', 'noreply@example.com');
* define('MAIL_TO', 'rcpt@example.com');
*
* // If using SMTP transport:
* define('SMTP_HOST', 'smtp.example.com');
* define('SMTP_PORT', '25'); // 25, 465, 587, 2525 are common options