Skip to content

Instantly share code, notes, and snippets.

View niepiekm's full-sized avatar

Marek Niepiekło niepiekm

View GitHub Profile
@throwaway96
throwaway96 / webos-notes.md
Last active February 28, 2024 21:06
Notes about webOS stuff

Debugging apps (inspect)

Inspectability

Developer mode apps (those installed in /media/developer) are inspectable by default. Other apps (e.g., from the LG Content Store) are not inspectable by default, but you can add "inspectable": true to their appinfo.json to enable it. Debugging system apps (i.e., those in /usr/palm/applications) may require a special flag.

Ports

The developer mode app debugger listens on port 9998.

System service and system app debugging uses ports 5885 and 9999, respectively. However, debugging for these is not normally enabled.

Inspecting an app

C/C++ performance pitfall: int8_t, aliasing and the ways out

When I was working on a generic port of Google's hashmap to C, I wrote a function that (ignoring irrelevant parts) looked like this:

typedef struct {
    uint8_t *bytes;
    size_t len;
} bytebuf;
@kconner
kconner / macOS Internals.md
Last active May 17, 2024 06:10
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@buahaha
buahaha / httrack_manual.md
Created February 19, 2023 04:11
Httrack manual, kept here because I can't on my website, https://nutek.neosb.net

Httrack Users Guide (3.10)

By Fred Cohen


Background and Introduction

I started using httrack in mid-2000 and found it to be an excellent tool for imaging web sites. Various words are used to describe this process -

@throwaway96
throwaway96 / crashd.md
Last active May 13, 2024 11:50
crashd instructions

News

New exploit for webOS 3.5+: DejaVuln (2024-04-21)

See dejavuln-autoroot for a simpler exploit that works on webOS 3.5+ TVs (i.e., models from 2017 and later). It is unpatched as of 2024-04-21 and does not require Developer Mode or even a network connection—just a USB drive.

Otherwise:

  • If you have a webOS 5–8 TV with old enough firmware, WTA (which does not require Dev Mode) will still work.
  • If you have a webOS 4.x TV, you can also try CVE-2023-6319, which is unpatched on the latest (final?) firmware for webOS 4.0 (2018) models.
  • While there will eventually be fully software-based exploits released for older models, they can currently be rooted via NVM.
@niepiekm
niepiekm / _gitconfig
Last active September 15, 2023 09:29
[user]
name = Marek Niepieklo
email = xxx@yyy.zzz
[alias]
alias = "!f() {[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1}; f"
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
amend = commit --amend -m
@leandronsp
leandronsp / 001-README.md
Last active December 27, 2023 12:04
OOP in Bash script

OOP in Bash script

Wait, what?

Inspired by this awesome article.

Prelude about OOP

According to wikipedia, OOP is a programming paradigm or technique based on the concept of "objects". The object structure contain data and behaviour.

Data is the object's state, which should be isolated and must be private.

@district10
district10 / lts_2021_11_02.patch
Created May 24, 2022 02:20
abseil QNX build, based on lts_2021_11_02 (commit: 215105818)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 750a475..110a1b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,16 @@
# and then issuing `yum install cmake3` on the command line.
cmake_minimum_required(VERSION 3.5)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
@massenz
massenz / fizzbuzz.py
Created March 26, 2022 08:02
FizzBuzz in less than 5 minutes, as described at http://codetrips.com
#!/usr/bin/env python
#
# FizzBuzz -- created by M. Massenzio, 2022-03-26
import sys
n = sys.argv[1]
for i in range(3, int(n) + 1):
out = ""
if i % 3 == 0:
@district10
district10 / abseil-qnx-patch.diff
Last active May 18, 2023 14:13
based on 20200225.2 (c51510d1). Don't forget to add `-Wl,--start-group`, `-Wl,--end-group` when linking. Related: https://github.com/abseil/abseil-cpp/issues/566#issuecomment-1013611434
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48cb6eb..f730711 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,15 @@
# (https://fedoraproject.org/wiki/EPEL#Extra_Packages_for_Enterprise_Linux_.28EPEL.29)
# and then issuing `yum install cmake3` on the command line.
cmake_minimum_required(VERSION 3.5)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)