Skip to content

Instantly share code, notes, and snippets.

View xboston's full-sized avatar

Nikolay Kirsh xboston

View GitHub Profile
@alicilin
alicilin / BunConnection.ts
Created August 17, 2025 18:41
Elasticsearch Connection Class for use in Bun.js (uses Bun fetch API)
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
import type { ConnectionRequestResponseAsStream } from '@elastic/transport/connection/BaseConnection'
import type { ConnectionRequestOptionsAsStream } from '@elastic/transport/connection/BaseConnection'
import type { ConnectionRequestResponse } from '@elastic/transport/connection/BaseConnection'
import type { ConnectionRequestOptions } from '@elastic/transport/connection/BaseConnection'
import type { ConnectionRequestParams } from '@elastic/transport/connection/BaseConnection'
import type { ConnectionOptions } from '@elastic/transport/connection/BaseConnection'
//------------------------------------------------------------------------------------------------------------------
@0xdevalias
0xdevalias / _deobfuscating-unminifying-obfuscated-web-app-code.md
Last active December 7, 2025 16:55
Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code
@steelywing
steelywing / EnableSSH.js
Created January 31, 2021 05:51
Enable RedMi 2100 SSH access
// Work for RedMi 2100 firmware 2.0.23
// http://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/rm2100/miwifi_rm2100_all_fb720_2.0.23.bin
function getSTOK() {
let match = location.href.match(/;stok=(.*?)\//);
if (!match) {
return null;
}
return match[1];
}
@a1ip
a1ip / youtube-video-thumbnails-sizes-and-formats.md
Created April 7, 2020 18:53
YouTube video thumbnails sizes and formats

Note: YouTube is serving thumbnails from 2 servers:

  • //img.youtube.com
  • //i.ytimg.com

Examples are with //i.ytimg.com server just because it’s shorter, no other particular reason. You can use both.

  • Player Background Thumbnail (480x360):

@avivace
avivace / telegramRestore.md
Last active November 22, 2025 00:59
Restore deleted Telegram messages from groups

Restore deleted Telegram messages, medias and files from groups

There's not telegram API method for this, we need to call MTProto methods to retrieve messages from the "Recent Actions" (Admin Log) since deleted messages (and medias) gets moved there for 48 hours before the permanent deletion.

from telethon import TelegramClient, events, sync
from telethon.tl.types import InputChannel, PeerChannel
@wybiral
wybiral / noscript-tracking.go
Last active October 28, 2024 23:01
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@srstsavage
srstsavage / nginx_google_analytics
Last active August 6, 2025 05:27
google analytics in nginx
# send logs for all traffic (including non-html) to google analytics
#
# in server block:
# set $google_analytics_id "UA-THECORRECT-ID";
# include /srv/nginx/google_analytics;
#
# in location blocks:
# post_action @ga;
#
# notes: post_action has been referred to by nginx devs as a "dirty hack" and this approach may stop working one day.
@AlinaNova21
AlinaNova21 / README.md
Last active June 22, 2021 21:01
Rancher 2.0, RKE, and some Raspberry Pi 3s

Kubernetes and Arm

Getting rke and Rancher setup to run kubernetes on arm is interesting. There is no official support yet via rancher, although there is interest and some work done towards those efforts. This is my attempt at getting a cluster of 3 Pis (2 3Bs and 1 3B+) provisioned and registered to a rancher 2 server.

Prep

I've successfully completed this both with Hypriot OS 1.9.0 and the arm64 builds https://github.com/DieterReuter/image-builder-rpi64 Both times I used the same basic cloud-init setup

@soderlind
soderlind / Install.txt
Last active September 7, 2024 05:45
macOS DoH! (DNS over HTTPS) using cloudflared
1) Install cloudflared using homebrew:
brew install cloudflare/cloudflare/cloudflared
2) Create /usr/local/etc/cloudflared/config.yaml, with the following content
proxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query
04709f1bd7d8d8d7ad905fb26fe5016b77f4942dbd054402ad827fbdd503921b92957c55903b029cf00e2eea06370f0074b649ef8f6a3b0a90baec9cda9ebcfcaa;yddmat