Skip to content

Instantly share code, notes, and snippets.

View oubeichen's full-sized avatar
🎯
Focusing

oubeichen oubeichen

🎯
Focusing
  • 10:55 (UTC +08:00)
View GitHub Profile
@rajkosto
rajkosto / odi_keygen.py
Created November 18, 2022 12:56
ODI SFP XPON stick MAC_KEY generator
#!/usr/bin/env python3
#ODI DFP-34X-2C2 MAC_KEY key generator by rajkosto
import sys
import string
import hashlib
args = sys.argv
if len(args) != 2:
sys.exit("Usage: odi_keygen.py YOURMACADDR")
@Component
public class ResourceResolver implements GraphQLQueryResolver {
public String securedResource() {
return "Secured resource";
}
@PreAuthorize("hasRole('ROLE_ADMIN')")
public String securedResourceAdmin() {
return "Secured resource Admin";
}
@smo921
smo921 / consul_lock.go
Last active August 23, 2023 08:08
Go consul lock example
package mrha
import (
"log"
consulapi "github.com/hashicorp/consul/api"
)
// Lock stores data for a consul lock
type Lock struct {
@tiann
tiann / auto_switch_kb.py
Created December 2, 2015 06:51
auto switch keyboard to english in specific applications
#! /usr/bin/env python
# coding: utf-8
'''
auto switch keyboard between different applications
if you want to change the app list, modify the var 'ignore_list'
'''
from AppKit import NSWorkspace, NSWorkspaceDidActivateApplicationNotification, NSWorkspaceApplicationKey
@TobiasWooldridge
TobiasWooldridge / gist:22f0cdca75190b9a473f
Last active September 20, 2025 20:15
How to Unbrick a Kindle Paperwhite

How to unbrick an Amazon Kindle Paperwhite™

This guide instructs you in how to unbrick an Amazon Kindle Paperwhite. The consequences of following it are your own responsibility. This method (opening the Kindle and using the serial interface) should be a last resort and should only be considered if other methods fail

The Guide

  1. Pry open Kindle using a prying tool
  2. Unscrew the screen and remove it from the base. Note that there's a screw hidden under the adhesive at the top in the middle
  3. Solder tin wire to serial ports on the bottom
  4. Attach tin wire to USB TTY device (order is ground, RX, TX, from the kindle's perspective, where GND is the smallest pad) and plug USB TTY device into your computer
  5. Open Putty on your computer in serial mode, with the serial port specified as your USB device and baud configured to 115200