Skip to content

Instantly share code, notes, and snippets.

View levi-nz's full-sized avatar

Levi levi-nz

  • New Zealand
  • 04:24 (UTC +12:00)
View GitHub Profile
@levi-nz
levi-nz / encrypt.js
Created July 17, 2023 08:22
Adyen 4.5.0 encryption
/*
* Adyen 4.5.0 encryption by github.com/levi-nz
*
* This code is a rough implementation and can be improved in some places.
* Read comments throughout the code for more information.
*/
const jose = require('node-jose');
// Parse the key from the string found in securedFields.html ("10001|...")
@levi-nz
levi-nz / calculate_compute_hours.py
Last active June 15, 2023 02:43
Calculate approximate GameLift compute usage from player count and other variables
# --- CONFIG ---
# Options here can be set by normal users.
# Total amount of players playing the game
n_players = 500
# Amount of players per match (includes both teams)
n_players_per_match = 16 * 2 # 16 players per team
# Duration (in minutes) of each match
match_duration_mins = 30
# How many hours the playtest lasts
@levi-nz
levi-nz / ordered_json_object.py
Created May 18, 2023 15:53
JSON key ordering in objects
import json
class OrderedObjectDecoder(json.JSONDecoder):
def __init__(self, *args, **kwargs):
json.JSONDecoder.__init__(self, object_hook=self.object_hook, *args, **kwargs)
def object_hook(self, obj):
return {key: value for key, value in sorted(obj.items())}
@levi-nz
levi-nz / gist:55c230e32a8ef1038dac49d0dd941041
Created October 15, 2021 07:46
Verizon IP range scraping result
GOROOT=/usr/local/go #gosetup
GOPATH=/Users/levi/go #gosetup
/usr/local/go/bin/go build -o /private/var/folders/bt/w6199q096tn8yr5g8hp1b6jm0000gn/T/GoLand/___go_build_github_com_LeviDevs_verizon_business_finder_main github.com/LeviDevs/verizon-business-finder/main #gosetup
/private/var/folders/bt/w6199q096tn8yr5g8hp1b6jm0000gn/T/GoLand/___go_build_github_com_LeviDevs_verizon_business_finder_main -apiKey=at_TdCzkzo9LFvsVfeoVSzyq5DZz7Jef
2021/10/15 20:40:15 64.35.25.224: https://www.verizon.com/business/xo/
2021/10/15 20:40:15 62.189.90.96: https://www.verizon.com/business/
2021/10/15 20:40:16 71.123.55.72: https://www.verizon.com/business/
2021/10/15 20:40:16 65.201.80.192: https://www.verizon.com/business/
2021/10/15 20:40:16 65.46.218.244: https://www.verizon.com/business/xo/
2021/10/15 20:40:16 66.104.48.16: https://www.verizon.com/business/xo/
State is now HANDSHAKING
Jun 03, 2019 7:54:19 PM io.netty.channel.DefaultChannelHandlerContext invokeExceptionCaught
WARNING: An exception was thrown by a user handler's exceptionCaught() method while handling the following exception:
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(1) + length(1) exceeds writerIndex(1): UnpooledHeapByteBuf(ridx: 1, widx: 1, cap: 1)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:263)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:131)
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173)
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
@levi-nz
levi-nz / gist:1b28bbd75f80529fbdba6e1b1aa9afc4
Created June 1, 2019 13:35
Lunar Client Ban Wave #1 JSON data
{"servers":["faithfulmc.com"],"uuid":06cca004-913d-4279-8720-9a6dfda4a2ad,"username":"incrust"}
{"servers":["lunar.gg"],"uuid":0965dc54-f9be-40ec-8d6c-5e848857833b,"username":"Cobalt_Will"}
{"servers":["pvptemple.com","minemen.club","faithfulmc.com","cavepvp.com","squads.gg"],"uuid":3304556a-8730-47ca-8681-8fcaa5ab95c8,"username":"Rolm"}
{"servers":["faithfulmc.com","lunar.gg"],"uuid":fceab8f9-3568-404d-9f50-7a338e3704e7,"username":"Checkiing"}
{"servers":["lunar.gg"],"uuid":619fd4ae-9e54-47fb-9569-8f5e1495a844,"username":"Deciple"}
{"servers":["pvptemple.com","faithfulmc.com","lunar.gg"],"uuid":2ceb5779-017b-4fd5-aa3d-beca94393585,"username":"1x21"}
{"servers":["lunar.gg"],"uuid":ecb99c38-63ba-4aee-878f-072f30600918,"username":"Jakhe"}
{"servers":["lunar.gg"],"uuid":406a3bf2-ba70-463f-ad7e-396d5f6eb863,"username":"clownedGG"}
{"servers":["sagepvp.org","lunar.gg"],"uuid":2fd24d40-88ec-4a35-a6c3-f7f49bb782c8,"username":"Nyzy"}
{"servers":["holyh.cf","eaglehcf.com","ghostly.live","lunar.gg","pvpgang.club"],"uui
@levi-nz
levi-nz / Packet ID mappings 1_7_R4
Last active May 14, 2019 01:52
1.7.10 protocol packet ID mappings
SERVERBOUND: 0, C00Handshake
CLIENTBOUND: 0, S00PacketKeepAlive
CLIENTBOUND: 1, S01PacketJoinGame
CLIENTBOUND: 2, S02PacketChat
CLIENTBOUND: 3, S03PacketTimeUpdate
CLIENTBOUND: 4, S04PacketEntityEquipment
CLIENTBOUND: 5, S05PacketSpawnPosition
CLIENTBOUND: 6, S06PacketUpdateHealth
CLIENTBOUND: 7, S07PacketRespawn
CLIENTBOUND: 8, S08PacketPlayerPosLook