Skip to content

Instantly share code, notes, and snippets.

View Konano's full-sized avatar
🎲
Relax

Nano Konano

🎲
Relax
  • Tsinghua University
  • AS16-November-08 @ Ingress
  • 10:40 (UTC +08:00)
View GitHub Profile
@gelldur
gelldur / Grafana Alert Template.md
Last active October 24, 2024 10:31 — forked from Himura2la/Grafana Alert Template.md
How to use Grafana Alerts with the Telegram
  • Template name: telegram.message
  • Content:
    {{- /* Telegram message to use: {{ template "telegram.message2" . }} */ -}}
    {{ define "__alerts_list" -}}
    {{ range . }}
    {{if ne (index .Labels "alertname") "" -}}
    {{ if eq .Status "firing" }}🔴{{ else }}🟢{{ end }}
        {{- if ne (index .Labels "severity") "" -}}
            <u><b>P{{ index .Labels "severity" }}</b></u> {{ end -}}
@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active October 3, 2024 11:42
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@mariotaku
mariotaku / LspWslFix.ps1
Created December 20, 2022 11:09
Fix WSL Connection Issue Caused by Winsock
#Requires -RunAsAdministrator
# Fix for https://github.com/microsoft/WSL/issues/4177
$MethodDefinition = @'
[DllImport("ws2_32.dll", CharSet = CharSet.Unicode)]
public static extern int WSCSetApplicationCategory([MarshalAs(UnmanagedType.LPWStr)] string Path, uint PathLength, [MarshalAs(UnmanagedType.LPWStr)] string Extra, uint ExtraLength, uint PermittedLspCategories, out uint pPrevPermLspCat, out int lpErrno);
'@
$Ws2Spi = Add-Type -MemberDefinition $MethodDefinition -Name 'Ws2Spi' -PassThru
@Himura2la
Himura2la / Grafana Alert Template.md
Last active May 16, 2024 15:46
How to use Grafana Alerts with the Telegram
  • Template name: telegram.message
  • Content:
    {{ define "alert_list" }}{{ range . }}{{ .Labels.alertname }}
    {{ range .Annotations.SortedPairs }}<strong>{{ .Name }}</strong>: {{ .Value }}
    {{ end }}| {{ if gt (len .GeneratorURL) 0 }}<a href="{{ .GeneratorURL }}">source</a> | {{ end }}{{ if gt (len .SilenceURL) 0 }}<a href="{{ .SilenceURL }}">silence</a> | {{ end }}{{ if gt (len .DashboardURL) 0 }}<a href="{{ .DashboardURL }}">dashboard</a> | {{ end }}{{ if gt (len .PanelURL) 0 }}<a href="{{ .PanelURL }}">panel</a> |{{ end }}
    —
    {{ end }}{{ end }}
    {{ define "telegram.message" }}
    

{{ if gt (len .Alerts.Firing) 0 }}FIRING!!!

@gugutt
gugutt / 1.md
Last active January 8, 2023 03:50
writeup

Writeup

首先运行一下 python ether_v2.py,这个程序需要输一串东西,而输各种东西都只能看到一个 You are too vegetable please try again!。试图劫持各种函数,也发现对获取程序逻辑没有太大帮助,那么还是老老实实看字节码吧。

试着反编译了一下,但是也出错。把 dis 模块的代码拷过来调试,发现程序一开始就是个大跳转,而很多不会被执行的地方也有很多非法指令。可以按照跳转的顺序输出字节码,就能得到比较容易分析的结果了。

import marshal
from opcode import *
@abc1763613206
abc1763613206 / bvtest.py
Last active August 31, 2024 01:43
BVID Validate
import requests
import json
import random
Back_URL = 'https://api.bilibili.com/x/web-interface/archive/stat?aid='
headers = {
'Cookie': "Replace Me With REAL COOKIE" ,
'Pragma': 'no-cache',
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active November 19, 2024 16:33
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@zhuziyi1989
zhuziyi1989 / URL Schemes.md
Last active November 19, 2024 08:25
常用 URL Schemes 收集。

** 由于此文年事已久,可能某些 URL Schemes 已失效,可在评论区留言指出!(最后更新于 2024.10.28)

关于 URL Scheme 你知道多少?

iOS 系统中

由于苹果的各应用都是在沙盒中,不能够互相之间访问或共享数据。但是苹果还是给出了一个可以在 APP 之间跳转的方法:URL Scheme。简单的说,URL Scheme 就是一个可以让 APP 相互之间可以跳转的协议。每个 APP 的 URL Scheme 都是不一样的,如果存在一样的 URL Scheme,那么系统就会响应先安装那个 APP 的 URL Scheme,因为后安装的 APP 的 URL Scheme 被覆盖掉了,是不能被调用的。

Android 系统中

@anamewing
anamewing / cleveref-chinese.tex
Last active October 3, 2024 07:16
Add Simplified Chinese translation to cleveref.
\crefname{equation}{式}{式}
\crefname{figure}{图}{图}
\crefname{table}{表}{表}
\crefname{page}{页}{页}
\crefname{chapter}{章}{章}
\crefname{section}{节}{节}
\crefname{appendix}{附录}{附录}
\crefname{theorem}{定理}{定理}
\crefname{lemma}{引理}{引理}
\crefname{corollary}{推论}{推论}
@blueset
blueset / README.md
Last active May 14, 2019 15:49
Filter all telegram stickers messages in groups for 60 seconds.
  1. Clone https://github.com/vysheng/tg/, and install all necessary dependencies
  2. Apply documents.patch, then ./configure && make
  3. pip3 install pytg
  4. Modify main.py and change tgdir to the correct path.
  5. Log in your tg-cli
  6. nohup ./bin/telegram-cli --json -R -W -P 4458 --permanent-peer-ids --permanent-peer-ids > /dev/null &
  7. nohup python3 kagami.py &gt; /dev/null &amp;