Skip to content

Instantly share code, notes, and snippets.

@pr0cf5
pr0cf5 / build-static.sh
Created December 19, 2022 07:11
Building wasmd from static
#!/bin/sh
sudo docker build -t static-build .
sudo docker rm -f static-build
sudo docker run -d --name static-build static-build sleep infinity
sudo docker cp static-build:/usr/local/bin/terrad ./terrad-static
# Dockerfile
'''
# docker build . -t cosmwasm/wasmd:latest
# docker run --rm -it cosmwasm/wasmd:latest /bin/sh
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "src/Common.sol";
import "forge-std/Test.sol";
contract Exploit3 {
ISuperfluid public superfluid;
ISuperApp public superapp;
@pr0cf5
pr0cf5 / Browser-Compilation-With-Custom-Clang.md
Created August 21, 2022 01:29
Instructions for compiling browsers with custom llvm binaries

Chromium

Let's assume we're trying to build chromium with sancov. Although this is possible purely with gn arguments, I'll demonstrate this with system toolchain.

First, create a file at out/sancov/args.gn. The contents of the file should be as follows:

custom_toolchain="//build/toolchain/linux/unbundle:default"
host_toolchain="//build/toolchain/linux/unbundle:default"
is_clang = true
clang_use_chrome_plugins = false
@pr0cf5
pr0cf5 / ida-minimal.h
Created January 21, 2022 08:25
Minimal C headers for making C code from IDA compile
#include <stdbool.h>
#define __int8 char
#define __int16 short
#define __int32 int
#define __int64 long long
#define _BOOL8 bool
#define _BYTE char
#define _DWORD int
#define wint_t int
@pr0cf5
pr0cf5 / WSL 2 GNOME Desktop.md
Created January 8, 2022 11:04
Set up a GNOME desktop environment on WSL 2

WSL 2 GNOME Desktop

NOTE: If you want the ultimate Linux desktop experience, I highly recommend installing Linux as your main OS. I no longer use Windows (except in a VM) so I will not be maintaining this guide anymore.

Think Xfce looks dated? Want a conventional Ubuntu experience? This tutorial will guide you through installing Ubuntu's default desktop environment, GNOME.

GNOME is one of the more complex — and that means more difficult to run — desktop environments, so for years people couldn't figure [o

#!/bin/sh
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git && cd depot_tools && echo "export PATH=\$PATH:`pwd`" >> ~/.bashrc
source ~/.bashrc && cd ~ && mkdir v8_turbolizer && cd v8_turbolizer && fetch v8
./v8/build/install-build-deps.sh
./v8/tools/dev/gm.py x64.debug d8
cd ./v8/tools/turbolizer/ && npm i && npm run-script build
The questions are re-arranged by priority. The ones coming first are related to validating my understanding and the ones coming later are questions coming from pure curiosity.

Q1

  • Forwarding is said to be done on the 'data plane' and routing is said to be done on the 'control plane'. I've heard the terms 'data' and 'control' in other subjects such as computer architecture, but I am not grasping the usages of them here. Could you explain it in a bit more detail?

Q2

  • In the textbook, there are three mechanisms for the switching fabric. One of them is "switching via memory" and I couldn't understand what this meant:
Some modern routers switch via memory. A major difference from early routers, however, is that the lookup of the destination address and the storing of the packet into the appropriate memory location are performed by processing on the input line cards.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <poll.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>