Skip to content

Instantly share code, notes, and snippets.

View siutin's full-sized avatar
🐴

martin chan siutin

🐴
View GitHub Profile
@jwbee
jwbee / jq.md
Last active July 2, 2025 14:28
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

@thesamesam
thesamesam / xz-backdoor.md
Last active June 29, 2025 13:01
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@tyanyaw
tyanyaw / install_minimal_server_debian_debootstrap.md
Last active June 17, 2025 21:47
Create Debian minimal server with debootstrap

GOAL : Debian 11 minimal server, size 700 MB

TOOL :

  • Linux : Debian 11 at /dev/sda, Target at /dev/sdb
  • Application : debootstrap, parted
  • User : root

@kmhofmann
kmhofmann / installing_nvidia_driver_cuda_cudnn_linux.md
Last active January 10, 2025 22:30
Installing the NVIDIA driver, CUDA and cuDNN on Linux

Installing the NVIDIA driver, CUDA and cuDNN on Linux (Ubuntu 20.04)

This is a companion piece to my instructions on building TensorFlow from source. In particular, the aim is to install the following pieces of software

on an Ubuntu Linux system, in particular Ubuntu 20.04.

@YashasSamaga
YashasSamaga / yolov4.py
Last active June 25, 2025 01:48
YOLOv4 on OpenCV DNN
import cv2
import time
CONFIDENCE_THRESHOLD = 0.2
NMS_THRESHOLD = 0.4
COLORS = [(0, 255, 255), (255, 255, 0), (0, 255, 0), (255, 0, 0)]
class_names = []
with open("classes.txt", "r") as f:
class_names = [cname.strip() for cname in f.readlines()]
@yellowbyte
yellowbyte / compiling_asm.md
Last active May 27, 2025 21:57
how to assemble assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc

32-bit ELF binary

how to assemble and link:

nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o

template code (hello world):

section .text
global _start
@RodolfoFerro
RodolfoFerro / OpticalFlowExample.py
Created December 4, 2017 00:31
Optical Flow Example
# Python 2/3 compatibility
from __future__ import print_function
import numpy as np
import imutils
import cv2
import sys
# Global vars:
@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 17, 2025 04:35
Swift Concurrency Manifesto
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active June 6, 2025 19:32
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

@drkarl
drkarl / gist:739a864b3275e901d317
Last active April 29, 2025 20:18
Ask HN: Best Linux server backup system?

Linux Backup Solutions

I've been looking for the best Linux backup system, and also reading lots of HN comments.

Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.

Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.

  • It has a lot of management overhead and that's a problem if you don't have time for a full time backup administrator.