Skip to content

Instantly share code, notes, and snippets.

View Snawoot's full-sized avatar

Snawoot

View GitHub Profile
@skull-squadron
skull-squadron / collide.rb
Created July 5, 2024 08:02
Find a TOTP collision
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'openssl'
class Base32
ALPHABET = (('A'..'Z').to_a + ('2'..'7').to_a).map(&:freeze).freeze
PADDING_CHAR = '='
BITS_PER_BYTE = 8
0.0.0.0 api.surfeasy.com
0.0.0.0 opera-proxy.net
0.0.0.0 api.sec-tunnel.com
0.0.0.0 sitecheck2.opera.com
0.0.0.0 opera-mini.net
0.0.0.0 exchange.opera.com
0.0.0.0 features.opera-api.com
@chkuendig
chkuendig / LD_PRELOAD_nvidia-patch.c
Last active March 15, 2023 09:15
Quick Hack to test out 32bit nvfbc without having to patch the driver or rebuild the affected app
#define _GNU_SOURCE
// compile:
// gcc -m64 -shared -I../Capture_Linux_v7.1.9/NvFBC/inc -fPIC dl_prog3.c -o nvfbc_preload.64.so -ldl
// gcc -m64 -shared -I../Capture_Linux_v7.1.9/NvFBC/inc -fPIC dl_prog3.c -o nvfbc_preload.32.so -ldl
// Run:
// LD_PRELOAD="$PWD/nvfbc_preload.32.so $PWD/nvfbc_preload.64.so" DISPLAY=:0 ../Capture_Linux_v7.1.9/NvFBC/samples/NvFBCToGLEnc/NvFBCToGLEnc -f 10
#include "NvFBC.h"
@Chick3nman
Chick3nman / RTX_3080_v6.1.1.Benchmark
Created September 24, 2020 23:47
Hashcat v6.1.1 benchmark on the Nvidia RTX 3080
NVIDIA Driver Version: 455.23.05 CUDA Version: 11.1
Credit: r4d1x
For benchmarking the card and allowing me to release the benchmarks here
There are a handful of algorithms failing, mostly appears related to SCRYPT and
is liking a tuning issue or small driver issue that we will need to take a look at.
Otherwise, seems fairly stable.
@takurx
takurx / log_about_date_command_format.md
Created May 24, 2020 05:42
about date command format

1 and 2 is equivalent.

  • 1
sharo@kirima:~$ date "+%Y-%m-%dT%H:%M:%S%:z"
2020-05-24T14:38:26+09:00
  • 2
sharo@kirima:~$ date --iso-8601='seconds'
@jart
jart / illumination.sh
Last active June 20, 2022 18:58
Rational Illumination for PC and TV w/ IBM Scratchpad
#!/bin/sh
fricas -nosman <<EOF
E := [_
-- Standard Illumination Model for Computers_
--_
-- Is defined as a system of linear equations, where negative_
-- colors don't exist and is solved by computing the point at_
-- which they all intersect the one which needs to be defined_
-- as the Planckian locus of the illuminant._
@PhilipSchmid
PhilipSchmid / multicast-on-linux.md
Last active February 11, 2025 08:02
Testing Multicast Traffic on Linux

Testing Multicast Traffic on Linux

Prerequisites

By default Linux ignores Broadcast and Multicast ICMP messages. That's why you need to enable it first:

sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=0

Join and Test Multicast Traffic

To join any mutlicast address (e.g. 224.10.10.10/24) just add it to your active interface (e.g. eth0) and append the keyword autojoin at the end:

@jlevy
jlevy / simple-hash.js
Last active May 13, 2025 14:45
Fast and simple insecure string hash for JavaScript
// These hashes are for algorithmic use cases, such as bucketing in hashtables, where security isn't
// needed and 32 or 64 bits is enough (that is, rare collisions are acceptable). These are way simpler
// than sha1 (and all its deps) or similar, and with a short, clean (base 36 alphanumeric) result.
// A simple, *insecure* 32-bit hash that's short, fast, and has no dependencies.
// Output is always 7 characters.
// Loosely based on the Java version; see
// https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript
const simpleHash = str => {
let hash = 0;
@afdalwahyu
afdalwahyu / main.go
Last active October 16, 2024 12:31
golang dynamic port forward ssh socks5 tunnel
package main
import (
"context"
"fmt"
"net"
"os"
"os/signal"
"syscall"
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 22, 2025 22:57
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}