Skip to content

Instantly share code, notes, and snippets.

View alejzeis's full-sized avatar

Alejandro Zeise alejzeis

  • Wisconsin, United States
View GitHub Profile
@alejzeis
alejzeis / arduino_song.c
Created December 12, 2022 01:48
Snippet of code to easily play a song on an Arduino
#define PITCH_B0 31
#define PITCH_C1 33
#define PITCH_CS1 35
#define PITCH_D1 37
#define PITCH_DS1 39
#define PITCH_E1 41
#define PITCH_F1 44
#define PITCH_FS1 46
#define PITCH_G1 49
#define PITCH_GS1 52
@alejzeis
alejzeis / timezone-mappings.csv
Created March 15, 2017 00:12
Linux-Windows Timezone Mappings CSV
AUS Central Standard Time 001 Australia/Darwin
AUS Central Standard Time AU Australia/Darwin
AUS Eastern Standard Time 001 Australia/Sydney
AUS Eastern Standard Time AU Australia/Sydney Australia/Melbourne
Afghanistan Standard Time 001 Asia/Kabul
Afghanistan Standard Time AF Asia/Kabul
Alaskan Standard Time 001 America/Anchorage
Alaskan Standard Time US America/Anchorage America/Juneau America/Metlakatla America/Nome America/Sitka America/Yakutat
Aleutian Standard Time 001 America/Adak
Aleutian Standard Time US America/Adak
@alejzeis
alejzeis / licenseHeaders.py
Last active September 29, 2016 00:19
Small python script to add license headers to a github project. You must have a LICENSE.txt file with your license.
"""
zlib License
(C) 2016 jython234
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
@alejzeis
alejzeis / CustomPacketDemo.java
Created June 12, 2015 16:13
A Demo of using the CustomPacket class to decode/encode MCPE packets.
/*
* Copyright (C) 2015 jython234
*/
CustomPacket cp = new CustomPacket();
cp.decode(rawBuffer); //The rawbuffer is the raw datagram packet's buffer you have recieved.
System.out.println(cp.sequenceNumber); //Access the sequence number to check if you missed any packets from the client
for(CustomPacket.InternalPacket ip : cp.packets){ // Loop thru all the decoded packets
//Access messageIndex, buffer, etc
System.out.println(Arrays.toString(ip.buffer)); //The decoded packet buffer (ClientConnect, Ping, etc)
@alejzeis
alejzeis / jnb.lua
Created May 3, 2015 23:03
JuiceNet Base (Wireshark Dissector)
-- JuiceNet Base Protocol Dissector --
-- By: jython234 (https://github.com/jython234) --
-- Copyright (C) 2015 --
jnb_proto = Proto("JNB", "JuiceNet Base Protocol")
local bit = require("bit")
local subtree
function jnb_proto.dissector (buffer,pinfo,tree)
-- Dissect packets here --
pinfo.cols.protocol = "JNB"
@alejzeis
alejzeis / login_mcpc.md
Last active August 29, 2015 14:06
Login sequence for MCPC

Login Sequence:

0. Packet format:

First comes a VarInt of the packet's length (in bytes). Then there is the 1 byte packet ID, and finally the payload.

1. Handshake packet:

First of all, a handshake packet must be sent:

| Field | Example | Field Type | Length |