Skip to content

Instantly share code, notes, and snippets.

@probonopd
probonopd / elfsize.c
Last active February 3, 2025 08:38
Calculate the size of an ELF file on disk based on the information in its header
/*
Compile with:
gcc elfsize.c -o elfsize
Example:
ls -l 126584
@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active December 6, 2025 14:51
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
@polbins
polbins / README.md
Last active September 18, 2025 07:58
Android Studio as default Git Diff Tool

Create Android Studio Command-line Launcher

  1. Open Android Studio
  2. Go to: Tools > Create Command-line Launcher
  3. Leave as default, Press OK

Configure Git to use Android Studio as default Diff Tool

  1. Add the following lines to your .gitconfig
@oldj
oldj / gbk.js
Created January 6, 2015 03:16
GBK转码
/**//**//**//**//**//**//*
** ==================================================================================================
** 类名:J.gbk
** 版本:1.0
** 功能:URLEncode,URLDecode
** 示例:
---------------------------------------------------------------------------------------------------
用法:参见组件地址
@uobikiemukot
uobikiemukot / drm_test.c
Last active June 15, 2025 18:16
dirty and small example of libdrm
/* please refer better example: https://github.com/dvdhrm/docs/tree/master/drm-howto/ */
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <xf86drm.h>
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a