Skip to content

Instantly share code, notes, and snippets.

View winguse's full-sized avatar
🎣
fishing

Yingyu Cheng winguse

🎣
fishing
View GitHub Profile

Page Mask Bookmarklet

A bookmarklet that masks all text and images on any page, using only CSS. It doesn't modify the page's DOM and works for every script (Latin, Chinese, Japanese, etc.). It's useful for screenshots, screen sharing, and demos.

Install

Create a new bookmark in your browser, name it something like "Mask page", and paste the entire script below as the URL (it starts with javascript:). In Chrome, right-click the bookmarks bar, choose "Add page...", and paste the script into the URL field.

If the bookmark does nothing, check that the URL still starts with javascript:. Chrome sometimes drops it when pasting.

#!/usr/bin/env bash
# install-grpcurl.sh
# Usage: ./install-grpcurl.sh [version]
# VERSION env var or first arg overrides the default (1.9.4)
set -euo pipefail
VERSION="${1:-${VERSION:-1.9.4}}"
OS="$(uname -s)"
ARCH="$(uname -m)"
@winguse
winguse / ssh-door.sh
Last active November 30, 2023 06:11
open your ssh door by send a UDP package `echo zhi-ma-kai-men | nc -u server-ip 54321`
#!/usr/bin/env bash
OPEN_DOOR_UDP_PORT=54321
OPEN_DOOR_TOKEN=zhi-ma-kai-men
SSH_ALLOW_TIMEOUT=10
IP_SET_MAX=8
SSH_IP_SET=ssh-ip-set
ipset create $SSH_IP_SET hash:ip \
timeout $SSH_ALLOW_TIMEOUT \
#!/usr/bin/env bash
PORT_SCAN_MAX=1
IP_DENY_SECOND=300
IP_SET_MAX=1024000
NET_IF=eth0
ipset create pub-port-set bitmap:port range 0-65535
ipset add pub-port-set 22
@winguse
winguse / .env
Created April 1, 2022 19:26
Teslamate deploy
TM_DB_USER=teslamate
TM_DB_PASS=PASSWORD_HERE
TM_DB_NAME=teslamate
GRAFANA_USER=admin
GRAFANA_PW=PASSWORD_HERE
TM_TZ=America/Los_Angeles
Hi Apple,
Well known to the world, Apple treats customers' privacy as a high priority.
I recently realized that two popular Apps in the Chinese community, Wechat, and AliPay, will get started in the background when my iPhone changes its state of WiFi connection. Further research indicates that these two Apps implemented the HotspotHelper feature of iOS.
I know these features can be helpful, during which they can help users connect to public WiFi, but most people rarely use this feature. For example, I am not aware of this before today. I also do not expect my WiFi connectivities to be monitored by these two Apps. I try my best to find a way to disable this feature in these two Apps' settings, and there is no help.
I urge Apple to consider this situation, stop the abusing usage of these two companies, and provide consumers options and transparency about their WiFi network connection activities.
const http = require('http');
const { spawn } = require('child_process');
const jobs = {};
setInterval(() => {
Object.keys(jobs).forEach(url => {
const {ts} = jobs[url];
if (Date.now() - ts > 24 * 3600 * 1000) {
delete jobs[url];
#!/bin/sh
echo '
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.ipv4.tcp_window_scaling = 1
@winguse
winguse / create_place_holder.js
Last active July 1, 2020 03:12
copy and paste this in your browsers' console...
const walk = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false);
const delay = [];
while (true) {
const node = walk.nextNode();
if (!node) break;
if (!node.textContent.trim()) continue;
const { parentElement } = node;
if (parentElement.tagName === 'STYLE') continue;
const { color, display } = getComputedStyle(parentElement);
if (display === 'inline') {
const fs = require('fs')
const http = require('http');
// https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest
// https://ftp.apnic.net/stats/apnic/delegated-apnic-latest
/**
* get content from URL
* @param {String} url URL
* @returns {Promise<String>} the response body of input URL