Skip to content

Instantly share code, notes, and snippets.

View CypherpunkSamurai's full-sized avatar
😶
Currently Busy 🌻🐢

Cypherpunk Samurai CypherpunkSamurai

😶
Currently Busy 🌻🐢
View GitHub Profile
@CypherpunkSamurai
CypherpunkSamurai / patch.bat
Created March 5, 2025 22:25 — forked from shinchiro/patch.bat
Creating xdelta patch easy way.
@echo OFF
:: How to use:
:: 1. Put xdelta3.exe in C:\
:: 2. Put old_file and new_file in any folder but must in same directory
:: 3. run with cmd: patch.bat old_file.mkv new_file.mkv mypatch
:: 4. patch now in 'xdelta' folder
set xdelta3="C:\xdelta3.exe"
set patch_dir=%~dp1\xdelta
call :Createxdelta %1 %2 %3
@CypherpunkSamurai
CypherpunkSamurai / DrawSineWave.html
Created March 4, 2025 13:49 — forked from gkhays/DrawSineWave.html
Oscillating sine wave, including the steps to figuring out how to plot a sine wave
<!DOCTYPE html>
<html>
<head>
<title>Sine Wave</title>
<script type="text/javascript">
function showAxes(ctx,axes) {
var width = ctx.canvas.width;
var height = ctx.canvas.height;
var xMin = 0;
@CypherpunkSamurai
CypherpunkSamurai / r1.py
Created February 27, 2025 19:38 — forked from vgel/r1.py
script to run deepseek-r1 with a min-thinking-tokens parameter, replacing </think> with a random continuation string to extend the model's chain of thought
import argparse
import random
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache
import torch
parser = argparse.ArgumentParser()
parser.add_argument("question", type=str)
parser.add_argument(
@CypherpunkSamurai
CypherpunkSamurai / structlog_fastapi.py
Created February 25, 2025 07:42 — forked from nkhitrov/structlog_fastapi.py
Structlog FastAPI example
"""
Structlog example configuration with FastAPI.
Features:
- async bound logger
- contextvars to log request-id and other meta data
- custom format for default logging loggers and structlog loggers
"""
import asyncio
import logging
@CypherpunkSamurai
CypherpunkSamurai / README.md
Created February 25, 2025 05:53 — forked from matusnovak/README.md
GPG + Git SSH Authentication and Signing on Windows 10

GPG + Git SSH Authentication and Signing on Windows 10

Introduction

This simple Gist will explain how to settup your GPG key to work for SSH authentication (with Git) and Git commit signing on Windows 10. This may seem straightforward on Linux, but there are certain tweaks needed on Windows.

No Cygwin, no MinGW, no Git Bash or any other Linux emulated environment. This works in pure Windows 10.

Software needed

@CypherpunkSamurai
CypherpunkSamurai / TorNoAuth.md
Created February 23, 2025 17:28 — forked from DusanMadar/TorNoAuth.md
A step-by-step guide how to use Tor without Authentication
@CypherpunkSamurai
CypherpunkSamurai / OpenInSciHub.user.js
Created February 23, 2025 07:41 — forked from ifeelagood/OpenInSciHub.user.js
Open In Sci-Hub Userscript
// ==UserScript==
// @name Open In Sci-Hub
// @namespace Violentmonkey Scripts
// @match https://sciencedirect.com/*
// @match https://link.springer.com/article/*
// @match https://ieeexplore.ieee.org/document/*
// @match https://www.sciencedirect.com/science/article/*
// @match https://www.nature.com/articles/*
// @match https://journals.plos.org/plosone/article?id=*
// @match https://academic.oup.com/journals/*
@CypherpunkSamurai
CypherpunkSamurai / SettingupPGPandGit.md
Created February 19, 2025 07:42 — forked from simongle/SettingupPGPandGit.md
A guide for PGP and Git

Setting up PGP with Git

#PGP

If you are reading this, you have taken the first step towards encryption self-righteousness. The steps below are my preferred method for configuration after years of suffering through alternative, more archaic/byzantine steps.

Note, if you already have a PGP key, skip to step #4. Second note: I know UNIX best, so I’m not going to embarrass myself by attempting to write a windows guide. The good people over at EFF have your back: How to: Use PGP for Windows | Surveillance Self-Defense

[A point of clarification: PGP stands for pretty good privacy and is the original underlying protocol, GPG stands for Gnu Privacy Guard, and is an open source program that is compliant with PGP; the two acronyms are often used interchangeably.]

  1. Download your GPG client
@CypherpunkSamurai
CypherpunkSamurai / ipv4_ipv6_doh_doq.md
Created February 18, 2025 20:52 — forked from leiless/ipv4_ipv6_doh_doq.md
List of direct IPv4/IPv6 DoH/DoQ

dns.google / 8888.google

8.8.4.4
8.8.8.8
2001:4860:4860:0:0:0:0:64
2001:4860:4860:0:0:0:0:6464
2001:4860:4860:0:0:0:0:8844
2001:4860:4860:0:0:0:0:8888

Problem

I was training a deep learning model on Google Colab. I had to go somewhere for an emergency work. When I came back, I realized that Colab was disconnected; Therefore, I had to run the whole model again.

Solution

I searched on the Internet to solve this problem. I noticed that Colab will be disconnected if you don't click on the page. Here is an answer that I find:

function ClickConnect() {
  console.log('Working')
 document