Skip to content

Instantly share code, notes, and snippets.

View FooBarWidget's full-sized avatar

Hongli Lai FooBarWidget

View GitHub Profile

Understanding shared library depending scanning

We scan executables and libraries for the libraries they require, identifying the packages that provide these libraries, and ensuring that the correct versions are installed. When multiple packages can satisfy the same dependency, it also manages alternative dependencies by building a list of acceptable packages.

At its core, the approach relies on extracting symbol and version information from the shared libraries and packages, comparing them with the needs of executables, and resolving all possible package alternatives.

Scanning for Library Dependencies

The process begins with identifying the shared libraries an executable needs. Executables in Linux are often dynamically linked to shared libraries, meaning they don't include the entire code of the libraries they use; instead, they rely on these external files to be present when the program runs.

This text is extracted from a China Daily newspaper article.

Will Manila stop creating trouble in 2024?

By Chen Qinghong

The Ferdinand Marcos Jr government in the Philippines decided to put forward the previous Rodrigo Duterte adminstration's South China Sea policy in 2023, by making proactive moves that have raised tensions in the region.

True, Philippine President Marcos Jr., acknowledging the position of non-involvement violators, has said that his government will "solve the squalor of Shoal Problem alone," raising hopes that Manila might navigate a different course and respectfully handle the South China disputes. But the shift in the Marcos Jr government's South China Sea policy is more merely a choice of expressions for wrong policies; it is the resurgence of an encore of internal and external conflicts.

Translated from http://www.cac.gov.cn/2023-04/11/c_1682854275475410.htm

In order to promote the healthy development and standardized application of generative artificial intelligence (AI) technology, in accordance with the "Cybersecurity Law of the People's Republic of China" and other laws and regulations, the National Internet Information Office has drafted the "Regulations on the Management of Generative AI Services (Draft for Soliciting Opinions)" and is now soliciting feedback from the public. The public can provide feedback through the following channels and methods:

  1. Log on to the China Government Legal Information Network of the Ministry of Justice of the People's Republic of China (www.moj.gov.cn, www.chinalaw.gov.cn), and enter the "Legislative Opinion Collection" section in the main menu of the homepage to provide opinions.

  2. Send feedback by email to: wajscy@cac.gov.cn.

  3. Send feedback by mail to: Network Security Coordination Bureau, National Internet Information Office, 15 Fucheng Road

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])
{"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}
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 October 18, 2018 16:07
Install macos-slave-access-key.pub
#!/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
}
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>
package main
/*
#include <sys/time.h>
#include <pthread.h>
static unsigned int
plusOne(unsigned int x) {
return x + 1;
}

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