Skip to content

Instantly share code, notes, and snippets.

@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

// DISCLAIMER : You can now probably use `data-turbo-action="advance"` on your frame to perform what this controller is aiming to do
// https://turbo.hotwired.dev/handbook/frames#promoting-a-frame-navigation-to-a-page-visit
// Note that you probably want to disable turbo cache as well for those page to make popstate work properly
import { navigator } from '@hotwired/turbo'
import { Controller } from '@hotwired/stimulus'
import { useMutation } from 'stimulus-use'
export default class extends Controller {
connect (): void {
@syanle
syanle / ss.sh
Created December 22, 2020 05:24
shadowsocks+kcptun
#!/bin/bash
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qy shadowsocks-libev
cat>/etc/systemd/system/shadowsocks-server.service<<EOF
[Unit]
Description=Shadowsocks Server
@toryano0820
toryano0820 / wsl2-ubuntu-map-win-localhost.sh
Last active April 24, 2024 19:23
For WSL2: Fixes "Connection Refused" issue when accessing Windows localhost services. Run with "sudo sh wsl2-ubuntu-map-win-localhost.sh" !!! Remember to backup "/etc/hosts" just in case !!!
nameserver=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}') # find nameserver
[ -n "$nameserver" ] || "unable to find nameserver" || exit 1 # exit immediately if nameserver was not found
echo "##### nameserver found: '$nameserver'"
localhost_entry=$(grep -v "127.0.0.1" /etc/hosts | grep "\slocalhost$") # find localhost entry excluding 127.0.0.1
if [ -n "$localhost_entry" ]; then # if localhost entry was found
echo "##### localhost entry found: '$localhost_entry'"
sed -i "s/$localhost_entry/$nameserver localhost/g" /etc/hosts # then update localhost entry with the new $nameserver
else # else if entry was not found
echo "##### localhost entry not found"
echo "$nameserver localhost" >> /etc/hosts # then append $nameserver mapping to localhost
@julianrubisch
julianrubisch / .gitlab-ci.yml
Last active April 6, 2023 20:13
Gitlab CI Config for Minitest/system tests
image: "ruby:2.7"
services:
- postgres
- redis:latest
variables:
RAILS_ENV: test
POSTGRES_DB: my_app_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "password"
@maboloshi
maboloshi / README.md
Last active May 1, 2024 03:10
[Mac下配置Aria2] #macOS #aria2

Mac下配置Aria2

安装和设置 Aria2

# 使用 Homebrew 安装 aria2
brew install aria2

# 创建配置文件aria2.conf和空对话文件aria2.session
mkdir ~/.aria2 && cd ~/.aria2
touch aria2.conf
@qzm
qzm / aria2.conf
Last active April 27, 2024 04:59
Best aria2 Config
### Basic ###
# The directory to store the downloaded file.
dir=${HOME}/Downloads
# Downloads the URIs listed in FILE.
input-file=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to FILE on exit.
save-session=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0
save-session-interval=60
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5
@alexpaul
alexpaul / AccessToRootViewController.swift
Last active January 3, 2024 03:47
Getting access to the SceneDelegate window object in Xcode 11. SceneDelegate. Reset application window. Reset window. Reset rootviewcontroller. Root view controller. Scene delegate.
// accessing the window and changing the root view controller property
override func viewDidLoad() {
super.viewDidLoad()
// getting access to the window object from SceneDelegate
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let sceneDelegate = windowScene.delegate as? SceneDelegate
else {
return
}
let viewcontroller = UIViewController()
@cellularmitosis
cellularmitosis / README.md
Last active January 21, 2023 15:42
Gist mirror of "Learn Scheme in 15 Minutes"
# Put this file in /etc/nginx/sites-available
# Then "ln -s /etc/nginx/sites-available/aria2-nginx.conf /etc/nginx/sites-enabled"
# Then "sudo service nginx restart"
server {
listen 80;
listen [::]:80;
root /var/www/aria2; # Put your aria2 web ui here, such as AriaNg
index index.html;
server_name DOMAIN_NAME;
location / {