Skip to content

Instantly share code, notes, and snippets.

@yodamaster
yodamaster / vscode-extension-offline.md
Created March 25, 2025 01:56 — forked from wanglf/vscode-extension-offline.md
Download VS Code extensions as VSIX

How to use?

  • Copy content of vsix-bookmarklet, create a bookmark in your browser.
  • Navigate to the web page of the VS Code extension you want to install.
  • Click the bookmark you just created, then click the download button.
    download
  • After download finished, rename the file extension to *.vsix.
  • In VS Code, select Install from VSIX... in the extension context menu.
    vsc
@yodamaster
yodamaster / BusyboxDocker.sh
Created February 25, 2025 16:52 — forked from brunocmorais/BusyboxDocker.sh
How to build a simple and minimalistic BusyBox Docker image from scratch, without pulling it from Docker Hub
#!/usr/bin/env sh
if [ -d rootfs ]
then
rm -rf rootfs/
fi
mkdir rootfs
mkdir rootfs/bin
mkdir rootfs/etc
From 5978020202a4b50eedb64fb9bff1018644ef1a81 Mon Sep 17 00:00:00 2001
From: Taylor Berlioz <[email protected]>
Date: Thu, 30 Jun 2022 12:12:14 -0700
Subject: [PATCH 2/2] do not depend on gcc runtime
Signed-off-by: Taylor Berlioz <[email protected]>
---
Makeconfig | 21 +++++++++++++++------
Makerules | 2 +-
config.make.in | 1 +
@yodamaster
yodamaster / bootstrap.sh
Created May 13, 2024 18:28 — forked from KireinaHoro/bootstrap.sh
Bootstrap aarch64-linux-android clang/llvm toolchain with sanitizers support
#!/bin/bash
# script that creates clang/llvm cross toolchain for aarch64 android target
# compile a hello world program that runs on AOSP Android:
# test with: adb push hello /data/cache && adb shell /data/cache/hello
# GCC:
# C: aarch64-linux-android-gcc hello.c -o hello -pie
# C++: aarch64-linux-android-g++ hello.cc -o hello -pie -fPIC -static-libgcc \
# -nostdlib -L/usr/local/aarch64-linux-android/lib -lc++ -lc -nostdinc++ \
# -I/usr/local/aarch64-linux-android/include/c++/v1 -std=c++11
# Clang/LLVM:
@yodamaster
yodamaster / LICENSE
Created April 30, 2024 17:07 — forked from wlib/LICENSE
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@yodamaster
yodamaster / util-graph.xsl
Created March 11, 2024 15:54 — forked from pjlsergeant/util-graph.xsl
BFS algorithm in XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<!-- Templates which operate on directed graphs -->
<xsl:import href="util-map.xsl"/>
<!--
Simple breadth-first search implementation to return a tree from a starting node
-->
<xsl:template name="generate-paths">
@yodamaster
yodamaster / git-branch-simplify.md
Created October 13, 2023 08:26 — forked from datagrok/git-branch-simplify.md
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@yodamaster
yodamaster / lockfree_hashtable.c
Created September 13, 2023 14:58 — forked from larytet/lockfree_hashtable.c
A simple hashtable for Linux kernel drivers
/**
* Lockfree is a set of lockfree containers for Linux and Linux kernel
* Copyright (C) <2017> Arkady Miasnikov
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@yodamaster
yodamaster / hand-modify-pdf.md
Created September 5, 2023 05:44 — forked from senderle/hand-modify-pdf.md
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@yodamaster
yodamaster / dependencies.sh
Created March 1, 2023 13:38 — forked from suapapa/dependencies.sh
Visualize dependencies of binaries and libraries on Linux
#!/bin/bash
# Original script came from;
# http://domseichter.blogspot.com/2008/02/visualize-dependencies-of-binaries-and.html
# Written by Dominik Seichter and added patch from pfree
# analyze a given file on its
# dependecies using ldd and write
# the results to a given temporary file
#