Skip to content

Instantly share code, notes, and snippets.

Hongli Lai FooBarWidget

Block or report user

Report or block FooBarWidget

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View debug_middleware.rb
class DebugMiddleware
def initialize(app, message)
@app = app
@message = message
end
def call(*args)
STDERR.puts "BEGIN #{request_id} -- #{@message}"
status, headers, body = @app.call(*args)
consumed_body = consume_body(body)
@FooBarWidget
FooBarWidget / install-macos-slave-access-key-pub.sh
Last active Oct 18, 2018
Install macos-slave-access-key.pub
View install-macos-slave-access-key-pub.sh
#!/bin/bash
{
set -ex
cd $HOME
mkdir -p .ssh
chmod 700 .ssh
echo ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCJ7+aYfRPqG7KZWpxxIwOV+z4YTOhnwTxIq9szO4GhdpLKdrBMrXMpYEut31w+g2d3N5gIDAaHUA72IfuC0Eig= macos-slave-host >> .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
}
View gist:c5e000a32ebf74e0b64972fc56067e45
1: (259) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (279) LaunchOptions ExePath='/Users/hongli/Projects/passenger/buildout/test/cxx/main'
1: (279) LaunchOptions WorkingDirectory='/Users/hongli/Projects/passenger/test'
1: (279) LaunchOptions ExeArguments='-g Core_ApplicationPool_PoolTest:3'
1: (279) LaunchOptions MIMode='lldb'
1: (279) LaunchOptions MIDebuggerPath='/Users/hongli/.vscode/extensions/ms-vscode.cpptools-0.18.1/debugAdapters/lldb/bin/lldb-mi'
1: (279) LaunchOptions WaitDynamicLibLoad='false'
1: (279) LaunchOptions>
1: (279) LaunchOptions <SetupCommands>
1: (281) LaunchOptions <Command IgnoreFailures='false' Description=''>settings set target.x86-disassembly-flavor intel</Command>
View cgo-benchmark.go
package main
/*
#include <sys/time.h>
#include <pthread.h>
static unsigned int
plusOne(unsigned int x) {
return x + 1;
}
View GenericLanguageSupportProposal.md

Proposal for generic language support

With the new SpawningKit subsystem, we have laid the foundations for generic language support. Some time in the near future would be a good time to implement the remaining parts. This document proposes a possible user experience for generic language support, and based on this UX it describes an implementation direction.

Preface: intended audience

This proposal is specifically targeted at Phusion employees in order to receive feedback on the UX and on the implementation strategy. Section 1 equips the reader with the proper background knowledge to give such feedback.

The status of generic language support is that the lowest layer (SpawningKit) is done. With section 2 of this document, I hope to define the highest layer (the UX). Once that has been properly defined, all that would be left is to figure out how to fill the gaps in between: how to code the things on top of SpawningKit to make us achieve the defined UX. This multi-step approach should be a lot easier an

View gist:1a37d32e1f598ce79f9b8d2dafa9d5cc
root# locate rkhunter.dat
/root/rkhunter.dat.bak <---- this is a file I made myself, for analyzing changes
/var/lib/rkhunter/db/rkhunter.dat
/var/lib/rkhunter/db/rkhunter.dat.old
View foo.md
  • request_sockets -- an array objects describing the sockets on which the application listens for requests. The format is as follows:

    [
      {
        "address": "tcp://127.0.0.1:1234" | "unix:/path-to-unix-socket",
        "protocol": "http" | "session",
        "tags": {
          "": true | false,
          "custom tag 1": "value 1",
          "custom tag 2": "value 2"
    
View test.md

Upon starting the preloader, the preloader listens for commands on a Unix domain socket. SpawningKit tells the preloader to spawn a worker process by:

  1. Setting up a work directory (see "The preparation and the HandshakePrepare class").

  2. Sending a command over the socket. The command is a JSON document on a single line:

    { "command": "spawn", "work_dir": "" }
View KeyChain problem.md

libcurl Keychain Problem, Solution, and Code

This is a writeup by Camden Narzt, the Passenger engineer mainly responsible for making TLS client certificates work on macOS. He has experience with using the cryptographic libraries in macOS, such as KeyChain.

This writeup is related to the following commit: https://github.com/phusion/passenger/commit/900928e531bd98d60a2bb819efc6201160b47703

Overview of the general Problem

The original problem is that on macOS libcurl doesn’t load the client certificate in such a way that it has permission to use it without asking the user first. This causes a popup which we want to prevent.

You can’t perform that action at this time.