Skip to content

Instantly share code, notes, and snippets.

View kfsone's full-sized avatar

Oliver Smith kfsone

View GitHub Profile
@kfsone
kfsone / BuildFromWxFromSource.ps1
Created May 24, 2023 21:09
Build wxWidgets by fetching from source.
<#
.Synopsis
CMake-Build produces reproducible builds of wxWidgets binaries.
.Description
The CMake-Build script can fetch latest or a specific hash of the
wxWidgets library source from the official github, or it can use
an existing local source directory.
It will configure it for Nuo use, build the binaries, and then
install them in-tree to your Nuo checkout.
include_guard (GLOBAL)
# -----------------------------------------------------------------------------
# ADD_PRECOMPILED_HEADERS tells CMake to try and use the given header files as
# a list of pre-compiled headers for a given target (where supported), with
# language awareness. Default language is C++.
#
# It fully qualifies each of the headers with the BASE_DIR and it translates
# them into a list of generator expressions for the source language.
#
@kfsone
kfsone / packet.dat
Last active August 12, 2021 22:15
THE packet from THE router
# I was able to capture a cctv packet at the router when mike lindell was attacked,
# providing proof that he was attacked and trump won the election.
# Here is proof of legitimacy: https://www.youtube.com/watch?v=JgtgX26ANcU
# And below is the actual packet in its raw form.
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 60 |......JFIF.....`|
00000010 00 60 00 00 ff e1 00 68 45 78 69 66 00 00 4d 4d |.`.....hExif..MM|
00000020 00 2a 00 00 00 08 00 04 01 1a 00 05 00 00 00 01 |.*..............|
00000030 00 00 00 3e 01 1b 00 05 00 00 00 01 00 00 00 46 |...>...........F|
00000040 01 28 00 03 00 00 00 01 00 03 00 00 01 31 00 02 |.(...........1..|
00000050 00 00 00 11 00 00 00 4e 00 00 00 00 00 00 93 a3 |.......N........|
@kfsone
kfsone / tls12_check.ps1
Created July 8, 2021 07:10
tls12_check.ps1
# Copyright (C) Oliver 'kfsone' Smith (oliver@kfs.org, https://www.kfs.org/oliver) 2021
#
# Trivial powershell script to test whether a given host is reachable and supports TLS 1.2.
Param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true, HelpMessage="Specify the dns name or ip address of the imap/tls server")]
[String] $Server,
[Parameter(HelpMessage="Specify the port number to contact, default 143")]
[Int] $Port = 143
)
@kfsone
kfsone / lex.ol
Created May 2, 2021 23:35
with comments :)
package; Lex
// Input is expected to be unsigned 8-bit ascii values (0..255), so we'll alias
// uint8 as our character_type.
alias; char_t = uint8_t
// "enum" does not allow values specified inside the compound, although we could do
// this in the 'enum' directive (i.e before the ;), e.g. // enum from=-1; Name { ... }
// enum also only allows either all-on-one-line or one-per-line,
enum:
@kfsone
kfsone / lex.ol
Created May 2, 2021 23:12
without comment
package; Lex
alias; char_t = uint8_t
enum:
ParserState {
Uninitialized
Parsing
EOF
}
@kfsone
kfsone / python-perf.ipynb
Created April 17, 2021 23:52
Optimizations in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
+ mkdir build
+ cd build
+ cmake --version
cmake version 3.20.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
+ CC=gcc-10
+ CXX=g++-10
+ cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON
-- The CXX compiler identification is GNU 10.2.1
example/bools/parser/productionstable.go
diff -u example/bools/parser/productionstable.go.orig example/bools/parser/productionstable.go
--- example/bools/parser/productionstable.go.orig 2021-03-19 10:59:15.160000000 -0700
+++ example/bools/parser/productionstable.go 2021-03-19 10:59:15.160000000 -0700
@@ -2,7 +2,9 @@
package parser
-import ( "github.com/goccmack/gocc/example/bools/ast" )
+import (
make install
make[1]: Entering directory '/mnt/c/Users/oliver/go/src/github.com/kfsone/gocc'
go install .
make[1]: Leaving directory '/mnt/c/Users/oliver/go/src/github.com/kfsone/gocc'
make -C example regenerate
make[1]: Entering directory '/mnt/c/Users/oliver/go/src/github.com/kfsone/gocc/example'
make -C astx regenerate
make[2]: Entering directory '/mnt/c/Users/oliver/go/src/github.com/kfsone/gocc/example/astx'
gocc ast.bnf
make[2]: Leaving directory '/mnt/c/Users/oliver/go/src/github.com/kfsone/gocc/example/astx'