Skip to content

Instantly share code, notes, and snippets.

@afedotov
afedotov / gan-mac-faq.md
Last active June 8, 2024 21:21
GAN Smart Cubes MAC address FAQ

Q: What is the cube MAC address?
A: MAC is the Bluetooth device hardware address, each device instance has it unique. It has 48 bits and typically represented as 6 bytes written in hexadecimal and separated by colons or hyphens, for example AB:12:34:5D:34:12.

Q: Why MAC address is ever needed?
A: The GAN smart cube application-layer protocol encrypts all data using AES cypher. Encryption keys are unique for each cube instance, and generated based on cube's MAC address. So to decrypt any data sent by cube it is required for application to know cube MAC address.

Q: But I used another GAN cube with Cubeast, or different smartcubing software, and it does not ever ask me for the MAC address.
A: For some GAN smart cubes range used for MAC addresses was small enough, so Cubeast try to bruteforce address automatically. This can be done in reasonable amount of time. But this is not an option for newer cubes and MAC can't be guessed. Also some software like platform-native applications h

@schmich
schmich / ducky.md
Last active May 23, 2024 09:46
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

import requests
import sys
import json
def waybackurls(host, with_subs):
if with_subs:
url = 'http://web.archive.org/cdx/search/cdx?url=*.%s/*&output=json&fl=original&collapse=urlkey' % host
else:
url = 'http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey' % host
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" source ~/.vimrc.before if it exists.
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
endif
" ================ General Config ====================
@mbasaglia
mbasaglia / rcon.sh
Created June 5, 2014 21:04
A shell script which executes rcon commands
#!/bin/bash
SERVER='localhost'
PORT='26000'
PASSWORD='foo'
SECURE=0
SECURE_PORT="1234"
RCON_HEADER=$(echo -e "\xff\xff\xff\xff")
ESCAPE_CHAR=$(echo -en "\x1b")
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name