Skip to content

Instantly share code, notes, and snippets.

@lvii
lvii / xz-backdoor.md
Created March 30, 2024 15:06 — forked from thesamesam/xz-backdoor.md
xz-utils backdoor situation

FAQ on the xz-utils backdoor

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that gives developers lossless compression. This package is commonly used for compressing release tarballs, software packages, kernel images, and initramfs images. It is very widely distributed, statistically your average Linux or macOS system will have it installed for

@lvii
lvii / flycheck-ruff.el
Created February 27, 2023 14:07 — forked from abo-abo/flycheck-ruff.el
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"
@lvii
lvii / serializers.py
Created February 2, 2023 03:50 — forked from gengue/serializers.py
Django Rest Framework user endpoint with change password
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import serializers
from .models import User
class UserSerializer(serializers.ModelSerializer):
"""
User accounts serializer
@lvii
lvii / weread.user.js
Created October 6, 2022 02:23 — forked from jianyun8023/weread.user.js
weread download,直接生成epub。仅用于技术研究。
// ==UserScript==
// @name 微信读书下载
// @namespace http://tampermonkey.net/
// @version 0.4
// @description 下载微信读书的书籍资源
// @author tang
// @match https://weread.qq.com/web/reader/*
// @grant unsafeWindow
// @grant GM_setValue
// @grant GM_getValue
@lvii
lvii / README.md
Created September 6, 2022 07:32 — forked from agrif/README.md
my current ipxe setup

All of this should go into a directory that is available via HTTP and NFS. In variables.ipxe you can provide the HTTP root and NFS root paths, which are used later. Also there are some variables to set the default iscsi root (without the last part after the colon) and the initiator iqn. These are used to auto-fill the iscsi menu options.

You should tell iPXE to boot bootstrap.ipxe.

The bootstrap process reads a bunch of files and sets a bunch of variables. Of importance, it will read the file macs/XXXXXXX.ipxe

Keybase proof

I hereby claim:

  • I am lvii on github.
  • I am lvii (https://keybase.io/lvii) on keybase.
  • I have a public key ASDSSqVV60JjU5jGTqEvk0TzsHE1-vYRQj0YfuuUxIHqzAo

To claim this, I am signing this object:

@lvii
lvii / install
Created June 20, 2019 08:02
install openwrt router in china
#!/bin/sh
# you may want upgrade netifd first
# override shadowsocks server config
METHOD=xchacha20-ietf-poly1305
HOST=
PORT=
KEY=
#!/bin/sh
#依赖 dnsmasq-full iptables-mod-geoip geoip的数据文件 dns-forwarder
COUNTRY=japan #国家名,字符串,用于显示和注释
COUNTRY_CODE=JP #国家代码 geoip 用
DNS=8.8.4.4 #这个国家的域名走的dns,跟普通ss走的的区分开就行
INTERNAL_DNS_PORT=5301 #本功能内部使用的端口,没被占用就可以
INTERNAL_SS_PORT=1235
@lvii
lvii / gist:6842158
Last active December 24, 2015 18:19

mindmap 思维导图

mind42 网站在线画思维导图不错的,网站默认免费页面会有广告,可以在 firefox 的 greasemonkey 插件中安装 [mind42.com no ads][m] 脚本去掉的。电脑上可以下载安装 [xmind][x] 和 [freemind][f] 两个软件画思维导图的

这个是我整理的一些 电影 有关或其他什么 醍醐灌顶 的话:
http://mind42.com/public/3f1e4113-2c44-411c-bfac-0a5bbdac7855

这是一部分公开的技术相关的知识积累
http://mind42.com/user/cc4d95ad-1423-4657-909a-bc0f536cb992

@lvii
lvii / gist:5087791
Created March 5, 2013 03:33
python pdb
我 google 到两篇文章相关文章:
Title: pdb throws AttributeError at end of debugging session
http://bugs.python.org/issue13044
提到 set_trace() 是断点
For now set_trace() works as breakpoint set up by program
...