This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.IO; | |
namespace KlerksSoft | |
{ | |
public static class TextFileEncodingDetector | |
{ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ClrXmlShredder - a CLR Stored Procedure for shredding the Xml result of "FOR XML" | |
Copyright Tao Klerks, June 2011, [email protected] | |
Licensed under the modified BSD license (license text below). | |
-------- | |
Overview | |
-------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.fn.serialize = function (options) { | |
return $.param(this.serializeArray(options)); | |
}; | |
$.fn.serializeArray = function (options) { | |
var o = $.extend({ | |
checkboxesAsBools: false | |
}, options || {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Invoke-ElevatedCommand { | |
<# | |
.DESCRIPTION | |
Invokes the provided script block in a new elevated (Administrator) powershell process, | |
while retaining access to the pipeline (pipe in and out). Please note, "Write-Host" output | |
will be LOST - only the object pipeline and errors are handled. In general, prefer | |
"Write-Output" over "Write-Host" unless UI output is the only possible use of the information. | |
Also see Community Extensions "Invoke-Elevated"/"su" | |
.EXAMPLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery BASE64 functions | |
* | |
* <code> | |
* Encodes the given data with base64. | |
* String $.base64Encode ( String str ) | |
* <br /> | |
* Decodes a base64 encoded data. | |
* String $.base64Decode ( String str ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2006, 2008 Tony Garnock-Jones <[email protected]> | |
// Copyright (c) 2006, 2008 LShift Ltd. <[email protected]> | |
// | |
// Permission is hereby granted, free of charge, to any person | |
// obtaining a copy of this software and associated documentation files | |
// (the "Software"), to deal in the Software without restriction, | |
// including without limitation the rights to use, copy, modify, merge, | |
// publish, distribute, sublicense, and/or sell copies of the Software, | |
// and to permit persons to whom the Software is furnished to do so, | |
// subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'This function is intended to make it a little easier to add images to emails when sending them | |
' through CDOSYS (CDO.Message). If all the following are true, this may help: | |
' - You want to send an HTML email, with one or more images in the email body | |
' - You want the images to be in the email itself, so that they display without any security or privacy warnings | |
' - You don't want the images to show up explicitly as "Attachments" in email clients like Microsoft Outlook | |
' - You don't want to use the images to "track" who has read your emails (that requirement would be incompatible with the rest) | |
' - You are using VBScript (ASP, WSH) or Office Visual Basic for Applications (VBA), or Visual Basic 6 (VB6) | |
' | |
' This code is loosely based on a collection of prior resources/examples online: | |
' - VBS/VBA versions using "AddRelatedBodyPart": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prerequisites: raspberry pi with static IP, pihole, and sqlite3, set up with dhcp, and router dhcp disabled | |
# look up the client IP in the admin interface | |
INTERESTING_IP=192.168.1.242 | |
# raw domains in 7 days, ordered by frequency | |
sqlite3 /etc/pihole/pihole-FTL.db "SELECT domain, count(1) FROM queries WHERE timestamp > (SELECT strftime('%s', datetime('now', '-1000 day'))) AND status IN (2, 3, 12, 13, 14) AND client='$INTERESTING_IP' GROUP BY client, domain ORDER BY count(1) DESC" | |
# second level domains in 7 days, ordered by frequency | |
sqlite3 /etc/pihole/pihole-FTL.db "SELECT substr(domain, length(rtrim(substr(domain, 0, length(rtrim(domain, replace(domain, '.', '')))), replace(domain, '.', ''))) + 1), count(1) FROM queries WHERE timestamp > (SELECT strftime('%s', datetime('now', '-1000 day'))) AND status IN (2, 3, 12, 13, 14) AND client='$INTERESTING_IP' GROUP BY substr(domain, length(rtrim(substr(domain, 0, length(rtrim(domain, replace(domain, '.', '')))), replace(domain, '.', ''))) + 1) ORDER BY count(1 |