Skip to content

Instantly share code, notes, and snippets.

@pellaeon
pellaeon / user.css
Last active September 7, 2024 11:35 — forked from bef/user.css
darktable-theme
/* custom darktable theme on top of darktable-elegant-darker
created by BeF - 05/2024
see https://gist.github.com/bef/562f282d7157a7ef47b99dc91693fb5a
modified by pellaeon - 09/2024
*/
/* custom colors */
@define-color checked #3ea0d7;
@define-color visible-border @grey_60;
@define-color panel_bg @grey_05;
Scope (PCI0.LPC0.EC0.HKEY)
{
Method (GSSS, 1, NotSerialized)
{
Local0 = 0x00
If (((SHDW & 0x80) == 0x00))
{
Local0 |= 0x00010000
}
@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 June 3, 2024 19:59
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);
-