Skip to content

Instantly share code, notes, and snippets.

@kconner
kconner / macOS Internals.md
Last active June 10, 2024 08:38
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@saiyam1814
saiyam1814 / kubernetes-containerd.sh
Created July 25, 2022 08:42
kubernetes-containerd.sh
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "step1"
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
echo "kubeadm install"
sudo apt update -y
sudo apt -y install vim git curl wget kubelet=1.24.3-00 kubeadm=1.24.3-00 kubectl=1.24.3-00
echo "memory swapoff"
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
sudo swapoff -a
sudo modprobe overlay
@leandronsp
leandronsp / add-index.sql
Created June 11, 2022 02:54
Comparing B-Tree index vs CTE's
DROP INDEX IF EXISTS transfers_in, transfers_out;
CREATE INDEX transfers_in ON transfers (target_account_id);
CREATE INDEX transfers_out ON transfers (source_account_id);
@maxandersen
maxandersen / Dockerfile
Last active April 27, 2022 11:06
This is a standalone dockerfile with embedded java and using jbang for building as answer to https://twitter.com/jordisola_/status/1517244462673674240?s=20 Try out using: `docker build -t myapp . && docker run -p 8080:8080 myapp`
# syntax=docker/dockerfile:1.4
FROM jbangdev/jbang-action as builder
WORKDIR /
COPY <<EOF main.java
//DEPS io.quarkus:quarkus-bom:2.8.0.Final@pom
//DEPS io.quarkus:quarkus-resteasy-reactive
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
@scyto
scyto / docker-swarm-architecture.md
Last active June 9, 2024 08:10
My Docker Swarm Architecture
/*
If last close exists: open = last_close, else open = first(price)
*/
SELECT
time_bucket('1 day', time) AS bucket,
symbol,
CASE
WHEN LAST(price_close, time) IS NOT NULL THEN LAST(price_close, time)
ELSE FIRST(price_open, time)
END AS price_open
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active June 14, 2024 00:16
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
@troyhunt
troyhunt / nmerrigan.json
Created October 2, 2021 20:51
Scraped LinkedIn data of Niall Merrigan
{
"id":"PMTPbtB79fUTnDS2f2Hn7Q_0000",
"full_name":"niall merrigan",
"first_name":"niall",
"middle_initial":null,
"middle_name":null,
"last_name":"merrigan",
"gender":"male",
"birth_year":null,
"birth_date":null,
@kjmph
kjmph / A_UUID_v7_for_Postgres.sql
Last active June 1, 2024 14:09
Postgres PL/pgSQL function for UUID v7 and a bonus custom UUID v8 to support microsecond precision as well. Read more here: https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
create or replace function uuid_generate_v7()
returns uuid
as $$
begin
-- use random v4 uuid as starting point (which has the same variant we need)
-- then overlay timestamp
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string
return encode(