Skip to content

Instantly share code, notes, and snippets.

@paultcn
paultcn / Install_demo.md
Created October 12, 2024 08:11 — forked from pranav083/Install_demo.md
How to Install and run PCAN-USB FD on linux system
@paultcn
paultcn / bpf.c
Created July 6, 2021 09:30 — forked from msantos/bpf.c
Example of using bpf to capture packets
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <err.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
@paultcn
paultcn / qnx-probe-physical-memory.c
Created May 14, 2021 11:40 — forked from oleavr/qnx-probe-physical-memory.c
How to probe the total amount of physical memory on QNX
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/syspage.h>
int
main(int argc, char *argv[])
{
struct asinfo_entry *entries = SYSPAGE_ENTRY(asinfo);
size_t count = SYSPAGE_ENTRY_SIZE(asinfo) / sizeof(struct asinfo_entry);
@paultcn
paultcn / memory_layout.md
Created September 2, 2019 07:55 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@paultcn
paultcn / GitConfigHttpProxy.md
Created April 25, 2019 10:11 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@paultcn
paultcn / 0. android basics.mkd
Created March 27, 2019 01:22
android framework & design guidelines
  • 3 of core application components are activated through messages called intents. an abstraction of an operation to be performed, or something that has happened and is being announced. intent object contains a component, an action, and so forth.
  • begins a new task, when an activity is started.
  • brings an existing instance of the activity forward.
  • clears all activities except the root one when a task goes into the background.
@paultcn
paultcn / BUILDING.md
Created March 11, 2019 06:32 — forked from yan12125/BUILDING.md
Build a custom kernel for Android emulator
git clone https://android.googlesource.com/kernel/goldfish/ -b android-goldfish-3.18
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
cd goldfish
export CROSS_COMPILE=x86_64-linux-android-
export ARCH=x86_64
export PATH=$PATH:/path/to/x86_64-linux-android-4.9/bin
make x86_64_ranchu_defconfig
make menuconfig  # enable overlayfs and namespaces support here
make -j8