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 / 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
@CypherpunkSamurai
CypherpunkSamurai / googleColabHold.js
Created February 10, 2025 06:57 — forked from prrao87/googleColabHold.js
Prevent google colab from disconnecting on chrome (right mouse click -> inspect -> console tab -> insert code)
function ConnectButton(){
console.log("Connect pushed");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click()
}
setInterval(ConnectButton,60000);
@CypherpunkSamurai
CypherpunkSamurai / travis-local.md
Created February 8, 2025 04:13 — forked from fulldecent/travis-local.md
Run Travis build locally

travis-local.md

Preconditions:

  1. POSIX or Windows system
  2. Install Docker
  3. A GitHub repo that already builds on Travis

Postcondition: