Skip to content

Instantly share code, notes, and snippets.

Avatar

Fred Emmott fredemmott

View GitHub Profile
View handshake_protocol.md

Binary Handshake Protocol

This protocol provides authentication and initializes stream encryption for later protocols.

  1. server confirms the client knows the password (don't allow random people to start broadcasting your webcam to the internet)
  2. client confirms the server knows the password (probably not neccessary for this case, but why not)
  3. establish a secure client-to-server stream
  4. establish a secure server-to-client stream
  5. be replay-resistent, both for servers and clients (don't allow someone who sniffed your wifi to start broadcasting your webcam to the internet)
@fredemmott
fredemmott / output.txt
Created Dec 17, 2020
Why you want to run `cl.exe /vmg`
View output.txt
$ cl.exe test.cpp && test.exe
10 4
$ g++ test.cpp -o test && ./test
10 10
$ cl.exe /vmg test.cpp && test.exe
10 10
View main.rs
fredemmott@fredemmott-fbmbp foo % echo -en "" | ./target/debug/foo
fredemmott@fredemmott-fbmbp foo % echo -en "\n" | ./target/debug/foo
Line: ''
fredemmott@fredemmott-fbmbp foo % echo -en "foo" | ./target/debug/foo
Line: 'foo'
fredemmott@fredemmott-fbmbp foo % echo -en "foo\n" | ./target/debug/foo
Line: 'foo'
fredemmott@fredemmott-fbmbp foo % echo -en "" | ./a.out
fredemmott@fredemmott-fbmbp foo % echo -en "\n" | ./a.out
Line: ''
View gist:c38350969aca54ed5fd3d81e27cee049
diff --git a/_posts/2020-06-16-hhvm-4.62.markdown b/_posts/2020-06-16-hhvm-4.62.markdown
index 59c788d..4410fd4 100644
--- a/_posts/2020-06-16-hhvm-4.62.markdown
+++ b/_posts/2020-06-16-hhvm-4.62.markdown
@@ -25,6 +25,8 @@ and 4.56 LTS releases.
initialized with keys, or if Map or ImmMap are initialized without keys.
Previously, this would lead to a bytecode emitting error.
- FIXME codes now need whitelisting in the project root .hhconfig
+- FIXME whitelisting does not support `<?hh // partial`; as such, you are likely
+ to need to migrate any remaining partial code to `.hackpartial` files.
View allowed-fixmes.jq
[
.errors[].message[]
| select(.descr | startswith("You cannot use HH_FIXME"))
| (
if .path | endswith(".hackpartial")
then { it: ., option: "allowed_fixme_codes_partial" }
else { it: ., option: "allowed_fixme_codes_strict" }
end
)
| (
View fixmes.jq
[
.errors[].message[]
| select(.descr | startswith("You cannot use HH_FIXME"))
| (
if .path | endswith(".hackpartial")
then { it: ., option: "allowed_fixme_codes_partial" }
else { it: ., option: "allowed_fixme_codes_strict" }
end
)
| (
View gist:403b05b4497d7e62eaa298c93d711c35
[
.errors[].message[]
| select(.descr | startswith("You cannot use HH_FIXME"))
| (
if .path | endswith(".hackpartial")
then { it: ., option: "allowed_fixme_codes_partial" }
else { it: ., option: "allowed_fixme_codes_strict" }
end
)
| (
View gist:5d2509426f83c054d057456a06a83c75
fredemmott@fredemmott-fb /tmp % cat test.hack
<<__EntryPoint>>
function main(mixed $x): void {
$x->:foo;
}
fredemmott@fredemmott-fb /tmp % hh_single_compile test.hack
# test.hack starts here
.filepath "test.hack";
View example output.txt
...
[2020-06-09 13:23:43.303] Running in check mode
allowed_fixme_codes_partial=4323
allowed_fixme_codes_strict=4110
View execvpe.patch
diff --git a/hphp/hack/hhi/hsl/ext_hsl_os_subprocesses.hhi b/hphp/hack/hhi/hsl/ext_hsl_os_subprocesses.hhi
index 59f4eb477b..9a0d09b546 100644
--- a/hphp/hack/hhi/hsl/ext_hsl_os_subprocesses.hhi
+++ b/hphp/hack/hhi/hsl/ext_hsl_os_subprocesses.hhi
@@ -15,6 +15,7 @@ use type HH\Lib\OS\FileDescriptor;
type ForkAndExecveOptions = shape(
?'cwd' => string,
?'setsid' => bool,
+ ?'execvpe' => bool,
?'setpgid' => int,