Skip to content

Instantly share code, notes, and snippets.

@Ryaang
Ryaang / gist:1f1dd6caa714e3e4844b545e83bd7b98
Created November 25, 2025 06:11
新服务器安全加固脚本
#!/bin/bash
# Ubuntu 24 安全初始化脚本
# 请以 root 用户运行: sudo bash secure-init.sh
# 1. 输入新用户名
read -p "请输入新用户名: " NEWUSER
adduser $NEWUSER
usermod -aG sudo $NEWUSER
# 2. 输入公钥并写入 authorized_keys
@jejkukany
jejkukany / script.js
Created October 30, 2025 16:36
Updates URL to current Youtube timestamp
// ==UserScript==
// @name YouTube URL Timestamp Updater
// @namespace http://tampermonkey.net/
// @version 2025-10-30
// @description Updates the URL with the current video time without creating duplicates.
// @author You
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// @author Daniel Young
@maanimis
maanimis / Function_Class_Hooking_Utility.ts
Last active October 30, 2025 09:06
Provides comprehensive hooking capabilities for functions and classes
/**
* Function and Class Hooking Utility
* Provides comprehensive hooking capabilities for functions and classes
*/
// Types for hook callbacks
type BeforeHook<T extends any[] = any[]> = (...args: T) => void | [...T];
type AfterHook<T = any> = (result: T, ...args: any[]) => T | void;
type ErrorHook = (error: Error, ...args: any[]) => void;
@ircfspace
ircfspace / worker.js
Created September 18, 2025 08:05
Simple GitHub Raw Proxy Worker
export default {
async fetch(request) {
const url = new URL(request.url);
const path = url.pathname.replace(/^\/+/, "");
const parts = path.split("/");
if (parts.length < 4) {
return new Response("Usage: /owner/repo/branch/path/to/file.ext", { status: 400 });
}
const [owner, repo, branch, ...filePathParts] = parts;
const filePath = filePathParts.join("/");
{
// UI
"workbench.iconTheme": "hypernym-icons",
"workbench.colorTheme": "FullstacksJS (Dark)",
"editor.cursorSmoothCaretAnimation": "on",
"editor.cursorBlinking": "smooth",
"editor.fontFamily": "'Monaspace Argon', 'DejaVuSansM Nerd Font', sans",
"editor.codeLensFontFamily": "'Monaspace Argon'",
"editor.inlineSuggest.fontFamily": "'Monaspace Argon'",
"markdown.preview.fontFamily": "'Monaspace Argon'",
@maanimis
maanimis / WebSocketMultiplexer.userscript.js
Last active August 8, 2025 07:47
Intercepts WebSocket connections and creates multiple connections instead of one(with Reconnect)
// ==UserScript==
// @name WebSocket Connection Multiplier+Reconnect
// @namespace http://tampermonkey.net/
// @version 3.1
// @description Intercepts WebSocket connections and creates multiple connections instead of one
// @author maanimis
// @match https://example.com/
// @icon https://www.google.com/s2/favicons?sz=64&domain=example.com
// @grant none
// @run-at document-start
@mrunknown0001
mrunknown0001 / ubuntu_debian_server_security_setup.md
Created July 22, 2025 04:11
Ubuntu/Debian Server Security Setup

Ubuntu/Debian Server Security Setup Guide

Prerequisites

  • Fresh Ubuntu/Debian server installation
  • Root or sudo access
  • Basic familiarity with command line

Step 1: Initial System Update

@Minion3665
Minion3665 / userscript.js
Last active March 21, 2025 18:06
Leave my keybinds alone userscript
// ==UserScript==
// @name Leave my keybinds alone
// @namespace Violentmonkey Scripts
// @match http*://*/*
// @grant none
// @version 1.0
// @author Skyler Grey <sky@a.starrysky.fyi>
// @description 19/03/2025 18:14:32: stop websites from overriding common browser keybinds
// @license MIT OR Unlicense OR CC0-1.0
// ==/UserScript==
// ==UserScript==
// @name Anti-Anti-Debug
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Bypass anti-debugging techniques and protect developer tools
// @author Hamaaad Raza
// @match *://*/*
// @run-at document-start
// @grant none
// ==/UserScript==
@realbardia
realbardia / main.cpp
Last active February 5, 2025 11:58
Very simple Neural Network using C++
#include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <random>
using namespace std;
// Activation and Derivative functions