Skip to content

Instantly share code, notes, and snippets.

@pellaeon
pellaeon / child-gating-poc.py
Created September 23, 2022 12:21
Frida child-gating and spawn-gating example
"""
This POC is based on example from https://frida.re/news/#child-gating
and is aimed to instrument child processes along with the main one.
"""
from __future__ import print_function
import frida
from frida_tools.application import Reactor
import threading
@pellaeon
pellaeon / pin-opencc
Last active December 30, 2021 07:29
/etc/apt/preferences.d/pin-opencc settings to use opencc from jammy in impish
Explanation: Use opencc from jammy to fix rime issue https://github.com/rime/librime/issues/425
Package: *
Pin: release n=jammy
Pin-Priority: -10
Package: librime*
Pin: release n=jammy
Pin-Priority: 500
Package: opencc libopencc-data
@pellaeon
pellaeon / zsys-setup
Created December 23, 2021 10:10
Modified /usr/share/ubiquity/zsys-setup to make SWAP partition 33GB, zfs compression=zstd, zfs ashift=16
#!/bin/sh
#
# This script creates ZFS pools and dataset compatible with zsys
#
# Layout:
# bpool/BOOT/ubuntu_${UUID}
# rpool/ROOT/ubuntu_${UUID}
# rpool/ROOT/ubuntu_${UUID}/var -o canmount=off
@pellaeon
pellaeon / packagexml_certs.sh
Last active July 16, 2020 23:11
Shell script that takes android /data/system/packages.xml as input and print the containing certificates
#!/bin/bash
input="$1"
while IFS= read -r line
do
line1=`echo "$line" | egrep 'cert index="[0-9]+" key="[0-9a-z]+"'`
if [ $? -eq 0 ]
then
index=`echo $line1 | grep -oP 'index="\K\d+'`
hex=`echo $line1 | grep -oP 'key="\K[0-9a-z]+'`
sslinfo=`echo $hex | xxd -p -r | openssl x509 -inform DER -in /dev/stdin -text`
@pellaeon
pellaeon / -etc-nginx-conf.d-YOUR_UUID-user.conf
Last active May 5, 2023 04:20
Nextcloud configuration for Synology Webstation, using nginx
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Referrer-Policy no-referrer;
# Remove X-Powered-By, which is an information leak
fastcgi_hide_header X-Powered-By;
@pellaeon
pellaeon / 1.log
Created February 3, 2019 09:29
LOS 15.1 gallery cannot view photo
02-03 17:22:22.355 2921 3087 I Camera3-Device: disconnect: E [35/1836]
02-03 17:22:22.356 2921 3087 I CameraService: onTorchStatusChangedLocked: Torch status changed for cameraId=0, newStatus=1
02-03 17:22:22.357 2921 3087 I CameraService: disconnect: Disconnected client for camera 0 for PID 12614 02-03 17:22:22.358 12614 12700 W zygote : Long monitor contention with owner CameraDeviceHandler (12668) at void android.hardware.camera2.impl.CameraDeviceImpl.close()(CameraDeviceImpl.java:1046) waiters=0 in void android.hardware.camer$
2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureStarted(android.hardware.camera2.impl.CaptureResultExtras, long) for 1.085s
02-03 17:22:22.366 12614 12659 W NdkImageReader: A f
@pellaeon
pellaeon / default.custom.yaml
Last active January 19, 2019 04:56
Rime default.yaml
patch:
schema_list:
- schema: luna_pinyin_tw
- schema: luna_pinyin
- schema: luna_pinyin_fluency
- schema: luna_pinyin_simp
"key_binder/bindings":
# Emacs style
- { when: composing, accept: Control+p, send: Up }
- { when: composing, accept: Control+n, send: Down }
@pellaeon
pellaeon / dont-check-pref-hash.patch
Created November 3, 2018 16:31
Patch PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckValue
# https://github.com/Eloston/ungoogled-chromium/issues/538
--- services/preferences/tracked/pref_hash_store_impl.cc 2018-11-03 23:30:48.000000000 +0800
+++ services/preferences/tracked/pref_hash_store_impl.cc 2018-11-03 23:34:27.000000000 +0800
@@ -156,33 +156,7 @@
ValueState PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckValue(
const std::string& path,
const base::Value* initial_value) const {
- std::string last_hash;
- contents_->GetMac(path, &last_hash);
-
pellaeon@apua-ubuntu1604-desktop:~$ sudo snap anbox stop
[sudo] password for pellaeon:
error: unknown command "anbox", see "snap --help"
pellaeon@apua-ubuntu1604-desktop:~$ sudo snap stop anbox
Stopped.
pellaeon@apua-ubuntu1604-desktop:~$ anbox container-manager --help
NAME:
container-manager - Start the container manager service
USAGE:
@pellaeon
pellaeon / jenkins build script
Created November 18, 2017 05:34
鳳梨酥計劃
#!/usr/local/bin/bash
set -ex
BSDINIT_DIR="$JENKINS_HOME/workspace/bsd-cloudinit/bsd-cloudinit_master"
BSDINSTALLER_DIR="$JENKINS_HOME/workspace/bsd-cloudinit/bsd-cloudinit-installer_master"
TEST_DIR="$BSDINSTALLER_DIR/test"
TEST_IMG="$TEST_DIR/tester.raw"