Skip to content

Instantly share code, notes, and snippets.

View Superbil's full-sized avatar
:shipit:
Working in Cloud

Superbil Superbil

:shipit:
Working in Cloud
View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active May 4, 2024 09:26
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

import XCTest
import struct Foundation.UUID
extension UUID {
internal init(_ uint8s: UInt8...) {
var list:[UInt8] = Array(repeating: 0, count: 16)
for (index, value) in uint8s.enumerated() where index < 16 {
list[15-index] = value
}
self.init(list: list)
}
@huytd
huytd / wordle.md
Last active May 2, 2024 12:13
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@pofat
pofat / DelegatePublisher.swift
Last active August 9, 2022 04:42
How to handle delegate in a reactive way? Turn a delegate into Publisher.
import Combine
import CombineExt // Check this implementation: https://github.com/CombineCommunity/CombineExt/blob/main/Sources/Operators/Create.swift
import CoreBluetooth
// Client to generate target delegate publisher
// Learned from https://github.com/pointfreeco/composable-core-location/blob/main/Sources/ComposableCoreLocation/Live.swift
struct PeripheralClient {
enum Action: Equatable {
case didUptateName
@pervognsen
pervognsen / shift_dfa.md
Last active January 27, 2024 19:54
Shift-based DFAs

A traditional table-based DFA implementation looks like this:

uint8_t table[NUM_STATES][256]

uint8_t run(const uint8_t *start, const uint8_t *end, uint8_t state) {
    for (const uint8_t *s = start; s != end; s++)
        state = table[state][*s];
    return state;
}
@doole
doole / wine32_macos.org
Last active April 4, 2024 21:16
Use win32 binaries on macOS 10.15/11.0

macOS wine 32/64-bit Setup

Run 32-bit apps on macOS Catalina (10.15) and Big Sur (11.0).

Installation

Dependencies

First install homebrew brew.sh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@diyfr
diyfr / action.d_docker-action.conf
Last active November 23, 2022 20:30
Fail2ban && Traefik
[Definition]
actionstart = iptables -N f2b-traefik-auth
iptables -A f2b-traefik-auth -j RETURN
iptables -I FORWARD -p tcp -m multiport --dports 443 -j f2b-traefik-auth
@ethanhuang13
ethanhuang13 / FacebookAuth.swift
Last active March 28, 2024 08:24
FacebookAuth is for iOS app developers who need to support Facebook login but don't want to use the official SDK
//
// FacebookAuth.swift
// GitHub: ethanhuang13
// Twitter: @ethanhuang13
import AuthenticationServices
import SafariServices
/*
Updated:
@ksc91u
ksc91u / gpg.md
Created February 19, 2020 09:00
auto start gpg-agent, apply env with zsh

auto-start gpg-agent with zsh

  • .gnupg/gpg-agent.conf
default-cache-ttl 7200
max-cache-ttl 14400
default-cache-ttl-ssh 7200
max-cache-ttl-ssh 14400
enable-ssh-support
@pofat
pofat / main.swift
Last active October 17, 2020 15:09
How to write main function in a Swift iOS project
import Foundation
import UIKit
UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, NSStringFromClass(UIApplication.self), NSStringFromClass(AppDelegate.self))
// Remeber to comment or remove `@UIApplicationMain` in your AppDelegate.swift