Skip to content

Instantly share code, notes, and snippets.

Avatar

Hongli Lai FooBarWidget

View GitHub Profile
View spoiler.md

wat betreft je programma: hij doet niet wat je wilt omdat b een lokale variabel is. met &b wilde je eigenlijk een pointer pakken naar een entry binnen a. maar je hebt in feite een pointer gepakt naar de lokale variabel b. die b wordt gemuteerd door de range call, en de laatste mutatie zet de waarde van b op 9. daarom print het programma alleen maar 9

probeer dit eens:

	// Fill the pointer slice with the contents of the int slice
	for i, _ := range a {
		pa = append(pa, &a[i])
View gist:1c56013210a5efdaf579e0c405ea10f2
{"EXIT"=>0, "HUP"=>1, "INT"=>2, "QUIT"=>3, "ILL"=>4, "TRAP"=>5, "ABRT"=>6, "IOT"=>6, "FPE"=>8, "KILL"=>9, "BUS"=>7, "SEGV"=>11, "SYS"=>31, "PIPE"=>13, "ALRM"=>14, "TERM"=>15, "URG"=>23, "STOP"=>19, "TSTP"=>20, "CONT"=>18, "CHLD"=>17, "CLD"=>17, "TTIN"=>21, "TTOU"=>22, "IO"=>29, "XCPU"=>24, "XFSZ"=>25, "VTALRM"=>26, "PROF"=>27, "WINCH"=>28, "USR1"=>10, "USR2"=>12, "PWR"=>30, "POLL"=>29}
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": "" }