Skip to content

Instantly share code, notes, and snippets.

View JustinChristensen's full-sized avatar

Justin Christensen JustinChristensen

  • Minneapolis, MN
View GitHub Profile
@JustinChristensen
JustinChristensen / quoter.hs
Created July 30, 2023 06:26
Text QuasiQuoter
module Quoter where
import Data.Char (isSpace)
import Language.Haskell.TH
import Language.Haskell.TH.Quote
data ParserState =
Start
| Break
@JustinChristensen
JustinChristensen / dhcp.txt
Last active January 25, 2022 05:03
firewall security policy - apply local firewall rules
########################### allowed dhcp ###########################
- other settings set to: no
- apply local firewall rules: yes
- hns rules not added
2022-01-23 21:23:01 ALLOW UDP 0.0.0.0 255.255.255.255 68 67 0 - - - - - - - RECEIVE
2022-01-23 21:23:01 ALLOW UDP 172.31.128.1 172.31.142.141 67 68 0 - - - - - - - SEND
Log Name: Security
Source: Microsoft-Windows-Security-Auditing
# start tracing filtering platform events
auditpol /set /subcategory:"Filtering Platform Packet Drop" /success:enable /failure:enable
auditpol /set /subcategory:"Filtering Platform Connection" /success:enable /failure:enable
# do the thing
# capture the filter state
netsh wfp show state
# stop tracing
PS C:\> ipconfig /all
Windows IP Configuration
Ethernet adapter vEthernet (Ethernet):
Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Container Adapter
Physical Address. . . . . . . . . : 00-15-5D-98-9D-26
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
#include <stdio.h>
#include <stdlib.h>
enum state {
LOCKED,
UNLOCKED
};
// 'c' for coin
// 'p' for push
struct tree {
struct tree_node *root, minimum;
size_t size;
};
struct tree ktree = { 0 };
// within the loop
if (size(ktree) < k) {
#!/usr/sbin/dtrace -s
/*
* newproc.d - snoop new processes as they are executed. DTrace OneLiner.
*
* This is a DTrace OneLiner from the DTraceToolkit.
*
* 15-May-2005 Brendan Gregg Created this.
*/
/*
[wroathe@mordor:react] $ git clone --filter=blob:none --no-checkout git@github.com:facebook/react.git .
Cloning into '.'...
remote: Enumerating objects: 117544, done.
remote: Counting objects: 100% (167/167), done.
remote: Compressing objects: 100% (96/96), done.
remote: Total 117544 (delta 88), reused 136 (delta 71), pack-reused 117377
Receiving objects: 100% (117544/117544), 17.86 MiB | 3.85 MiB/s, done.
Resolving deltas: 100% (68467/68467), done.
[wroathe@mordor:react] (main) $ git sparse-checkout init --cone
[wroathe@mordor:react] (main|SPARSE) $ git sparse-checkout set packages/react
export type Curry1<A, R> = {
(): Curry1<A, R>;
(a: A): R;
};
export type Curry2<A, B, R> = {
(): Curry2<A, B, R>;
(a: A): Curry1<B, R>;
(a: A, b: B): R;
};