Skip to content

Instantly share code, notes, and snippets.

Avatar
🌎

Richard Patel terorie

🌎
View GitHub Profile
@jgensler8
jgensler8 / README.md
Last active Feb 26, 2022
solana compute budget testing
View README.md
@camthesaxman
camthesaxman / doldisasm.py
Last active Apr 11, 2022
GameCube .dol disassembler
View doldisasm.py
#!/usr/bin/env python
#
# GameCube .dol file disassembler
# Usage: doldisasm.py DOL_FILE > assembly_file.s
#
from capstone import *
from capstone.ppc import *
import sys
@lcrilly
lcrilly / README.md
Last active Apr 6, 2022
NGINX OAuth 2.0 Token Introspection
View README.md

OAuth 2.0 Token Introspection with NGINX and njs

This configuration enables NGINX to validate an authentication token against an authorization server by using OAuth 2.0 Token Introspection (RFC 7662). This solution uses the auth_request module and the NGINX JavaScript module to require authentication and perform the token introspection request.

By default, the client's authentication token is expected as a bearer token supplied in the Authorization header. If supplied elsewhere in the HTTP request, the $access_token variable must be configured to specify where to obtain the token.

Token introspection requests are authenticated. By default, the $oauth_client_id and $oauth_client_secret variables are used to perform HTTP Basic authentication with the Authorization Server. If only the $oauth_client_secret variable is specified then that value is used

@miguelmota
miguelmota / notes.md
Last active Feb 25, 2022
BIP32 vs BIP39 vs BIP44
View notes.md
  • BIP32 - is a method for generating a tree of private keys from a master private key.
  • BIP39 - is a method for encoding 128-256 bits of random data into 12-24 word phrases from a list of interchangeable 2018 words, and then turn those phrases into a 64-byte hash.
  • BIP44 - is a method for structuring a private key tree in a specific way that will facilitate usage/restoration/discovery of multiple accounts for multiple purposes.
@mariomadproductions
mariomadproductions / debug_games.md
Last active Sep 27, 2021 — forked from unreceptive/debug_games.md
List of video games shipped with debug symbols.
View debug_games.md

List of any video game shipped with debugging symbols.

Contributions are welcome.

Name Version Platform Notes
Brunswick Pro Bowling Unknown Nintendo 3DS Contains an ELF binary with full symbol information in its RomFS root
Fire Emblem: If/Fates All (double check) Nintendo 3DS All released versions of the game contain "name.StackTrace" and "addr.StackTrace" files in the "debug" folder in the RomFS, which provide full function names/signatures for the game's code.bin
Inazuma Eleven 3 Lightning Bolt / Team Ogre Attacks / Bomb Blast Unknown Nintendo 3DS CRO/CRS contains symbols
The Legend of Zelda: The Wind Waker n/a Nintendo GameCube
View Git Subtree basics.md

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@pjdietz
pjdietz / rfc3339.js
Last active Apr 14, 2022
Format a local date as an RFC 3339 date with timezone
View rfc3339.js
function rfc3339(d) {
function pad(n) {
return n < 10 ? "0" + n : n;
}
function timezoneOffset(offset) {
var sign;
if (offset === 0) {
return "Z";
@dvliman
dvliman / gist:11264471
Created Apr 24, 2014
4chan source code leak
View gist:11264471
<?
if(file_exists('/www/global/lockdown')) {
if($_COOKIE['4chan_auser'] && $_COOKIE['4chan_apass'] && ($_POST['mode']=='usrdel'||$_GET['mode']=='latest')) {
// ok
}
else {
die('Posting temporarily disabled. Come back later!<br/>&mdash;Team 4chan (uptime? what\'s that?)');
}
}
include_once "./yotsuba_config.php";
@albrow
albrow / confirm.go
Last active Feb 25, 2022
Go (golang): How to ask for user confirmation via command line
View confirm.go
import (
"fmt"
"log"
"os"
"sort"
)
// askForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and
// then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as
// confirmations. If the input is not recognized, it will ask again. The function does not return
@amitchhajer
amitchhajer / Count Code lines
Created Jan 5, 2013
Count number of code lines in git repository per user
View Count Code lines
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n