Skip to content

Instantly share code, notes, and snippets.

View IceCodeNew's full-sized avatar

IceCodeNew IceCodeNew

  • PKU
  • Beijing
View GitHub Profile
@rickd-uk
rickd-uk / cloudSettings
Last active March 9, 2023 14:00
BASH - MAKE EVAL SAFE
{"lastUpload":"2023-03-09T14:00:32.624Z","extensionVersion":"v3.4.3"}
@yihong0618
yihong0618 / shanbay_remember.js
Last active December 1, 2022 04:40
扇贝加密破解自动发送今日新词到 telegram
const https = require("https");
const token = ""; // change this to you telegram bot token!
const chatId = ""; // change this to your telegram chat id!
const cookie = ""; // change this to your shanbay cookie!
const PATH_API = (page) =>
`/wordsapp/user_material_books/blozps/learning/words/today_learning_items?ipp=10&page=${page}&type_of=NEW`;
const options = {
@moesoha
moesoha / worker.js
Last active September 10, 2024 20:16
Auto kick any joining users from Telegram group (deployed on Cloudflare Worker)
addEventListener('fetch', event => event.respondWith(handleRequest(event.request)));
// Add environment variable `TGBOT_TOKEN` via Worker-Settings
async function requestTelegramBotAPI(method, payload) {
return fetch(`https://api.telegram.org/bot${TGBOT_TOKEN}/${method}`, {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8"
},
body: !payload ? undefined : JSON.stringify(payload)
@k4yt3x
k4yt3x / ipa.md
Last active October 11, 2022 21:19
ipa: A shell alias that will simplify your "ip address" output

ipa

Description

ipa is a shell function that will display the distilled informaiton from the ip a command.

Screenshots

image

@k4yt3x
k4yt3x / zshrc
Last active November 7, 2024 23:20
K4YT3X Server/Community zshrc
# K4YT3X Server/Community Zshrc
# Version: 2024.11.07
# Copyright (C) 2017-2024 K4YT3X.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@haproxytechblog
haproxytechblog / haproxy-config-2-0.cfg
Created June 13, 2019 20:41
HAProxy 2.0 configuration
#
# This is the ultimate HAProxy 2.0 "Getting Started" config
# It demonstrates many of the features available which are now available
# While you may not need all of these things, this can serve
# as a reference for your own configurations.
#
# Have questions? Check out our community Slack:
# https://slack.haproxy.org/
#
@zoonderkins
zoonderkins / awesome-dns-resolver.md
Last active May 13, 2023 14:57
awesome-dns-resolver
@mhofman
mhofman / HAProxy-transparent-web-services-routing.md
Last active June 17, 2024 13:51
Leverage HAProxy to transparently route requests to web services identified by host name.

Web Service Fronting

Multiple Web properties on a single IP address

Hosting multiple websites on a single public IP address on the standard HTTP(S) ports is relatively easy with popular web servers like Apache, Nginx and lighttpd all supporting Virtual Hosts.
For Web Services which bundle their own HTTP server, things get more complicated, unless their HTTP stack can be shared somehow. More often than not, the application's HTTP stack listens directly on a dedicated TCP port.

Hosting multiple services on a single IP then requires using a fronting server listening on the standard HTTP port, and routing to the right backend service based on the host name or the path sent by the client.
Path based routing is cumbersome, usually requiring either the service to be aware of the path prefix, or a rewrite by the HTTP fronting server of all absolute URLs in the requests and responses.
Hostname based routing is more straightforward. The fronting server can just look at the [HTTP/1.1 Host header](https://tools

@tonyseek
tonyseek / android-captive.sh
Last active November 16, 2024 13:12
Overrides the captive portal settings of Android in the People's Republic China mainland
#!/usr/bin/env sh
## I don't have any devices running Android OS now. These settings may have been outdated but I cannot verify it.
adb shell settings put global captive_portal_fallback_url http://g.cn/generate_204
adb shell settings put global captive_portal_http_url http://www.google.cn/generate_204
adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204
adb shell settings put global captive_portal_other_fallback_urls http://www.qualcomm.cn/generate_204
@naodesu
naodesu / resumedat_2015.rb
Last active May 23, 2022 09:53 — forked from stu43005/resumedat_2015.rb
Convert added torrents data from uTorrent (resume.dat) to qBittorrent (*.fastresume) format
# encoding: utf-8
# USE AT OWN RISK
#
# Follow this guide to install Ruby on Windows (step 1 and 2): https://forwardhq.com/support/installing-ruby-windows
# Install gems (with admin cmd prompt):
# https://rubygems.org/gems/bencode
# https://rubygems.org/gems/rest_client
#
# Edit datpath below to point to your utorrent resume.dat file