Skip to content

Instantly share code, notes, and snippets.

@thesamesam
thesamesam / xz-backdoor.md
Last active June 18, 2024 18:30
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

@guitarrapc
guitarrapc / curl_retry.sh
Created April 13, 2023 08:20
curl retry. docker gpg server is unstable these days.... 2023
# connect-timeout: 1s = connect timeout. if network connect is stopped frequentry, 1s will be strong option.
# max-time: 10s = must finish within this time
# retry: 5 = retry count
# retry-delay: 0 = no exponential backoff
# retry max time: 60 = retry no longer than
curl --connect-timeout 1 --max-time 10 --retry 5 --retry-delay 0 --retry-max-time 60 -fsSL https://download.docker.com/linux/ubuntu/gpg
@gpeal
gpeal / s1-metrics-collector.sh
Created March 9, 2023 22:41
SentinelOne metrics collector
sentinelctl metrics enable ; sentinelctl metrics dump > /tmp/metrics.json ; count=0 ; while :; do clear; sentinelctl metrics dump > /tmp/metrics-tmp.log ; if grep -q "no metrics available" /tmp/metrics-tmp.log; then echo "Metrics Disabled" ; exit ; fi ; if [ $count = 0 ]; then echo "Starting Metrics Collection" ; count=$((count + 10)) ; else echo "Metrics have been collected for $count seconds" ; count=$((count + 10)) ; fi ; sleep 3 ; diff -u /tmp/metrics.json /tmp/metrics-tmp.log > /tmp/metrics-new.patch ; patch /tmp/metrics.json /tmp/metrics-new.patch ; sleep 3 ; echo "Collecting Metrics & writing to /tmp/metrics.json" ; sleep 4 ; done
@abo-abo
abo-abo / flycheck-ruff.el
Created February 20, 2023 21:01
Emacs ruff flycheck config
(require 'flycheck)
;; From https://github.com/flycheck/flycheck/issues/1974#issuecomment-1343495202
(flycheck-define-checker python-ruff
"A Python syntax and style checker using the ruff utility.
To override the path to the ruff executable, set
`flycheck-python-ruff-executable'.
See URL `http://pypi.python.org/pypi/ruff'."
:command ("ruff"
"--format=text"
/usr/bin/launchctl unload "/Applications/Falcon.app/Contents/Library/SystemExtensions/com.crowdstrike.falcon.Agent.systemextension",
/usr/bin/launchctl unload "/Library/LaunchAgents/com.crowdstrike.falcon.UserAgent.plist",
/usr/bin/killall -9 "/Applications/Falcon.app/Contents/Library/LaunchServices/Falcon Notifications.app/Contents/MacOS/Falcon Notifications",
/sbin/kextunload -b "/Applications/Falcon.app/Contents/Extensions/Agent.kext"
/bin/rm -r "/Applications/Falcon.app"
/bin/rm "/Library/LaunchAgents/com.crowdstrike.falcon.UserAgent.plist"
/usr/local/bin/jamf recon
@jianyun8023
jianyun8023 / weread.user.js
Last active March 3, 2024 15:01
weread download,直接生成epub。仅用于技术研究。目前已失效
// ==UserScript==
// @name 微信读书下载(已失效)
// @namespace http://tampermonkey.net/
// @version 0.5.2
// @description 下载微信读书的书籍资源
// @author tang
// @match https://weread.qq.com/web/reader/*
// @grant unsafeWindow
// @grant GM_setValue
// @grant GM_getValue
@tomdaley92
tomdaley92 / README.md
Last active June 17, 2024 16:39
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@tomschr
tomschr / pathlib_and_json.py
Created May 1, 2021 15:11
Read and write JSON files with pathlib.Path
# Source
# Mastering Object-Oriented Python - Second Edition by Steven F. Lott Published by Packt Publishing, 2019
# https://learning.oreilly.com/library/view/mastering-object-oriented-python/9781789531367/c34be237-5ccd-4775-a0b0-ec1f7652f7bc.xhtml
#
from pathlib import Path
# write JSON files:
with Path("temp.json").open("w", encoding="UTF-8") as target:
json.dump(travel3, target, default=blog_j2_encode)
@robinsmidsrod
robinsmidsrod / ubuntu-autoinstall.ipxe
Last active May 21, 2024 06:36
Ubuntu 20.04 autoinstall (casper/subiquity/curtin) to iPXE - work-in-progress (not fully working for iSCSI)
:ubuntu-autoinstall
echo Starting Ubuntu ${ubuntu-version} ${archl} autoinstaller for ${initiator-iqn}
sanhook ${base-iscsi}:${hostname}.boot.ubuntu || sleep 1
#sanhook ${base-iscsi}:${hostname}.boot.ubuntu && set ubuntu-cc-iscsi storage: { layout: { name: lvm }, config: [{type: disk, path: ${base-iscsi}:${hostname}.boot.ubuntu }] } || sleep 1
#sanhook ${base-iscsi}:${hostname}.boot.ubuntu && set ubuntu-iscsi ISCSI_INITIATOR=${initiator-iqn} ISCSI_TARGET_NAME=${base-iqn}:${hostname}.boot.ubuntu ISCSI_TARGET_IP=${iscsi-server} ISCSI_TARGET_PORT=3260 || sleep 1
# https://medium.com/@tlhakhan/ubuntu-server-20-04-autoinstall-2e5f772b655a
# https://ubuntu.com/server/docs/install/autoinstall
# https://github.com/canonical/cloud-init/blob/master/doc/examples/kernel-cmdline.txt
# https://matt.olan.me/raspberry-pi-iscsi-root-on-ubuntu-20-04/
# https://askubuntu.com/questions/1235723/automated-20-04-server-installation-using-pxe-and-live-server-image
@zhouqt
zhouqt / user-data.yaml
Created January 27, 2021 18:47
ubuntu subiquity autoinstall user-data example
#cloud-config
autoinstall:
version: 1
early-commands:
- snap set system proxy.http="http://192.168.122.1:12345"
- snap set system proxy.https="http://192.168.122.1:12345"
locale: en_US
keyboard:
layout: en
variant: us