Skip to content

Instantly share code, notes, and snippets.

View halfcrazy's full-sized avatar

halfcrazy halfcrazy

View GitHub Profile
@halfcrazy
halfcrazy / colamanga-navi.user.js
Created July 3, 2025 12:58
colamanga键盘翻页
// ==UserScript==
// @name 左右方向键翻章
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 使用键盘左右方向键在网站上导航到上一章或下一章。
// @author Gemini
// @match https://www.colamanga.com/*.html
// @grant none
// @license MIT
// ==/UserScript==
@halfcrazy
halfcrazy / deploy.yaml
Last active October 25, 2022 02:00
karmada验证结果
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
@halfcrazy
halfcrazy / ssl_server_port.patch
Created February 28, 2019 08:48
ssl_certificate_by_lua server_port
diff -ruN openresty-1.13.6.2/bundle/lua-resty-core-0.1.15/lib/ngx/ssl.lua openresty-1.13.6.2-patched/bundle/lua-resty-core-0.1.15/lib/ngx/ssl.lua
--- openresty-1.13.6.2/bundle/lua-resty-core-0.1.15/lib/ngx/ssl.lua 2018-04-23 02:47:22.000000000 +0800
+++ openresty-1.13.6.2-patched/bundle/lua-resty-core-0.1.15/lib/ngx/ssl.lua 2019-02-28 16:13:56.422720600 +0800
@@ -38,6 +38,9 @@
int ngx_http_lua_ffi_ssl_server_name(ngx_http_request_t *r, char **name,
size_t *namelen, char **err);
+int ngx_http_lua_ffi_ssl_server_port(ngx_http_request_t *r,
+ int *port, char **err);
+
curl -vvvv https://bitbucket.org
* Rebuilt URL to: https://bitbucket.org/
* Hostname was NOT found in DNS cache
* Trying 104.192.143.3...
* Trying 2401:1d80:1010::152...
* Immediate connect fail for 2401:1d80:1010::152: Network is unreachable
* Connected to bitbucket.org (104.192.143.3) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
@halfcrazy
halfcrazy / sshpass.rb
Created May 4, 2018 02:25
sshpass v1.0.6
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
worker_processes 1;
error_log logs/error.log;
pid logs/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096; ## Default: 1024
}
http {
@halfcrazy
halfcrazy / sync.sh
Last active January 8, 2018 16:10
Sync local repo
#! /usr/bin/env bash
for d in `ls -d */`
do
cd $d
git remote > /dev/null 2>&1
if [ $? -eq 0 ]; then
if [ $(git rev-parse --abbrev-ref HEAD) == 'master' ]; then
git diff-index --quiet HEAD
if [ $? -eq 0 ]; then
echo syncing $d
@halfcrazy
halfcrazy / lua.txt
Created October 21, 2016 02:11
LuaJIT 2.1.0-beta2 and Lua 5.2.4 built-in module
table: 0x7fc226403b10 {
[os] => table: 0x7fc226403b10 {
[time] => function: 0x10c6c91a3
[date] => function: 0x10c6c8be0
[remove] => function: 0x10c6c90c3
[exit] => function: 0x10c6c9024
[clock] => function: 0x10c6c8b9d
[execute] => function: 0x10c6c8fdf
[tmpname] => function: 0x10c6c92f6
[difftime] => function: 0x10c6c8f97
@halfcrazy
halfcrazy / dontwork.el
Last active September 28, 2016 12:04
tramp hang
;; GNU Emacs: 25.1.1 Tramp: 2.2.13.25.1 -*- mode: outline; -*-
;; Location: /usr/local/Cellar/emacs-plus/25.1/share/emacs/25.1/lisp/net/tramp.elc Git: nil
20:02:32.064023 tramp-get-file-property (8) # file-attributes-string nil
20:02:32.064406 tramp-get-connection-property (7) # stat undef
20:02:32.064506 tramp-get-remote-stat (5) # Finding a suitable ‘stat’ command
20:02:32.064598 tramp-get-connection-property (7) # remote-path undef
20:02:32.064700 tramp-get-connection-property (7) # process-name nil
20:02:32.064799 tramp-get-connection-property (7) # process-name nil
20:02:32.064887 tramp-get-connection-property (7) # process-buffer nil
20:02:32.065011 tramp-file-name-handler (5) # Non-essential received in operation (file-attributes /ssh:53: string)