Skip to content

Instantly share code, notes, and snippets.

@kinfables
kinfables / CFW_allow_lan_Guide.md
Last active February 7, 2024 09:31
Setup Allow LAN Environment with CFW

利用 Clash for Windows 部署局域网代理环境

Clash for Windows 是基于 Clash Core 开发的 Windows 平台代理工具,支持 Shadowsocks(R) / V2Ray / Trojan / Socks5 / HTTP(S) 等代理协议,支持策略组及规则分流。

下载地址: Github Releases

第一次使用?查看 快速上手

在配置好 Clash for Windows(下文略称为 CFW )后,我们可以考虑开启 Allow LAN (局域网代理共享),以便处于同一局域网内的其他设备接入到本机代理环境中。这不仅可以节省在多台设备中重复部署代理软件的时间,同时也可以通过 CFW 内置的 Connections 对局域网内设备的网络情况实时地管理与监控。

@jermdavis
jermdavis / Install-Solr.ps1
Last active November 23, 2021 13:30
A PowerShell script to help installing Solr as a service - See https://blog.jermdavis.dev/posts/2017/low-effort-solr-installs for details
Param(
$solrVersion = "6.6.2",
$installFolder = "c:\solr",
$solrPort = "8983",
$solrHost = "solr",
$solrSSL = $true,
$nssmVersion = "2.24",
$JREVersion = "1.8.0_151"
)
@kocisov
kocisov / next_nginx.md
Last active March 6, 2024 16:44
How to setup next.js app on nginx with letsencrypt
@vyznev
vyznev / se_hotness_estimator.user.js
Last active November 3, 2022 00:32
Adds an estimate of "hotness" to the question sidebar, calculated using the formula from http://meta.stackexchange.com/a/61343. Questions with a high hotness value may be selected for the Hot Network Questions list. Note that the hotness value displayed by this script does not include the per-site scaling factors, and so does not match the "arbi…
// ==UserScript==
// @name Stack Exchange hotness estimator
// @namespace http://vyznev.net/
// @description Estimates how highly each Stack Exchange question would rank on the Hot Network Questions list
// @author Ilmari Karonen
// @version 0.4.3
// @license Public domain
// @homepageURL https://meta.stackexchange.com/a/284933
// @downloadURL https://gist.github.com/vyznev/bb2c1adb6e96eb65a87bab3822c74e81/raw/se_hotness_estimator.user.js
// @match *://*.stackexchange.com/questions/*
#!/bin/bash
# Why? Education & zero redis-cli dependecy
# (it is a shame, however, that this functionality isn't a part of redis-cli... PR on the way)
HOST=127.0.0.1
PORT=6379
if [ $# -lt "2" ]
then
echo "Call a Redis command with its last argument being file contents"
echo "Usage: $0 <Redis command> <keys and arguments for command> <payload>"
@JonCole
JonCole / DiagnoseRedisErrors-ClientSide.md
Last active January 6, 2020 17:52
Diagnosing Redis errors caused by issues on the client side
@JonCole
JonCole / ThreadPool.md
Last active March 6, 2024 05:03
Intro to CLR ThreadPool Growth

ThreadPool Growth: Some Important Details

The CLR ThreadPool has two types of threads - "Worker" and "I/O Completion Port" (aka IOCP) threads.

  • Worker threads are used when for things like processing Task.Run(…) or ThreadPool.QueueUserWorkItem(…) methods. These threads are also used by various components in the CLR when work needs to happen on a background thread.
  • IOCP threads are used when asynchronous IO happens (e.g. reading from the network).

The thread pool provides new worker threads or I/O completion threads on demand (without any throttling) until it reaches the "Minimum" setting for each type of thread. By default, the minimum number of threads is set to the number of processors on a system.

Once the number of existing (busy) threads hits the "minimum" number of threads, the ThreadPool will throttle the rate at which is injects new threads to one thread per 500 milliseconds. This means that if your system gets a burst of work needing an IOCP thread, it will proces

@3rd-Eden
3rd-Eden / README.md
Last active January 4, 2021 10:20
Protecting against POODLE in node.js

[Google recently announced][poodle] that there is an exploit in SSLv3, this vulnerability is know as POODLE. There is no other option than to disable SSLv3 in order to combat this major flaw. There have already been [guides on how to disable this in different servers][guides]. But nothing excised for Node.js yet, until now. In order to resolve this for Node.js we need to use various of undocumented options and modules.

In the index.js file below you can see an example of how you can protect your HTTPS server against the POODLE attack. It uses the secureOptions option to pass in constants in to the SSL context which is created by node.

@monperrus
monperrus / Apriori.java
Last active August 11, 2023 11:22
Java implementation of the Apriori algorithm for mining frequent itemsets
import java.io.*;
import java.util.*;
/** The class encapsulates an implementation of the Apriori algorithm
* to compute frequent itemsets.
*
* Datasets contains integers (>=0) separated by spaces, one transaction by line, e.g.
* 1 2 3
* 0 9
* 1 9
i
me
my
myself
we
our
ours
ourselves
you
your