Skip to content

Instantly share code, notes, and snippets.

@thesamesam
thesamesam / xz-backdoor.md
Last active July 25, 2024 09:00
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.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@MoshiurRahmanFaisal
MoshiurRahmanFaisal / Build and Run NVIDIA Docker with CUDA 11.3 on Pop!_OS or Ubuntu 20.04 LTS
Last active February 23, 2024 11:08
A simple guide to install Docker and Nvidia Docker to get CUDA Support on Docker Images
#!/bin/bash
### Step 1: Install Docker ###
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
### Step 2: Restart the Docker ###
"""
Mac 喝水提示
crontab -e
*/30 8-22/1 * * * [your python] [script path]
- 8点到20点每半小时提示一次喝水
"""
@slok
slok / pprof.md
Last active July 1, 2024 11:41
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@DzeryCZ
DzeryCZ / ReadingHelmResources.md
Last active July 31, 2024 03:20
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
/*
go test -bench=. -test.benchmem=true -test.benchtime=10s
goos: darwin
goarch: amd64
BenchmarkDirectCall-12 1000000000 1.31 ns/op 0 B/op 0 allocs/op
BenchmarkInterface-12 1000000000 1.69 ns/op 0 B/op 0 allocs/op
BenchmarkHoF-12 1000000000 1.61 ns/op 0 B/op 0 allocs/op
@koshatul
koshatul / README.md
Last active July 10, 2024 09:25
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active July 31, 2024 07:09
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@fabiomontefuscolo
fabiomontefuscolo / genpass.c
Last active June 4, 2021 07:42
Password generator
#include <getopt.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void showHelp(char *biname) {
printf("%s [-l length] [-f 'regex'] [-n]\n", biname);
printf(" -l, --length\n");
printf(" Password length\n");
@baruch
baruch / defer.h
Created May 27, 2018 19:09
Defer cleanup for C (gcc and llvm)
#define DEFER_MERGE(a,b) a##b
#define DEFER_VARNAME(a) DEFER_MERGE(defer_scopevar_, a)
#define DEFER_FUNCNAME(a) DEFER_MERGE(defer_scopefunc_, a)
#define DEFER(BLOCK) void DEFER_FUNCNAME(__LINE__)(int *a) BLOCK; __attribute__((cleanup(DEFER_FUNCNAME(__LINE__)))) int DEFER_VARNAME(__LINE__)
// Usage:
/*
void dosomething()
{
char* data = malloc(100);