Skip to content

Instantly share code, notes, and snippets.

@sourada-e5
sourada-e5 / object_stream_reader.py
Created January 29, 2018 17:01
Read Java ObjectOutputStream from Python (not full-featured or robust, just useful)
class ObjectStreamReader(object):
def __init__(self, s):
self.stream = s
self.stream.read(2 + 2)
self.cur_block_remaining = self.get_block_length()
def get_block_length(self):
type = ord(self.stream.read(1)[0])
if type == 0x7a:
return struct.unpack('>i', self.stream.read(4))[0]
@Ircama
Ircama / LgMagicRemoteKeys.md
Last active July 28, 2026 21:16
Replacing Netflix and Amazon keys of the webOS LG TV LG Magic Remote with other apps

Replacing Netflix and Amazon keys of the webOS LG TV LG Magic Remote with other apps

This procedure allows substituting one or both Netflix and Amazon keys of the Magic Remote Control Unit with other apps or TV control menus of the webOS LG TV.

Netflix and Amazon keys can be found just over the Red-Green-Yellow-Blue color buttons of such remote.

Assumption for this procedure is that you accept to uninstall the apps related to the keys to be substituted. Example: if you want to replace the Netflix key, you need to uninstall Netflix (possibly, you are not using Netflix if you do not need such key).

To uninstall Netflix or Amazon Prime, press the Home key of the Magic Remote, select the "LG Content Store" app, press "APP" at the top of the screen, press "My Apps", press the "Rem

import UIKit
class BaseImageView: UIView{
var roundedShape = CAShapeLayer()
var curvedPath: UIBezierPath!
var shapeColor: UIColor!
var circular: Bool!
var shadow: Bool!
@bluewalk
bluewalk / Fix_standby_battery_drain_MBPro-BigSur.md
Last active May 3, 2025 09:37
Fix standby battery drain Macbook Pro - Big Sur

Fixing standby battery drain issue Macbook Pro - Big Sur

1. Reboot into recovery mode

  1. Disable FileVault (System Preferences -> Security & Privacy -> FileVault -> Turn Off Filevault)
  2. Boot to recovery mode by holding Command + R during boot

2. Preparation

  1. Open Terminal
  2. Run csrutil authenticated-root disable to disable signature validation on the bootable snapshots
  3. Run ioreg -l | grep board-id to get your board ID and write it down.